summaryrefslogtreecommitdiff
path: root/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/TimelineWindow_Breadcrumbs.cs
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2020-08-20 23:40:50 -0400
committerAndrew Lee <alee14498@protonmail.com>2020-08-20 23:40:50 -0400
commit3af4c218c0e70167db23a6303d2af30aff37d2fe (patch)
tree927f29edcf54ab562f40f3d1c6cb69287c7f5980 /Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/TimelineWindow_Breadcrumbs.cs
parentb6daed0af784f4e9bc13329dd87c671b06ee1c65 (diff)
downloadProject-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.tar.gz
Project-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.tar.bz2
Project-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.zip
Removed a bunch of stuff; Changes
Diffstat (limited to 'Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/TimelineWindow_Breadcrumbs.cs')
-rw-r--r--Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/TimelineWindow_Breadcrumbs.cs118
1 files changed, 0 insertions, 118 deletions
diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/TimelineWindow_Breadcrumbs.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/TimelineWindow_Breadcrumbs.cs
deleted file mode 100644
index e5673cd..0000000
--- a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/TimelineWindow_Breadcrumbs.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using UnityEngine;
-using UnityEngine.Playables;
-using UnityEngine.Timeline;
-
-namespace UnityEditor.Timeline
-{
- partial class TimelineWindow
- {
- List<BreadCrumbTitle> m_BreadCrumbLabels = new List<BreadCrumbTitle>(100);
-
- static TitleMode GetTitleMode(ISequenceState sequence)
- {
- var prefabStage = UnityEditor.Experimental.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
- // Top level
- if (sequence.hostClip == null)
- {
- if (sequence.director != null && prefabStage != null && prefabStage.IsPartOfPrefabContents(sequence.director.gameObject))
- return TitleMode.Prefab;
- if (sequence.director != null && PrefabUtility.IsPartOfPrefabAsset(sequence.director))
- return TitleMode.PrefabOutOfContext;
- if (sequence.director != null && !sequence.director.isActiveAndEnabled)
- return TitleMode.DisabledComponent;
- if (sequence.director != null)
- return TitleMode.GameObject;
- if (sequence.asset != null)
- return TitleMode.Asset;
- }
- // Subtimelines only get an error icon
- else if (sequence.director != null && !sequence.director.isActiveAndEnabled && !PrefabUtility.IsPartOfPrefabAsset(sequence.director))
- return TitleMode.DisabledComponent;
-
- return TitleMode.None;
- }
-
- void DoBreadcrumbGUI()
- {
- if (state == null)
- return;
- int count = 0;
- foreach (var sequence in state.GetAllSequences())
- {
- BreadCrumbTitle title = new BreadCrumbTitle()
- {
- name = DisplayNameHelper.GetDisplayName(sequence),
- mode = GetTitleMode(sequence)
- };
- if (count >= m_BreadCrumbLabels.Count)
- m_BreadCrumbLabels.Add(title);
- else
- m_BreadCrumbLabels[count] = title;
- count++;
- }
-
- if (m_BreadCrumbLabels.Count > count)
- m_BreadCrumbLabels.RemoveRange(count, m_BreadCrumbLabels.Count - count);
-
- using (new EditorGUI.DisabledScope(currentMode.headerState.breadCrumb == TimelineModeGUIState.Disabled))
- {
- BreadcrumbDrawer.Draw(breadCrumbAreaWidth, m_BreadCrumbLabels, NavigateToBreadcrumbIndex);
- }
- }
-
- void NavigateToBreadcrumbIndex(int index)
- {
- state.PopSequencesUntilCount(index + 1);
- }
-
- void DoSequenceSelectorGUI()
- {
- using (new EditorGUI.DisabledScope(currentMode.headerState.sequenceSelector == TimelineModeGUIState.Disabled))
- {
- if (EditorGUILayout.DropdownButton(DirectorStyles.timelineSelectorArrow, FocusType.Passive, DirectorStyles.Instance.sequenceSwitcher, GUILayout.Width(WindowConstants.selectorWidth)))
- ShowSequenceSelector();
- }
- }
-
- void ShowSequenceSelector()
- {
- var allDirectors = TimelineUtility.GetDirectorsInSceneUsingAsset(null);
-
- var formatter = new SequenceMenuNameFormater();
- var namesAndDirectors = new List<ValueTuple<string, PlayableDirector>>();
- foreach (var d in allDirectors)
- {
- if (d.playableAsset is TimelineAsset)
- {
- var text = formatter.Format(DisplayNameHelper.GetDisplayName(d));
- namesAndDirectors.Add(new ValueTuple<string, PlayableDirector>(text, d));
- }
- }
-
- var sequenceMenu = new GenericMenu();
- foreach (var (timelineName, playableDirector) in namesAndDirectors.OrderBy(i => i.Item1))
- {
- var isCurrent = state.masterSequence.director == playableDirector;
- sequenceMenu.AddItem(new GUIContent(timelineName), isCurrent, OnSequenceSelected, playableDirector);
- }
-
- if (allDirectors.Length == 0)
- sequenceMenu.AddDisabledItem(DirectorStyles.noTimelinesInScene);
-
- sequenceMenu.DropDown(EditorGUILayout.s_LastRect);
- }
-
- void OnSequenceSelected(object arg)
- {
- var directorToBindTo = (PlayableDirector)arg;
- if (directorToBindTo)
- {
- // don't just select the object, it may already be selected.
- SetCurrentTimeline(directorToBindTo);
- }
- }
- }
-}