Пример #1
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            if (!needsReset && GUILayout.Button("Play Tween"))
            {
                try
                {
                    Tween tween = TweenModule.GenerateTween();
                    //Tween tween = TweenModule.transform.DOMoveX(2, 1);

                    DOTweenEditorPreview.PrepareTweenForPreview(tween);
                    DOTweenEditorPreview.Start();
                    needsReset = true;
                }
                catch (Exception e)
                {
                    Debug.Log("Could not preview: " + e);
                }
            }
            if (needsReset && GUILayout.Button("Reset Tween"))
            {
                //TweenModule.Tween.Rewind();
                //TweenModule.Tween.Kill();
                DOTweenEditorPreview.Stop(true);
                needsReset = false;
            }
        }
Пример #2
0
 void CompleteTween()
 {
     if (!EditorApplication.isPlaying)
     {
         DOTweenEditorPreview.Stop(true);
     }
     _tween = null;
 }
Пример #3
0
 public static void StopButtonPreview(RectTransform rectTransform, CanvasGroup canvasGroup)
 {
     DOTweenEditorPreview.Stop(true);
     if (s_previewIsPlaying)
     {
         ResetButtonToStartValues(rectTransform, canvasGroup);
     }
     s_previewIsPlaying = false;
 }
Пример #4
0
 public static void StopPopupPreview(UIPopup popup)
 {
     DOTweenEditorPreview.Stop(true);
     popup.ResetToStartValues();
     popup.Container.ResetToStartValues();
     if (popup.HasOverlay)
     {
         popup.Overlay.ResetToStartValues();
     }
     s_previewIsPlaying = false;
 }
    public void StopAllAnimations()
    {
#if UNITY_EDITOR
        if (!Application.isPlaying)
        {
            DOTweenEditorPreview.Stop();
        }
#endif
        animationBack?.Kill();
        animation?.Kill();
    }
Пример #6
0
 private void ResetSimulatorTween(bool resetTweenTarget, bool resetProgress)
 {
     if (m_simulatorTween == null)
     {
         return;
     }
     m_simulatorTween.Kill(true);
     m_simulatorTween = null;
     if (resetProgress)
     {
         Target.SetProgress(0, true);
     }
     DOTweenEditorPreview.Stop();
     Target.OnValueUpdated();
 }
        private void StopPreview()
        {
            if (!Application.isPlaying)
            {
                EditorApplication.update -= EditorUpdate;
                DOTweenEditorPreview.Stop(true);
            }

            sequencerController.OnSequenceFinishedPlayingEvent -= StopPreview;
            for (int i = 0; i < activeSequencers.Length; i++)
            {
                AnimationSequencerController animationSequencerController = activeSequencers[i];
                if (animationSequencerController == null)
                {
                    continue;
                }

                animationSequencerController.Stop();
            }

            isPreviewPlaying = false;
            Repaint();
        }
Пример #8
0
 public static void StopViewPreview(UIView view)
 {
     DOTweenEditorPreview.Stop(true);
     view.ResetToStartValues();
     s_previewIsPlaying = false;
 }
Пример #9
0
        public static void StopTweens()
        {
#if UNITY_EDITOR
            DOTweenEditorPreview.Stop();
#endif
        }
Пример #10
0
 static void Stop()
 {
     Debug.Log("EditorPreviewer ► Stop and reset");
     DOTweenEditorPreview.Stop(true);
 }
Пример #11
0
 void CompleteTween()
 {
     DOTweenEditorPreview.Stop(true);
     _tween = null;
 }