コード例 #1
0
 void OnGUI()
 {
     if (GUILayout.Button("TogglePause"))
     {
         DOTween.TogglePauseAll();
     }
     if (GUILayout.Button("Restart"))
     {
         DOTween.RestartAll();
     }
     if (GUILayout.Button("Complete"))
     {
         DOTween.CompleteAll();
     }
     if (GUILayout.Button("Rewind"))
     {
         DOTween.RewindAll();
     }
     if (GUILayout.Button("Flip"))
     {
         DOTween.FlipAll();
     }
     if (GUILayout.Button("Kill And Complete"))
     {
         DOTween.KillAll(true);
     }
 }
コード例 #2
0
 void OnGUI()
 {
     if (GUILayout.Button("Flip"))
     {
         DOTween.FlipAll();
     }
 }
コード例 #3
0
 void OnGUI()
 {
     DGUtils.BeginGUI();
     GUILayout.BeginHorizontal();
     if (GUILayout.Button("Toggle Pause"))
     {
         DOTween.TogglePauseAll();
     }
     if (GUILayout.Button("Rewind"))
     {
         Debug.Log("<color=#ff0000>REWIND</color>");
         DOTween.RewindAll();
     }
     if (GUILayout.Button("Restart"))
     {
         Debug.Log("<color=#ff0000>RESTART</color>");
         DOTween.RestartAll();
     }
     if (GUILayout.Button("Flip"))
     {
         DOTween.FlipAll();
     }
     GUILayout.EndHorizontal();
     DGUtils.EndGUI();
 }
コード例 #4
0
        public override void OnEnter()
        {
            int numberOfTweensFlipped = DOTween.FlipAll();

            if (debugThis.Value)
            {
                State.Debug("DOTween Control Methods Flip All - Flipped " + numberOfTweensFlipped + " tweens");
            }
            Finish();
        }
コード例 #5
0
        public override void OnEnter()
        {
            int numberOfTweensFlipped = DOTween.FlipAll();

            if (debugThis.Value)
            {
                Debug.Log("GameObject [" + State.Fsm.GameObjectName + "] FSM [" + State.Fsm.Name + "]  State [" + State.Name + "] - DOTween Control Methods Flip All - SUCCESS! - Flipped " + numberOfTweensFlipped + " tweens");
            }

            Finish();
        }
