summaryrefslogtreecommitdiff
path: root/Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Utilities/TimelineUndo.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/Runtime/Utilities/TimelineUndo.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/Runtime/Utilities/TimelineUndo.cs')
-rw-r--r--Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Utilities/TimelineUndo.cs90
1 files changed, 0 insertions, 90 deletions
diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Utilities/TimelineUndo.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Utilities/TimelineUndo.cs
deleted file mode 100644
index b6392f0..0000000
--- a/Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Utilities/TimelineUndo.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using UnityEngine.Playables;
-
-#if UNITY_EDITOR
-using UnityEditor;
-#endif
-
-namespace UnityEngine.Timeline
-{
- static class TimelineUndo
- {
- public static void PushDestroyUndo(TimelineAsset timeline, Object thingToDirty, Object objectToDestroy, string operation)
- {
-#if UNITY_EDITOR
- if (objectToDestroy == null || !DisableUndoGuard.enableUndo)
- return;
-
- if (thingToDirty != null)
- EditorUtility.SetDirty(thingToDirty);
-
- if (timeline != null)
- EditorUtility.SetDirty(timeline);
-
- Undo.DestroyObjectImmediate(objectToDestroy);
-#else
- if (objectToDestroy != null)
- Object.Destroy(objectToDestroy);
-#endif
- }
-
- [Conditional("UNITY_EDITOR")]
- public static void PushUndo(Object thingToDirty, string operation)
- {
-#if UNITY_EDITOR
- if (thingToDirty != null && DisableUndoGuard.enableUndo)
- {
- var track = thingToDirty as TrackAsset;
- if (track != null)
- track.MarkDirty();
-
- EditorUtility.SetDirty(thingToDirty);
- Undo.RegisterCompleteObjectUndo(thingToDirty, "Timeline " + operation);
- }
-#endif
- }
-
- [Conditional("UNITY_EDITOR")]
- public static void RegisterCreatedObjectUndo(Object thingCreated, string operation)
- {
-#if UNITY_EDITOR
- if (DisableUndoGuard.enableUndo)
- {
- Undo.RegisterCreatedObjectUndo(thingCreated, "Timeline " + operation);
- }
-#endif
- }
-
-#if UNITY_EDITOR
- public struct DisableUndoGuard : IDisposable
- {
- internal static bool enableUndo = true;
- static readonly Stack<bool> m_UndoStateStack = new Stack<bool>();
- bool m_Disposed;
- public DisableUndoGuard(bool disable)
- {
- m_Disposed = false;
- m_UndoStateStack.Push(enableUndo);
- enableUndo = !disable;
- }
-
- public void Dispose()
- {
- if (!m_Disposed)
- {
- if (m_UndoStateStack.Count == 0)
- {
- Debug.LogError("UnMatched DisableUndoGuard calls");
- enableUndo = true;
- return;
- }
- enableUndo = m_UndoStateStack.Pop();
- m_Disposed = true;
- }
- }
- }
-#endif
- }
-}