Exemplo n.º 1
0
 void OnPauseGame()
 {
     m_isGamePaused     = true;
     MBehavior.isPaused = true;
     DOTween.PauseAll();
     M_Event.FireLogicEvent(LogicEvents.PauseGame, new LogicArg(this));
 }
Exemplo n.º 2
0
    public void ZoomInOut(bool isZoom)
    {
        if (nowCharacterAnimator == null)
        {
            return;
        }

        if (!isZoom)
        {
            nowCharacterAnimator.SetBool("Zoom", false);
            nowCharacterAnimator.SetTrigger("ZoomOut");

            if (corCharacterRotate != null)
            {
                StopCoroutine(corCharacterRotate);
                corCharacterRotate = null;
            }

            DOTween.PauseAll();
            character.transform.rotation = Quaternion.identity;
        }
        else
        {
            nowCharacterAnimator.SetBool("Zoom", true);
            nowCharacterAnimator.SetTrigger("ZoomIn");


            if (corCharacterRotate == null)
            {
                corCharacterRotate = StartCoroutine(CharacterRotate());
            }
        }
    }
Exemplo n.º 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.GotoAll(sliderPos);
            }
        }
        else
        {
            // Get slider ID to be used to check mouseDown behaviour
            int sliderId = GUIUtility.GetControlID(FocusType.Passive) + 1;
            DOTween.GotoAll(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.PauseAll();
                }
            }

            // DOTween.Goto(GUILayout.HorizontalSlider(controller.Elapsed(false), 0.0f, controller.Duration(false)), controller.IsPlaying());
        }
    }
Exemplo n.º 4
0
    private void Pausa()
    {
        DOTween.PauseAll();
        IsPause        = true;
        Time.timeScale = 0.0f;
        SoundController.Instance.PlaySound(SoundController.Sounds.PAUSA);

        fondoPausa.SetActive(true);
    }
Exemplo n.º 5
0
 public void OnTriggerEnter(Collider col)
 {
     Debug.Log("Collider entered");
     if (col.gameObject.name == "Hydrant")
     {
         Debug.Log("Object detected. Slowing down.");
         // DOTween.timeScale = 0.5f;
         DOTween.PauseAll();
     }
 }
Exemplo n.º 6
0
        public override void OnEnter()
        {
            int numberOfTweensPaused = DOTween.PauseAll();

            if (debugThis.Value)
            {
                State.Debug("DOTween Control Methods Pause All - Paused " + numberOfTweensPaused + " tweens");
            }
            Finish();
        }
Exemplo n.º 7
0
        public override void OnEnter()
        {
            int numberOfTweensPaused = DOTween.PauseAll();

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

            Finish();
        }
Exemplo n.º 8
0
 private void Instance_SimulationPaused(object sender, PipelineManager.SimulationEventArgs e)
 {
     if (e.IsPaused)
     {
         DOTween.PauseAll();
     }
     else
     {
         DOTween.PlayAll();
     }
 }
Exemplo n.º 9
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;
    }
Exemplo n.º 10
0
    internal void SetState(eStateGame state)
    {
        State = state;

        if (State == eStateGame.PAUSE)
        {
            DOTween.PauseAll();
        }
        else
        {
            DOTween.PlayAll();
        }
    }
Exemplo n.º 11
0
    private IEnumerator ShowIntroPowers()
    {
        DOTween.PauseAll();
        panelPowers.SetActive(true);
        float aux = Time.timeScale;

        Time.timeScale = 0;
        yield return(new WaitForSecondsRealtime(heroTime));

        panelPowers.SetActive(false);
        powerBlocked.SetActive(false);
        powerSlow.SetActive(false);
        Time.timeScale = aux;
        DOTween.PlayAll();
    }
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.R))
     {
         DOTween.KillAll();
         this.transform.position = initialPosition;
         this.transform.rotation = initialRotation;
         state  = muscleStates.landing;
         paused = false;
         startPanel.SetActive(true);
         startText.text = "GET READY!";
         countDown      = startDelay;
         if (frontParticle.isPlaying)
         {
             frontParticle.Stop();
         }
         if (!backParticle.isPlaying)
         {
             backParticle.Play();
         }
         if (leftParticle.isPlaying)
         {
             leftParticle.Stop();
         }
         if (rightParticle.isPlaying)
         {
             rightParticle.Stop();
         }
     }
     if (Input.GetKeyDown(KeyCode.Space))
     {
         if (!paused)
         {
             DOTween.PauseAll();
         }
         else
         {
             DOTween.PlayAll();
         }
         paused = !paused;
     }
     if (Input.GetKeyDown(KeyCode.S))
     {
         StartCoroutine(startCountDown());
         state = muscleStates.start;
     }
 }
