コード例 #1
0
    // Start is called before the first frame update
    void Start()
    {
        m_loadSceneManager = FindObjectOfType <LoadSceneManager>();
        m_playerController = FindObjectOfType <PlayerController>();

        if (SceneManager.GetActiveScene().name == "EndScene")//EndSceneの時の処理
        {
            //m_audio.Stop();//音楽を止める
            m_ending = true;//フラグを立てる
            //Debug.Log("start");
        }
        else
        {
            Cursor.visible   = false;                 //カーソルを消す
            Cursor.lockState = CursorLockMode.Locked; //カメラの向きをマウスと連動させる
            m_freelook.MoveToTopOfPrioritySubqueue(); //freelookを優先
            m_magicCircle.SetActive(false);           //魔法陣を非表示

            if (m_goolController)
            {
                return;
            }
            m_goolController = m_goolObject.GetComponent <GoolController>();
            m_audio          = GetComponent <AudioSource>();
        }
    }
コード例 #2
0
 internal void SwitchCamera()
 {
     if (mCam.GetComponent <CinemachineBrain>().ActiveVirtualCamera.Name == staticVCam.Name)
     {
         movingVCam.MoveToTopOfPrioritySubqueue();
     }
     else
     {
         staticVCam.MoveToTopOfPrioritySubqueue();
     }
 }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     if (vcam)
     {
         vcam.MoveToTopOfPrioritySubqueue();
     }
 }
コード例 #4
0
    /// <summary>
    /// カメラを制御する
    /// </summary>
    void CameraControl()
    {
        //右クリックでエイム
        if (Input.GetButtonDown("Fire2"))
        {
            m_magicCircle.SetActive(true);                    //魔法陣の展開
            Camera.main.cullingMask = ~(1 << m_player.layer); //8レイヤー(Plyaer)以外は全部有効にする

            ////////////////////////////////////////////////////////////////////////////////////////////////////////////
            //先生に教えてもらったカメラ制御(エイムした時にvcamをFreeLockで見ていた方向にする処理)
            Vector3 freelookDir = m_freelook.LookAt.position - m_freelook.transform.position;
            freelookDir.y = 0;
            float angle = Vector3.SignedAngle(Vector3.forward, freelookDir, Vector3.up);
            //Debug.Log($"angle: {angle}");
            ((CinemachineVirtualCamera)m_vcam).GetCinemachineComponent <CinemachinePOV>().m_HorizontalAxis.Value = angle;
            ((CinemachineVirtualCamera)m_vcam).GetCinemachineComponent <CinemachinePOV>().m_VerticalAxis.Value   = 0f;
            m_vcam.MoveToTopOfPrioritySubqueue(); //vcamを優先
            ////////////////////////////////////////////////////////////////////////////////////////////////////////////
        }
        else if (Input.GetButtonUp("Fire2"))
        {
            m_magicCircle.SetActive(false);           //魔法陣を収束
            Camera.main.cullingMask = -1;             //全てのレイヤーを有効にする

            m_freelook.MoveToTopOfPrioritySubqueue(); //freelookを優先
        }
    }
コード例 #5
0
 public void SwitchCam(CinemachineVirtualCameraBase vcam)
 {
     if (Camera.main.GetComponent <CinemachineBrain>().ActiveVirtualCamera.Name != vcam.Name)
     {
         vcam.MoveToTopOfPrioritySubqueue();
     }
 }
コード例 #6
0
        protected IEnumerator ExecuteCoroutine()
        {
            if (pauseStateMachine)
            {
                brain = GameObject.FindObjectOfType <CinemachineBrain>();
                vCam  = director.GetComponentInChildren <CinemachineVirtualCameraBase>();
                vCam.MoveToTopOfPrioritySubqueue();
                while (!CinemachineCore.Instance.IsLive(vCam) || brain.IsBlending)
                {
                    yield return(new WaitForEndOfFrame());
                }
            }

            director.Play();
            while ((director.time + 0.05f) <= director.duration)
            {
                yield return(new WaitForEndOfFrame());
            }
            if (pauseStateMachine)
            {
                CameraController.instance.virtualCamera.MoveToTopOfPrioritySubqueue();
                while (!CinemachineCore.Instance.IsLive(CameraController.instance.virtualCamera) || brain.IsBlending)
                {
                    yield return(new WaitForEndOfFrame());
                }
            }

            finished = true;
        }
コード例 #7
0
ファイル: ActiveCamera.cs プロジェクト: Fiona730/Runner
    void Start()
    {
        brain = FindObjectOfType <CinemachineBrain>();

        vcamF       = true;
        gameRestart = false;
        transmit    = false;
        vcamFollow.MoveToTopOfPrioritySubqueue();
    }
コード例 #8
0
 void OnTriggerEnter(Collider col)
 {
     if (col.CompareTag("Player"))
     {
         if (switchToCam)
         {
             switchToCam.MoveToTopOfPrioritySubqueue();
         }
     }
 }
コード例 #9
0
        public void SetEnable(bool enable, bool moveToTopOfPrioritySubqueue = true)
        {
            m_CM_VirtualCameraBase.enabled = enable;

            if (enable &&
                moveToTopOfPrioritySubqueue)
            {
                m_CM_VirtualCameraBase.MoveToTopOfPrioritySubqueue();
            }
        }
コード例 #10
0
 void OnTriggerEnter(Collider col)
 {
     if (col.CompareTag("Player") && col.gameObject.name == "Woodle Character")
     {
         if (switchToCam)
         {
             switchToCam.MoveToTopOfPrioritySubqueue();
         }
     }
 }
 public void SwitchCam(CinemachineVirtualCameraBase vcam)
 {
     if (brain == null || vcam == null)
     {
         return;
     }
     if (brain.ActiveVirtualCamera != (ICinemachineCamera)vcam)
     {
         vcam.MoveToTopOfPrioritySubqueue();
     }
 }
コード例 #12
0
 public void MoveToNewFollowTransform(CinemachineVirtualCameraBase newTarget)
 {
     newTarget.MoveToTopOfPrioritySubqueue();
 }
コード例 #13
0
 void OnTriggerEnter(Collider other)
 {
     // 同じ Priority を持つカメラのうち、このカメラを最優先にする
     m_camera.MoveToTopOfPrioritySubqueue();
 }