From c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sun, 19 Apr 2020 17:19:32 -0400 Subject: Inital commit --- .../Editor/Window/TimelineWindow_StateChange.cs | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/TimelineWindow_StateChange.cs (limited to 'Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/TimelineWindow_StateChange.cs') diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/TimelineWindow_StateChange.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/TimelineWindow_StateChange.cs new file mode 100644 index 0000000..789c0ba --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/TimelineWindow_StateChange.cs @@ -0,0 +1,53 @@ +namespace UnityEditor.Timeline +{ + partial class TimelineWindow + { + void InitializeStateChange() + { + state.OnPlayStateChange += OnPreviewPlayModeChanged; + state.OnDirtyStampChange += OnStateChange; + state.OnBeforeSequenceChange += OnBeforeSequenceChange; + state.OnAfterSequenceChange += OnAfterSequenceChange; + + state.OnRebuildGraphChange += () => + { + // called when the graph is rebuild, since the UI tree isn't necessarily rebuilt. + if (!state.rebuildGraph) + { + // send callbacks to the tacks + if (treeView != null) + { + var allTrackGuis = treeView.allTrackGuis; + if (allTrackGuis != null) + { + for (int i = 0; i < allTrackGuis.Count; i++) + allTrackGuis[i].OnGraphRebuilt(); + } + } + } + }; + + state.OnTimeChange += () => + { + if (EditorApplication.isPlaying == false) + { + state.UpdateRecordingState(); + EditorApplication.SetSceneRepaintDirty(); + } + + // the time is sync'd prior to the callback + state.Evaluate(); // will do the repaint + + InspectorWindow.RepaintAllInspectors(); + }; + + state.OnRecordingChange += () => + { + if (!state.recording) + { + TrackAssetRecordingExtensions.ClearRecordingState(); + } + }; + } + } +} -- cgit v1.2.3