public override void OnEnter()
        {
            int numberOfTweensInvolved = 0;

            switch (tweenIdType)
            {
            case Doozy.PlayMaker.Actions.TweenId.UseString: if (string.IsNullOrEmpty(stringAsId.Value) == false)
                {
                    numberOfTweensInvolved = DOTween.Goto(stringAsId.Value, to.Value, andPlay.Value);
                }
                break;

            case Doozy.PlayMaker.Actions.TweenId.UseTag: if (string.IsNullOrEmpty(tagAsId.Value) == false)
                {
                    numberOfTweensInvolved = DOTween.Goto(tagAsId.Value, to.Value, andPlay.Value);
                }
                break;

            case Doozy.PlayMaker.Actions.TweenId.UseGameObject: if (gameObjectAsId.Value != null)
                {
                    numberOfTweensInvolved = DOTween.Goto(gameObjectAsId.Value, to.Value, andPlay.Value);
                }
                break;
            }
            if (debugThis.Value)
            {
                State.Debug("DOTween Control Methods Go To By Id - " + numberOfTweensInvolved + " tweens involved");
            }
            Finish();
        }
Beispiel #2
0
        public override void OnEnter()
        {
            int numberOfTweensInvolved = 0;

            switch (tweenIdType)
            {
            case DOTweenActionsEnums.TweenId.UseString: if (string.IsNullOrEmpty(stringAsId.Value) == false)
                {
                    numberOfTweensInvolved = DOTween.Goto(stringAsId.Value, to.Value, andPlay.Value);
                }
                break;

            case DOTweenActionsEnums.TweenId.UseTag: if (string.IsNullOrEmpty(tagAsId.Value) == false)
                {
                    numberOfTweensInvolved = DOTween.Goto(tagAsId.Value, to.Value, andPlay.Value);
                }
                break;

            case DOTweenActionsEnums.TweenId.UseGameObject: if (gameObjectAsId.Value != null)
                {
                    numberOfTweensInvolved = DOTween.Goto(gameObjectAsId.Value, to.Value, andPlay.Value);
                }
                break;
            }

            if (debugThis.Value)
            {
                Debug.Log("GameObject [" + State.Fsm.GameObjectName + "] FSM [" + State.Fsm.Name + "]  State [" + State.Name + "] - DOTween Control Methods Go To By Id - SUCCESS! - " + numberOfTweensInvolved + " tweens involved");
            }

            Finish();
        }
Beispiel #3
0
    static void GUIScrubber(float duration, Tween controller)
    {
        if (controller == null)
        {
            float prevSliderPos = sliderPos;
            sliderPos = GUILayout.HorizontalSlider(sliderPos, 0.0f, duration);
            if (!Mathf.Approximately(sliderPos, prevSliderPos))
            {
                DOTween.Goto(sliderPos);
            }
        }
        else
        {
            // Get slider ID to be used to check mouseDown behaviour
            int sliderId = GUIUtility.GetControlID(FocusType.Passive) + 1;
            DOTween.Goto(GUILayout.HorizontalSlider(controller.Elapsed(false), 0.0f, controller.Duration(false)), controller.IsPlaying());
            // Check mouse down on slider, and pause tweens accordingly.
            if (sliderId != 0 && Event.current.type == EventType.used)
            {
                if (GUIUtility.hotControl == sliderId)
                {
                    DOTween.Pause();
                }
            }

            // DOTween.Goto(GUILayout.HorizontalSlider(controller.Elapsed(false), 0.0f, controller.Duration(false)), controller.IsPlaying());
        }
    }
