Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (pauseUI.activeSelf)
        {
            Time.timeScale = 0f;
        }
        abc = pauseUI.activeSelf;
        if (FPSCon.GetComponent <MyStatus>().GetHp() > 0)
        {
            if (Input.GetKeyDown(KeyCode.Escape) && !SettingScript.Settingpause())
            {
                if (!GametoTitle.GetNoMove())
                {
                    // ポーズUIのアクティブ、非アクティブを切り替え
                    pauseUI.SetActive(!pauseUI.activeSelf);
                }

                // ポーズUIが表示されてる時は停止
                if (pauseUI.activeSelf)
                {
                    Time.timeScale = 0f;
                    // ポーズUIが表示されてなければ通常通り進行
                }
                else
                {
                    Time.timeScale = 1f;
                }
            }
        }
    }
Ejemplo n.º 2
0
        // Update is called once per frame
        private void Update()
        {
            // if (Input.GetKey(KeyCode.Return))
            // { m_MouseLook.Init(transform, m_Camera.transform);
            //     //m_Camera.transform.rotation = Quaternion.identity;
            // }
            if (!PauseScript.pause() && !SettingScript.Settingpause())
            {
                if (FPSCon.GetComponent <MyStatus>().GetHp() > 1)
                {
                    RotateView();

                    // the jump state needs to read here to make sure it is not missed
                    if (!m_Jump)
                    {
                        m_Jump = CrossPlatformInputManager.GetButtonDown("Jump");
                    }

                    if (!m_PreviouslyGrounded && m_CharacterController.isGrounded)
                    {
                        StartCoroutine(m_JumpBob.DoBobCycle());
                        PlayLandingSound();
                        m_MoveDir.y = 0f;
                        m_Jumping   = false;
                    }
                    if (!m_CharacterController.isGrounded && !m_Jumping && m_PreviouslyGrounded)
                    {
                        m_MoveDir.y = 0f;
                    }

                    m_PreviouslyGrounded = m_CharacterController.isGrounded;
                }
            }
        }