Exemple #1
0
        public override void OnEnter()
        {
            int numberOfTweensPlayed = DOTween.PlayBackwardsAll();

            if (debugThis.Value)
            {
                State.Debug("DOTween Control Methods Play Backwards All - Played " + numberOfTweensPlayed + " tweens");
            }
            Finish();
        }
        public override void OnEnter()
        {
            int numberOfTweensPlayed = DOTween.PlayBackwardsAll();

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

            Finish();
        }
Exemple #3
0
    // IRewindStatus

    public void RewindStatusChanged(RewindStatus changingTo)
    {
        switch (changingTo)
        {
        case RewindStatus.Recording:
            DOTween.PlayForwardAll();
            GetComponent <Renderer>().material.color = Color.green;
            HideDeathUI();
            break;

        case RewindStatus.Rewinding:
            DOTween.PlayBackwardsAll();
            GetComponent <Renderer>().material.color = Color.yellow;
            break;

        case RewindStatus.SafeFreeze:
            DOTween.PauseAll();
            GetComponent <Renderer>().material.color = Color.yellow;
            StartCoroutine(nameof(RewindEndingCountdownUi));
            break;

        case RewindStatus.RewindableDeathFreeze:
        case RewindStatus.ResetRequiredDeathFreeze:
            DOTween.PauseAll();
            GetComponent <Renderer>().material.color = new Color(1.0f, 0.5f, 0.0f);
            break;
        }

        // Perform anything that needs to to happen on a specific status change to another
        if (changingTo == RewindStatus.Recording)
        {
            SoundManager.PlayEffect(SoundEffect.Background);
        }
        else
        {
            SoundManager.StopEffect(SoundEffect.Background);
        }

        if (changingTo == RewindStatus.Rewinding)
        {
            SoundManager.PlayEffect(SoundEffect.Rewind);
        }
        else
        {
            SoundManager.StopEffect(SoundEffect.Rewind);
        }

        if (changingTo == RewindStatus.Recording && _currentRewindStatus == RewindStatus.SafeFreeze)
        {
            SoundManager.PlayEffect(SoundEffect.ResumePlayAfterRewind);
        }

        _currentRewindStatus = changingTo;
    }
Exemple #4
0
        private IEnumerator LowerAndContinue(int cubeValue)
        {
            yield return(new WaitForSeconds(0.25f));

            DOTween.PlayBackwardsAll();

            yield return(new WaitForSeconds(1.5f));

            switch (cubeValue)
            {
            case (int)cubeValues.Swords:
                EndTurn();
                break;

            case (int)cubeValues.Skull:
                if (swordsCounter > 0)
                {
                    RaiseDice((int)cubeValues.Swords);
                }
                else
                {
                    EndTurn();
                }
                break;

            case (int)cubeValues.Shield:
                if (skullCounter > 0)
                {
                    RaiseDice((int)cubeValues.Skull);
                }
                else if (swordsCounter > 0)
                {
                    RaiseDice((int)cubeValues.Swords);
                }
                else
                {
                    EndTurn();
                }
                break;

            case (int)cubeValues.None:
                print("error with cube value");
                break;
            }
        }
Exemple #5
0
    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();
    }