Exemplo n.º 13
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         if (!isPaused)
         {
             DOTween.PauseAll();
         }
         if (isPaused)
         {
             DOTween.PlayAll();
         }
         isPaused = !isPaused;
         UpdateManagerState();
         UpdateDisplay();
     }
 }
Exemplo n.º 14
0
 public void RemoveLife(int cant)
 {
     Lives -= cant;
     ScoreController.Instance.Add(0);
     if (Lives < 1)
     {
         if (!isDelivered)
         {
             Time.timeScale = 0.0f;
             isDelivered    = true;
             ScoreController.Instance.DeliverTickets();
         }
         SoundController.Instance.IsLooping = false;
         popUpGameOver.SetActive(true);
         DOTween.PauseAll();
     }
     else
     {
         SoundController.Instance.PlaySound(SoundController.Sounds.DAMAGE);
     }
 }
Exemplo n.º 15
0
    IEnumerator donmehizisabitle()
    {
        Hedef.SetActive(false);
        yield return(new WaitForSeconds(0.4f));

        transform.parent.GetComponent <Player_Control>().atis = true;
        if (DonusTersi)
        {
            transform.parent.GetComponentInChildren <DonmeScript>().donmehizi = donushizi;
        }
        else
        {
            transform.parent.GetComponentInChildren <DonmeScript>().donmehizi = -donushizi;
        }
        Debug.Log(transform.parent.GetComponentInChildren <DonmeScript>().donmehizi);
        yield return(new WaitForSeconds(0.2f));

        DOTween.PauseAll();
        int rans = Random.Range(0, hedefcolor.Length);

        Hedef.GetComponent <Image>().color = hedefcolor[rans];
        Hedef.SetActive(true);
        Donencember_Hedef.GetComponent <RastgelePozisyon_RastgeleHaraket>().rastgelepozisyon();
    }
Exemplo n.º 16
0
 public void StopTween()
 {
     DOTween.PauseAll();
 }
Exemplo n.º 17
0
 public void Pause()
 {
     DOTween.PauseAll();
 }
Exemplo n.º 18
0
 /// <summary>
 /// 暂停动画。立即执行
 /// </summary>
 public static void PauseAll()
 {
     _isPause = true;
     DOTween.PauseAll();
 }
Exemplo n.º 19
0
 private void PauseAllEffectInGamePlay()
 {
     DOTween.PauseAll();
 }
Exemplo n.º 20
0
 public virtual void OnDisable()
 {
     DOTween.PauseAll();
     base.OnDisable();
 }
