示例#1
0
        protected void SwitchPauseState()
        {
            if (!m_InPause && ScreenFader.IsFading)
            {
                return;
            }

            for (int i = 0; i < m_Directors.Length; i++)
            {
                if (m_Directors[i].state == PlayState.Playing && !m_InPause)
                {
                    m_Directors[i].Pause();
                }
                else if (m_Directors[i].state == PlayState.Paused && m_InPause)
                {
                    m_Directors[i].Resume();
                }
            }

            if (!m_InPause)
            {
                CameraShake.Stop();
            }

            Time.timeScale = m_InPause ? 1 : 0;

            if (resultCanvas)
            {
                resultCanvas.SetActive(false);
            }

            m_InPause = !m_InPause;
        }
示例#2
0
        protected void SwitchPauseState()
        {
            if (m_InPause && Time.timeScale > 0 || !m_InPause && ScreenFader.IsFading)
            {
                return;
            }

            if (!alwaysDisplayMouse)
            {
                Cursor.lockState = m_InPause ? CursorLockMode.Locked : CursorLockMode.None;
                Cursor.visible   = !m_InPause;
            }

            for (int i = 0; i < m_Directors.Length; i++)
            {
                if (m_Directors[i].state == PlayState.Playing && !m_InPause)
                {
                    m_Directors[i].Pause();
                }
                else if (m_Directors[i].state == PlayState.Paused && m_InPause)
                {
                    m_Directors[i].Resume();
                }
            }

            if (!m_InPause)
            {
                CameraShake.Stop();
            }

            if (m_InPause)
            {
                PlayerMyController.Instance.GainControl();
            }
            else
            {
                PlayerMyController.Instance.ReleaseControl();
            }

            Time.timeScale = m_InPause ? 1 : 0;

            if (pauseCanvas)
            {
                pauseCanvas.SetActive(!m_InPause);
            }

            if (optionsCanvas)
            {
                optionsCanvas.SetActive(false);
            }

            if (controlsCanvas)
            {
                controlsCanvas.SetActive(false);
            }

            if (audioCanvas)
            {
                audioCanvas.SetActive(false);
            }

            m_InPause = !m_InPause;
        }
示例#3
0
        protected void SwitchPauseState()
        {
            if (m_InPause && Time.timeScale > 0 || !m_InPause && ScreenFader.IsFading)
            {
                return;
            }

            if (!alwaysDisplayMouse)
            {
                Cursor.lockState = m_InPause ? CursorLockMode.Locked : CursorLockMode.None;
                Cursor.visible   = !m_InPause;
            }

            for (int i = 0; i < m_Directors.Length; i++)
            {
                if (m_Directors[i].state == PlayState.Playing && !m_InPause)
                {
                    m_Directors[i].Pause();
                }
                else if (m_Directors[i].state == PlayState.Paused && m_InPause)
                {
                    m_Directors[i].Resume();
                }
            }

            if (!m_InPause)
            {
                CameraShake.Stop();
            }

            if (m_InPause)
            {
                PlayerInput.Instance.GainControl();
            }
            else
            {
                PlayerInput.Instance.ReleaseControl();
            }

            Time.timeScale = m_InPause ? 1 : 0;

            if (pauseCanvas)
            {
                pauseCanvas.SetActive(!m_InPause);
            }

            if (optionsCanvas)
            {
                optionsCanvas.SetActive(false);
            }

            if (controlsCanvas)
            {
                controlsCanvas.SetActive(false);
            }

            if (audioCanvas)
            {
                audioCanvas.SetActive(false);
            }

            if (heatmapCanvas)
            {
                heatmapCanvas.SetActive(false);
            }


            if (!m_InPause)
            {
                //=========================================================================================
                Dictionary <string, object> myDic = new Dictionary <string, object>();

                //Type
                myDic.Add("Type", "OpenMenu");

                //Transform
                myDic.Add("PositionX", transform.position.x);
                myDic.Add("PositionY", transform.position.y);
                myDic.Add("PositionZ", transform.position.z);

                //TimeStamp
                myDic.Add("TimeStamp", Time.time);

                //PlayerID
                myDic.Add("PlayerID", /*PlayerData.player_id*/ 0);

                PlayerEventTrack.EventList.Add(myDic);
                Debug.Log("Player OpenMenu");
                //=========================================================================================
            }

            m_InPause = !m_InPause;
        }