private void Update() { counter += Time.deltaTime; if (Input.GetKey("v") == true && counter >= 1f) { counter = 0; switcher += 1; } if (switcher % 2 == 0)//Third { do { //因為從SkyCam切回來時 第三人稱攝影機位置會跑掉 //所以要把第三人稱攝影機位置的位置指定為一開始指定的初始位置 //do while在這裡面應該只會執行一次 } while (switcher % 2 != 0); SkyCam.SetActive(false); ThirdCam.SetActive(true); GameObject.Find("ThirdCamManager").GetComponent <ThirdCamFollow>().enabled = true; } else if (switcher % 2 == 1)//SkyCam { SkyCam.SetActive(true); ThirdCam.SetActive(false); GameObject.Find("ThirdCamManager").GetComponent <ThirdCamFollow>().enabled = false; } }
IEnumerator camChange() { yield return(new WaitForSeconds(0.01f)); if (camMode == 0) { FirstCam.SetActive(false); ThirdCam.SetActive(true); RotCam.SetActive(false); aimCam.SetActive(false); } if (camMode == 1) { FirstCam.SetActive(true); ThirdCam.SetActive(false); RotCam.SetActive(false); aimCam.SetActive(false); } if (camMode == 2) { FirstCam.SetActive(false); ThirdCam.SetActive(false); RotCam.SetActive(true); aimCam.SetActive(false); } }
IEnumerator aimChange() { yield return(new WaitForSeconds(0.3f)); FirstCam.SetActive(false); ThirdCam.SetActive(false); RotCam.SetActive(false); aimCam.SetActive(true); }
private void Awake() { SkyCam.SetActive(false); ThirdCam.SetActive(true); }