コード例 #6
0
    void OnGUI()
    {
        DGUtils.BeginGUI();

        GUILayout.Label("Is backwards: " + pathTweens[0].isBackwards);
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Play"))
        {
            DOTween.PlayAll();
        }
        if (GUILayout.Button("Flip"))
        {
            DOTween.FlipAll();
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Goto duration x 2"))
        {
            DOTween.GotoAll(duration * 2);
        }
        if (GUILayout.Button("Goto duration x 0.5"))
        {
            DOTween.GotoAll(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();
    }
コード例 #7
0
ファイル: Basics.cs プロジェクト: VasylRomanets/dotween
    void OnGUI()
    {
        DGUtils.BeginGUI();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Play All"))
        {
            Debug.Log("Played tweens: " + DOTween.PlayAll());
        }
        if (GUILayout.Button("Pause All"))
        {
            Debug.Log("Paused tweens: " + DOTween.PauseAll());
        }
        if (GUILayout.Button("Kill All"))
        {
            Debug.Log("Killed tweens: " + DOTween.KillAll());
        }
        if (GUILayout.Button("Complete+Kill All"))
        {
            Debug.Log("Killed tweens: " + DOTween.KillAll(true));
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Rewind All"))
        {
            Debug.Log("Rewinded tweens: " + DOTween.RewindAll());
        }
        if (GUILayout.Button("Restart All"))
        {
            Debug.Log("Restarted tweens: " + DOTween.RestartAll());
        }
        if (GUILayout.Button("Complete All"))
        {
            Debug.Log("Completed tweens: " + DOTween.CompleteAll());
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("PlayForward All"))
        {
            Debug.Log("PlayForwarded tweens: " + DOTween.PlayForwardAll());
        }
        if (GUILayout.Button("PlayBackwards All"))
        {
            Debug.Log("PlayBackwarded tweens: " + DOTween.PlayBackwardsAll());
        }
        if (GUILayout.Button("Flip All"))
        {
            Debug.Log("Flipped tweens: " + DOTween.FlipAll());
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Goto 1.5 All"))
        {
            Debug.Log("Goto-ed tweens: " + DOTween.GotoAll(1.5f));
        }
        if (GUILayout.Button("Goto 3 All"))
        {
            Debug.Log("Goto-ed tweens: " + DOTween.GotoAll(3));
        }
        if (GUILayout.Button("Goto 4.5 All"))
        {
            Debug.Log("Goto-ed tweens: " + DOTween.GotoAll(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 = SceneManager.GetActiveScene().buildIndex;
            DOTween.Clear();
            SceneManager.LoadScene(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();
    }
コード例 #8
0
    void OnGUI()
    {
        if (GUILayout.Button("Rich Text Support: " + (richTextEnabled ? "ON" : "OFF")))
        {
            richTextEnabled = !richTextEnabled;
        }

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Color To Green"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOColor(Color.green, 1).SetEase(Ease.Linear);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOColor(Color.green, 1).SetEase(Ease.Linear);
            }
        }
        if (GUILayout.Button("Color To Red"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOColor(Color.red, 1).SetEase(Ease.Linear);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOColor(Color.red, 1).SetEase(Ease.Linear);
            }
        }
        if (GUILayout.Button("Fade Out"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOFade(0, 1).SetEase(Ease.Linear);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOFade(0, 1).SetEase(Ease.Linear);
            }
        }
        if (GUILayout.Button("Fade In"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOFade(1, 1).SetEase(Ease.Linear);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOFade(1, 1).SetEase(Ease.Linear);
            }
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Face Color To Green"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOFaceColor(Color.green, 1).SetEase(Ease.Linear);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOFaceColor(Color.green, 1).SetEase(Ease.Linear);
            }
        }
        if (GUILayout.Button("Face Color To Red"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOFaceColor(Color.red, 1).SetEase(Ease.Linear);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOFaceColor(Color.red, 1).SetEase(Ease.Linear);
            }
        }
        if (GUILayout.Button("Face Fade Out"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOFaceFade(0, 1).SetEase(Ease.Linear);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOFaceFade(0, 1).SetEase(Ease.Linear);
            }
        }
        if (GUILayout.Button("Face Fade In"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOFaceFade(1, 1).SetEase(Ease.Linear);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOFaceFade(1, 1).SetEase(Ease.Linear);
            }
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Glow Color To Green"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOGlowColor(Color.green, 1).SetEase(Ease.Linear);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOGlowColor(Color.green, 1).SetEase(Ease.Linear);
            }
        }
        if (GUILayout.Button("Glow Color To Red"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOGlowColor(Color.red, 1).SetEase(Ease.Linear);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOGlowColor(Color.red, 1).SetEase(Ease.Linear);
            }
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Outline Color To Green"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOOutlineColor(Color.green, 1).SetEase(Ease.Linear);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOOutlineColor(Color.green, 1).SetEase(Ease.Linear);
            }
        }
        if (GUILayout.Button("Outline Color To Red"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOOutlineColor(Color.red, 1).SetEase(Ease.Linear);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOOutlineColor(Color.red, 1).SetEase(Ease.Linear);
            }
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Font Resize Down"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOFontSize(10, 1);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOFontSize(10, 1);
            }
        }
        if (GUILayout.Button("Font Resize Up"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOFontSize(32, 1);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOFontSize(32, 1);
            }
        }
        if (GUILayout.Button("Scale to 1.5"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOScale(1.5f, 1);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOScale(1.5f, 1);
            }
        }
        if (GUILayout.Button("Trim Max Visible Characters"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOMaxVisibleCharacters(22, 1);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOMaxVisibleCharacters(22, 1);
            }
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Text Reset"))
        {
            DOTween.KillAll();
            for (int i = 0; i < texts.Length; ++i)
            {
                texts[i].text = orTexts[i];
            }
            for (int i = 0; i < uguiTexts.Length; ++i)
            {
                uguiTexts[i].text = orGuiTexts[i];
            }
        }
        if (GUILayout.Button("Text Replace"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOText(replaceWText, 5, richTextEnabled).SetEase(Ease.Linear);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOText(replaceWText, 5, richTextEnabled).SetEase(Ease.Linear);
            }
        }
        if (GUILayout.Button("Text Replace Add"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOText(" " + replaceWText, 5, richTextEnabled).SetRelative().SetEase(Ease.Linear);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOText(" " + replaceWText, 5, richTextEnabled).SetRelative().SetEase(Ease.Linear);
            }
        }
        if (GUILayout.Button("Text Replace W Scramble"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOText(replaceWText, 5, richTextEnabled, ScrambleMode.Lowercase).SetEase(Ease.Linear);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOText(replaceWText, 5, richTextEnabled, ScrambleMode.Lowercase).SetEase(Ease.Linear);
            }
        }
        if (GUILayout.Button("Text Replace Add W Scramble"))
        {
            foreach (TextMeshPro t in texts)
            {
                t.DOText(" " + replaceWText, 5, richTextEnabled, ScrambleMode.Lowercase).SetRelative().SetEase(Ease.Linear);
            }
            foreach (TextMeshProUGUI t in uguiTexts)
            {
                t.DOText(" " + replaceWText, 5, richTextEnabled, ScrambleMode.Lowercase).SetRelative().SetEase(Ease.Linear);
            }
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("TogglePause"))
        {
            DOTween.TogglePauseAll();
        }
        if (GUILayout.Button("Flip"))
        {
            DOTween.FlipAll();
        }
        GUILayout.EndHorizontal();
    }
コード例 #9
0
    void OnGUI()
    {
        DGUtils.BeginGUI();

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

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Rewind"))
        {
            DOTween.RewindAll();
        }
        if (GUILayout.Button("Restart"))
        {
            DOTween.RestartAll();
        }
        if (GUILayout.Button("Complete"))
        {
            DOTween.CompleteAll();
        }
        if (GUILayout.Button("Flip"))
        {
            DOTween.FlipAll();
        }
        if (GUILayout.Button("Goto 0.5"))
        {
            DOTween.GotoAll(0.5f);
        }
        if (GUILayout.Button("Goto 1"))
        {
            DOTween.GotoAll(1);
        }
        if (GUILayout.Button("Goto 1.5"))
        {
            DOTween.GotoAll(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();
    }