Beispiel #4
0
    void OnGUI()
    {
        DGUtils.BeginGUI();

        GUILayout.Label("Is backwards: " + pathTweens[0].isBackwards);
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Play"))
        {
            DOTween.Play();
        }
        if (GUILayout.Button("Flip"))
        {
            DOTween.Flip();
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Goto duration x 2"))
        {
            DOTween.Goto(duration * 2);
        }
        if (GUILayout.Button("Goto duration x 0.5"))
        {
            DOTween.Goto(duration * 0.5f);
        }
        if (GUILayout.Button("Goto WP 0"))
        {
            pathTweens[0].GotoWaypoint(0);
        }
        if (GUILayout.Button("Goto WP 2"))
        {
            pathTweens[0].GotoWaypoint(2);
        }
        if (GUILayout.Button("Goto WP 15"))
        {
            pathTweens[0].GotoWaypoint(15);
        }
        GUILayout.EndHorizontal();

        DGUtils.EndGUI();
    }
Beispiel #5
0
    void OnGUI()
    {
        DGUtils.BeginGUI();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("TogglePause"))
        {
            DOTween.TogglePause();
        }
        if (GUILayout.Button("Complete"))
        {
            DOTween.Complete();
        }
        if (GUILayout.Button("Restart"))
        {
            DOTween.Restart();
        }
        if (GUILayout.Button("Rewind"))
        {
            DOTween.Rewind();
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Goto 1"))
        {
            DOTween.Goto(1);
        }
        if (GUILayout.Button("Goto 2"))
        {
            DOTween.Goto(2);
        }
        if (GUILayout.Button("Goto 3"))
        {
            DOTween.Goto(3);
        }
        GUILayout.EndHorizontal();

        DGUtils.EndGUI();
    }
Beispiel #6
0
    void OnGUI()
    {
        DGUtils.BeginGUI();

        DGUtils.GUIScrubber(controller);

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("TogglePause"))
        {
            DOTween.TogglePause();
        }
        if (GUILayout.Button("Goto 1.5"))
        {
            DOTween.Goto(1.5f);
        }
        if (GUILayout.Button("Kill"))
        {
            DOTween.Kill();
        }
        GUILayout.EndHorizontal();

        DGUtils.EndGUI();
    }