Exemplo n.º 21
0
        override public void OnInspectorGUI()
        {
            EditorGUIUtils.SetGUIStyles();

            int totActiveTweens        = TweenManager.totActiveTweens;
            int totPlayingTweens       = TweenManager.TotalPlayingTweens();
            int totPausedTweens        = totActiveTweens - totPlayingTweens;
            int totActiveDefaultTweens = TweenManager.totActiveDefaultTweens;
            int totActiveLateTweens    = TweenManager.totActiveLateTweens;

            GUILayout.Space(4);
            GUILayout.Label(_title, TweenManager.isDebugBuild ? EditorGUIUtils.redLabelStyle : EditorGUIUtils.boldLabelStyle);

            GUILayout.Space(6);
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Documentation"))
            {
                Application.OpenURL("http://dotween.demigiant.com/documentation.php");
            }
            if (GUILayout.Button("Check Updates"))
            {
                Application.OpenURL("http://dotween.demigiant.com/download.php?v=" + DOTween.Version);
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            if (GUILayout.Button(_settings.showPlayingTweens ? "Hide Playing Tweens" : "Show Playing Tweens"))
            {
                _settings.showPlayingTweens = !_settings.showPlayingTweens;
                EditorUtility.SetDirty(_settings);
            }
            if (GUILayout.Button(_settings.showPausedTweens ? "Hide Paused Tweens" : "Show Paused Tweens"))
            {
                _settings.showPausedTweens = !_settings.showPausedTweens;
                EditorUtility.SetDirty(_settings);
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Play all"))
            {
                DOTween.PlayAll();
            }
            if (GUILayout.Button("Pause all"))
            {
                DOTween.PauseAll();
            }
            if (GUILayout.Button("Kill all"))
            {
                DOTween.KillAll();
            }
            GUILayout.EndHorizontal();

            GUILayout.Space(8);
            _strBuilder.Length = 0;
            _strBuilder.Append("Active tweens: ").Append(totActiveTweens)
            .Append(" (").Append(TweenManager.totActiveTweeners)
            .Append("/").Append(TweenManager.totActiveSequences).Append(")")
            .Append("\nDefault/Late tweens: ").Append(totActiveDefaultTweens)
            .Append("/").Append(totActiveLateTweens)
            .Append("\nPlaying tweens: ").Append(totPlayingTweens);
            if (_settings.showPlayingTweens)
            {
                foreach (Tween t in TweenManager._activeTweens)
                {
                    if (t != null && t.isPlaying)
                    {
                        _strBuilder.Append("\n   - [").Append(t.tweenType).Append("] ").Append(t.target);
                    }
                }
            }
            _strBuilder.Append("\nPaused tweens: ").Append(totPausedTweens);
            if (_settings.showPausedTweens)
            {
                foreach (Tween t in TweenManager._activeTweens)
                {
                    if (t != null && !t.isPlaying)
                    {
                        _strBuilder.Append("\n   - [").Append(t.tweenType).Append("] ").Append(t.target);
                    }
                }
            }
            _strBuilder.Append("\nPooled tweens: ").Append(TweenManager.TotalPooledTweens())
            .Append(" (").Append(TweenManager.totPooledTweeners)
            .Append("/").Append(TweenManager.totPooledSequences).Append(")");
            GUILayout.Label(_strBuilder.ToString());

            GUILayout.Space(8);
            _strBuilder.Remove(0, _strBuilder.Length);
            _strBuilder.Append("Tweens Capacity: ").Append(TweenManager.maxTweeners).Append("/").Append(TweenManager.maxSequences)
            .Append("\nMax Simultaneous Active Tweens: ").Append(DOTween.maxActiveTweenersReached).Append("/").Append(DOTween.maxActiveSequencesReached);
            GUILayout.Label(_strBuilder.ToString());

            GUILayout.Space(8);
            _strBuilder.Remove(0, _strBuilder.Length);
            _strBuilder.Append("SETTINGS ▼");
            _strBuilder.Append("\nSafe Mode: ").Append(DOTween.useSafeMode ? "ON" : "OFF");
            _strBuilder.Append("\nLog Behaviour: ").Append(DOTween.logBehaviour);
            _strBuilder.Append("\nShow Unity Editor Report: ").Append(DOTween.showUnityEditorReport);
            _strBuilder.Append("\nTimeScale (Unity/DOTween): ").Append(Time.timeScale).Append("/").Append(DOTween.timeScale);
            GUILayout.Label(_strBuilder.ToString());
            GUILayout.Label("NOTE: DOTween's TimeScale is not the same as Unity's Time.timeScale: it is actually multiplied by it except for tweens that are set to update independently", EditorGUIUtils.wordWrapItalicLabelStyle);

            GUILayout.Space(8);
            _strBuilder.Remove(0, _strBuilder.Length);
            _strBuilder.Append("DEFAULTS ▼");
            _strBuilder.Append("\ndefaultRecyclable: ").Append(DOTween.defaultRecyclable);
            _strBuilder.Append("\ndefaultUpdateType: ").Append(DOTween.defaultUpdateType);
            _strBuilder.Append("\ndefaultTSIndependent: ").Append(DOTween.defaultTimeScaleIndependent);
            _strBuilder.Append("\ndefaultAutoKill: ").Append(DOTween.defaultAutoKill);
            _strBuilder.Append("\ndefaultAutoPlay: ").Append(DOTween.defaultAutoPlay);
            _strBuilder.Append("\ndefaultEaseType: ").Append(DOTween.defaultEaseType);
            _strBuilder.Append("\ndefaultLoopType: ").Append(DOTween.defaultLoopType);
            GUILayout.Label(_strBuilder.ToString());

            GUILayout.Space(10);
        }
Exemplo n.º 22
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();
    }
Exemplo n.º 23
0
 public virtual void PauseGame(bool tutorial = false)
 {
     DOTween.PauseAll();
     paused = true;
 }
Exemplo n.º 24
0
    //切换场景
    public SceneResut goToScene(string sceneID, SceneTransEffect type, float duration = 0)
    {
        Log.info("当前scene" + currentScene + " goTo :" + sceneID);
        //CLogSys.Log(ELogLevel.Verbose, ELogTag.Map, ("goToScene " + sceneID));

        if (ModuleManager.IsOpen(sceneID) == false)
        {
            return(SceneResut.Close);
        }

        if (currentScene == sceneID)
        {
            //CLogSys.Log(ELogLevel.Verbose, ELogTag.Map, "相同场景,不做切换 .." + sceneID);
            return(SceneResut.Error);
        }

        if (isRunning == true)
        {
            //CLogSys.Log(ELogLevel.Verbose, ELogTag.Map, "GoToScene isRunning...");
            return(SceneResut.Error);
        }

        DOTween.PauseAll();
        //如果是需要过渡场景,此字段用于存储过渡场景切换用的目标值
        willLoadScene = sceneID;

        string path = "";

        switch (type)
        {
        //执行场景切换
        case SceneTransEffect.None:
            path = "SceneTrans_None";
            break;

        //             case SceneTransEffect.Common:
        //                 sceneID = "CommonLoad";
        //                 path = "SceneTrans_None";
        //                 break;
        case SceneTransEffect.Fade:
            path = "SceneTrans_Fade";
            break;
        }

        GameObject go = ResDataManager.instance.GetObjectFromLocalPrefab("GUI/_Common/" + path);

        if (go == null)
        {
            Log.infoError("[SceneManager]预置文件无效:" + path);
            return(SceneResut.Error);
        }
        GameObject prefab = GameObject.Instantiate(go) as GameObject;

        BaseTransition effect = prefab.GetComponent <BaseTransition>();

        effect.willLoadSceneID = sceneID;
        effect.duration        = duration;
        effect.enabled         = true;
        effect.onLoadProcess   = OnLoadProcess;
        return(SceneResut.Open);
    }
Exemplo n.º 25
0
 public void Freeze()
 {
     DOTween.PauseAll();
     targetObject.SetActive(true);
 }
        override public void OnInspectorGUI()
        {
            _isRuntime = EditorApplication.isPlaying;
            ConnectToSource();

            EditorGUIUtils.SetGUIStyles();

            // Header img
            GUILayout.Space(4);
            GUILayout.BeginHorizontal();
            Rect headeR = GUILayoutUtility.GetRect(0, 93, 18, 18);

            GUI.DrawTexture(headeR, _headerImg, ScaleMode.ScaleToFit, true);
            GUILayout.Label(_isRuntime ? "RUNTIME MODE" : "EDITOR MODE");
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();

            int totActiveTweens        = TweenManager.totActiveTweens;
            int totPlayingTweens       = TweenManager.TotalPlayingTweens();
            int totPausedTweens        = totActiveTweens - totPlayingTweens;
            int totActiveDefaultTweens = TweenManager.totActiveDefaultTweens;
            int totActiveLateTweens    = TweenManager.totActiveLateTweens;
            int totActiveFixedTweens   = TweenManager.totActiveFixedTweens;
            int totActiveManualTweens  = TweenManager.totActiveManualTweens;

            GUILayout.Label(_title, TweenManager.isDebugBuild ? EditorGUIUtils.redLabelStyle : EditorGUIUtils.boldLabelStyle);

            if (!_isRuntime)
            {
                GUI.backgroundColor = new Color(0f, 0.31f, 0.48f);
                GUI.contentColor    = Color.white;
                GUILayout.Label(
                    "This component is <b>added automatically</b> by DOTween at runtime." +
                    "\nAdding it yourself is <b>not recommended</b> unless you really know what you're doing:" +
                    " you'll have to be sure it's <b>never destroyed</b> and that it's present <b>in every scene</b>.",
                    EditorGUIUtils.infoboxStyle
                    );
                GUI.backgroundColor = GUI.contentColor = GUI.contentColor = Color.white;
            }

            GUILayout.Space(6);
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Documentation"))
            {
                Application.OpenURL("http://dotween.demigiant.com/documentation.php");
            }
            if (GUILayout.Button("Check Updates"))
            {
                Application.OpenURL("http://dotween.demigiant.com/download.php?v=" + DOTween.Version);
            }
            GUILayout.EndHorizontal();

            if (_isRuntime)
            {
                GUILayout.BeginHorizontal();
                if (GUILayout.Button(_settings.showPlayingTweens ? "Hide Playing Tweens" : "Show Playing Tweens"))
                {
                    _settings.showPlayingTweens = !_settings.showPlayingTweens;
                    EditorUtility.SetDirty(_settings);
                }
                if (GUILayout.Button(_settings.showPausedTweens ? "Hide Paused Tweens" : "Show Paused Tweens"))
                {
                    _settings.showPausedTweens = !_settings.showPausedTweens;
                    EditorUtility.SetDirty(_settings);
                }
                GUILayout.EndHorizontal();
                GUILayout.BeginHorizontal();
                if (GUILayout.Button("Play all"))
                {
                    DOTween.PlayAll();
                }
                if (GUILayout.Button("Pause all"))
                {
                    DOTween.PauseAll();
                }
                if (GUILayout.Button("Kill all"))
                {
                    DOTween.KillAll();
                }
                GUILayout.EndHorizontal();

                GUILayout.Space(8);
                GUILayout.Label("<b>Legend: </b> TW = Tweener, SE = Sequence", EditorGUIUtils.wordWrapRichTextLabelStyle);

                GUILayout.Space(8);
                _strb.Length = 0;
                _strb.Append("Active tweens: ").Append(totActiveTweens)
                .Append(" (").Append(TweenManager.totActiveTweeners).Append(" TW, ")
                .Append(TweenManager.totActiveSequences).Append(" SE)")
                .Append("\nDefault/Late/Fixed/Manual tweens: ").Append(totActiveDefaultTweens)
                .Append("/").Append(totActiveLateTweens)
                .Append("/").Append(totActiveFixedTweens)
                .Append("/").Append(totActiveManualTweens)
                .Append(_playingTweensHex).Append("\nPlaying tweens: ").Append(totPlayingTweens);
                if (_settings.showPlayingTweens)
                {
                    foreach (Tween t in TweenManager._activeTweens)
                    {
                        if (t == null || !t.isPlaying)
                        {
                            continue;
                        }
                        _strb.Append("\n   - [").Append(t.tweenType == TweenType.Tweener ? "TW" : "SE");
                        AppendTweenIdLabel(_strb, t);
                        _strb.Append("] ").Append(GetTargetTypeLabel(t.target));
                    }
                }
                _strb.Append("</color>");
                _strb.Append(_pausedTweensHex).Append("\nPaused tweens: ").Append(totPausedTweens);
                if (_settings.showPausedTweens)
                {
                    foreach (Tween t in TweenManager._activeTweens)
                    {
                        if (t == null || t.isPlaying)
                        {
                            continue;
                        }
                        _strb.Append("\n   - [").Append(t.tweenType == TweenType.Tweener ? "TW" : "SE");
                        AppendTweenIdLabel(_strb, t);
                        _strb.Append("] ").Append(GetTargetTypeLabel(t.target));
                    }
                }
                _strb.Append("</color>");
                _strb.Append("\nPooled tweens: ").Append(TweenManager.TotalPooledTweens())
                .Append(" (").Append(TweenManager.totPooledTweeners).Append(" TW, ")
                .Append(TweenManager.totPooledSequences).Append(" SE)");
                GUILayout.Label(_strb.ToString(), EditorGUIUtils.wordWrapRichTextLabelStyle);

                GUILayout.Space(8);
                _strb.Remove(0, _strb.Length);
                _strb.Append("Tweens Capacity: ").Append(TweenManager.maxTweeners).Append(" TW, ").Append(TweenManager.maxSequences).Append(" SE")
                .Append("\nMax Simultaneous Active Tweens: ").Append(DOTween.maxActiveTweenersReached).Append(" TW, ")
                .Append(DOTween.maxActiveSequencesReached).Append(" SE");
                GUILayout.Label(_strb.ToString(), EditorGUIUtils.wordWrapRichTextLabelStyle);
            }

            GUILayout.Space(8);
            _strb.Remove(0, _strb.Length);
            _strb.Append("<b>SETTINGS ▼</b>");
            _strb.Append("\nSafe Mode: ").Append((_isRuntime ? DOTween.useSafeMode : _settings.useSafeMode) ? "ON" : "OFF");
            _strb.Append("\nLog Behaviour: ").Append(_isRuntime ? DOTween.logBehaviour : _settings.logBehaviour);
            _strb.Append("\nShow Unity Editor Report: ").Append(_isRuntime ? DOTween.showUnityEditorReport : _settings.showUnityEditorReport);
            _strb.Append("\nTimeScale (Unity/DOTween): ").Append(Time.timeScale).Append("/").Append(_isRuntime ? DOTween.timeScale : _settings.timeScale);
            GUILayout.Label(_strb.ToString(), EditorGUIUtils.wordWrapRichTextLabelStyle);
            GUILayout.Label(
                "NOTE: DOTween's TimeScale is not the same as Unity's Time.timeScale: it is actually multiplied by it except for tweens that are set to update independently",
                EditorGUIUtils.wordWrapRichTextLabelStyle
                );

            GUILayout.Space(8);
            _strb.Remove(0, _strb.Length);
            _strb.Append("<b>DEFAULTS ▼</b>");
            _strb.Append("\ndefaultRecyclable: ").Append(_isRuntime ? DOTween.defaultRecyclable : _settings.defaultRecyclable);
            _strb.Append("\ndefaultUpdateType: ").Append(_isRuntime ? DOTween.defaultUpdateType : _settings.defaultUpdateType);
            _strb.Append("\ndefaultTSIndependent: ").Append(_isRuntime ? DOTween.defaultTimeScaleIndependent : _settings.defaultTimeScaleIndependent);
            _strb.Append("\ndefaultAutoKill: ").Append(_isRuntime ? DOTween.defaultAutoKill : _settings.defaultAutoKill);
            _strb.Append("\ndefaultAutoPlay: ").Append(_isRuntime ? DOTween.defaultAutoPlay : _settings.defaultAutoPlay);
            _strb.Append("\ndefaultEaseType: ").Append(_isRuntime ? DOTween.defaultEaseType : _settings.defaultEaseType);
            _strb.Append("\ndefaultLoopType: ").Append(_isRuntime ? DOTween.defaultLoopType : _settings.defaultLoopType);
            GUILayout.Label(_strb.ToString(), EditorGUIUtils.wordWrapRichTextLabelStyle);

            GUILayout.Space(10);
        }
Exemplo n.º 27
0
 private static void OnApplicationPaused()
 {
     DOTween.PauseAll();
 }
Exemplo n.º 28
0
 public void Paurse()
 {
     Debug.Log("UP");
     DOTween.PauseAll();
     gameObject.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f);
 }