static void StartupGlobalPreview() { DOTweenEditorPreview.Start(); #if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 UnityEditor.EditorApplication.playmodeStateChanged += StopAllPreviews; #else UnityEditor.EditorApplication.playModeStateChanged += StopAllPreviews; #endif }
static void AddAnimationToGlobalPreview(DOTweenAnimation src) { if (!src.isActive) { return; } if (_previewOnlyIfSetToAutoPlay && !src.autoPlay) { return; } Tween t = src.CreateEditorPreview(); _AnimationToTween.Add(src, new TweenInfo(src, t, src.isFrom)); DOTweenEditorPreview.PrepareTweenForPreview(t); }
public static void StopAllPreviews() { _TmpKeys.Clear(); foreach (KeyValuePair <DOTweenAnimation, TweenInfo> kvp in _AnimationToTween) { _TmpKeys.Add(kvp.Key); } StopPreview(_TmpKeys); _TmpKeys.Clear(); _AnimationToTween.Clear(); DOTweenEditorPreview.Stop(); EditorApplication.playmodeStateChanged -= StopAllPreviews; InternalEditorUtility.RepaintAllViews(); }
static void AddAnimationToGlobalPreview(DOTweenAnimation src) { if (!src.isActive) { return; // Ignore sources whose tweens have been set to inactive } if (_previewOnlyIfSetToAutoPlay && !src.autoPlay) { return; } Tween t = src.CreateEditorPreview(); _AnimationToTween.Add(src, new TweenInfo(src, t, src.isFrom)); // Tween setup DOTweenEditorPreview.PrepareTweenForPreview(t); }
public static void StopAllPreviews() { _TmpKeys.Clear(); foreach (KeyValuePair <DOTweenAnimation, TweenInfo> kvp in _AnimationToTween) { _TmpKeys.Add(kvp.Key); } StopPreview(_TmpKeys); _TmpKeys.Clear(); _AnimationToTween.Clear(); DOTweenEditorPreview.Stop(); #if UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6 || UNITY_5 UnityEditor.EditorApplication.playmodeStateChanged -= StopAllPreviews; #else UnityEditor.EditorApplication.playModeStateChanged -= StopAllPreviews; #endif InternalEditorUtility.RepaintAllViews(); }
static void StartupGlobalPreview() { DOTweenEditorPreview.Start(); EditorApplication.playmodeStateChanged += StopAllPreviews; }