Beispiel #7
0
    void OnGUI()
    {
        DGUtils.BeginGUI();

        if (GUILayout.Button("TogglePause"))
        {
            DOTween.TogglePause();
        }

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Rewind"))
        {
            DOTween.Rewind();
        }
        if (GUILayout.Button("Restart"))
        {
            DOTween.Restart();
        }
        if (GUILayout.Button("Complete"))
        {
            DOTween.Complete();
        }
        if (GUILayout.Button("Flip"))
        {
            DOTween.Flip();
        }
        if (GUILayout.Button("Goto 0.5"))
        {
            DOTween.Goto(0.5f);
        }
        if (GUILayout.Button("Goto 1"))
        {
            DOTween.Goto(1);
        }
        if (GUILayout.Button("Goto 1.5"))
        {
            DOTween.Goto(1.5f);
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Sequence > LoopType.Restart"))
        {
            NewSequence(LoopType.Restart, false);
        }
        if (GUILayout.Button("Sequence > LoopType.Restart > Flipped"))
        {
            NewSequence(LoopType.Restart, true);
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Sequence > LoopType.Yoyo"))
        {
            NewSequence(LoopType.Yoyo, false);
        }
        if (GUILayout.Button("Sequence > LoopType.Yoyo > Flipped"))
        {
            NewSequence(LoopType.Yoyo, true);
        }
        GUILayout.EndHorizontal();

        DGUtils.EndGUI();
    }
Beispiel #8
0
    void OnGUI()
    {
        DGUtils.BeginGUI();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Play All"))
        {
            Debug.Log("Played tweens: " + DOTween.Play());
        }
        if (GUILayout.Button("Pause All"))
        {
            Debug.Log("Paused tweens: " + DOTween.Pause());
        }
        if (GUILayout.Button("Kill All"))
        {
            Debug.Log("Killed tweens: " + DOTween.Kill());
        }
        if (GUILayout.Button("Complete+Kill All"))
        {
            Debug.Log("Killed tweens: " + DOTween.Kill(true));
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Rewind All"))
        {
            Debug.Log("Rewinded tweens: " + DOTween.Rewind());
        }
        if (GUILayout.Button("Restart All"))
        {
            Debug.Log("Restarted tweens: " + DOTween.Restart());
        }
        if (GUILayout.Button("Complete All"))
        {
            Debug.Log("Completed tweens: " + DOTween.Complete());
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("PlayForward All"))
        {
            Debug.Log("PlayForwarded tweens: " + DOTween.PlayForward());
        }
        if (GUILayout.Button("PlayBackwards All"))
        {
            Debug.Log("PlayBackwarded tweens: " + DOTween.PlayBackwards());
        }
        if (GUILayout.Button("Flip All"))
        {
            Debug.Log("Flipped tweens: " + DOTween.Flip());
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Goto 1.5 All"))
        {
            Debug.Log("Goto-ed tweens: " + DOTween.Goto(1.5f));
        }
        if (GUILayout.Button("Goto 3 All"))
        {
            Debug.Log("Goto-ed tweens: " + DOTween.Goto(3));
        }
        if (GUILayout.Button("Goto 4.5 All"))
        {
            Debug.Log("Goto-ed tweens: " + DOTween.Goto(4.5f));
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Play by Id"))
        {
            Debug.Log("Played tweens: " + DOTween.Play(intId));
        }
        if (GUILayout.Button("Play by StringId"))
        {
            Debug.Log("Played tweens: " + DOTween.Play(stringId));
        }
        if (GUILayout.Button("Play by UnityObjectId"))
        {
            Debug.Log("Played tweens: " + DOTween.Play(this));
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Pause by Id"))
        {
            Debug.Log("Paused tweens: " + DOTween.Pause(intId));
        }
        if (GUILayout.Button("Pause by StringId"))
        {
            Debug.Log("Paused tweens: " + DOTween.Pause(stringId));
        }
        if (GUILayout.Button("Pause by UnityObjectId"))
        {
            Debug.Log("PlaPausedyed tweens: " + DOTween.Pause(this));
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Kill by Id"))
        {
            Debug.Log("Killed tweens: " + DOTween.Kill(intId));
        }
        if (GUILayout.Button("Complete+Kill by Id"))
        {
            Debug.Log("Killed tweens: " + DOTween.Kill(intId, true));
        }
        if (GUILayout.Button("Kill by StringId"))
        {
            Debug.Log("Killed tweens: " + DOTween.Kill(stringId));
        }
        if (GUILayout.Button("Kill by UnityObjectId"))
        {
            Debug.Log("Killed tweens: " + DOTween.Kill(this));
        }
        if (GUILayout.Button("Clear"))
        {
            Debug.Log(":::::::::::: CLEAR");
            DOTween.Clear();
        }
        if (GUILayout.Button("Clear & Reload"))
        {
            Debug.Log(":::::::::::: CLEAR AND RELOAD");
            int level = Application.loadedLevel;
            DOTween.Clear();
            Application.LoadLevel(level);
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        foreach (Tween t in tweens)
        {
            if (GUILayout.Button("Direct Kill"))
            {
                t.Kill();
            }
        }
        GUILayout.EndHorizontal();

        GUILayout.Space(5);

        GUILayout.Label("Global DOTween Timescale");
        GUILayout.BeginHorizontal();
        DOTween.timeScale = GUILayout.HorizontalSlider(DOTween.timeScale, 0.0f, 20.0f);
        if (GUILayout.Button("Reset", GUILayout.Width(80)))
        {
            DOTween.timeScale = 1;
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        for (int i = 0; i < tweens.Length; ++i)
        {
            GUILayout.Label("Single Timescale");
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        foreach (Tween t in tweens)
        {
            t.timeScale = GUILayout.HorizontalSlider(t.timeScale, 0.0f, 20.0f, GUILayout.Width(60));
            if (GUILayout.Button("Reset", GUILayout.Width(80)))
            {
                t.timeScale = 1;
            }
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        foreach (Tween t in tweens)
        {
            GUILayout.Label("Elapsed: " + t.Elapsed(false) +
                            "\nFullElapsed: " + t.Elapsed() +
                            "\nElapsed %: " + t.ElapsedPercentage(false) +
                            "\nFullElapsed %: " + t.ElapsedPercentage() +
                            "\nCompleted Loops: " + t.CompletedLoops()
                            );
        }
        GUILayout.EndHorizontal();

        DGUtils.EndGUI();
    }
Beispiel #9
0
 public static int DOGoto(this Material target, float to, bool andPlay = false)
 {
     return(DOTween.Goto(target, to, andPlay));
 }
Beispiel #10
0
 public static int DOGoto(this Component target, float to, bool andPlay = false)
 {
     return(DOTween.Goto(target, to, andPlay));
 }