// Update is called once per frame void Update() { _dolly.m_PathPosition = Mathf.Lerp(_dolly.m_PathPosition, 1, lerpRate); //switch camera if (_dolly.m_PathPosition >= 0.9) { if (!isFreePlayLevel) { GameManager.S.player1.transform.position = GameManager.S.player1.GetComponent <PlayerDeath>().spawnPoint.transform.position; GameManager.S.player2.transform.position = GameManager.S.player2.GetComponent <PlayerDeath>().spawnPoint.transform.position; if (GameManager.S.player3 != null) { GameManager.S.player3.transform.position = GameManager.S.player3.GetComponent <PlayerDeath>().spawnPoint.transform.position; } if (GameManager.S.player4 != null) { GameManager.S.player4.transform.position = GameManager.S.player4.GetComponent <PlayerDeath>().spawnPoint.transform.position; } } if (UICanvas != null) { UICanvas.SetActive(true); UICanvas.GetComponent <Countdown>().startTimer = true; } Debug.Log("Switch camera from pregame to main"); //Debug.Log("Dictionary length" +MasterCamController._masterList.Count); MasterCamController.SwitchCamera("Main vcam"); } }
// Update is called once per frame void Update() { FindMidpoint(); midpointT.transform.position = Vector3.Lerp(midpointT.transform.position, midpoint, 0.015f); followObject.position = new Vector3(midpointT.position.x + followXOffset, FindHeight(), midpointT.position.z); //detect a winner, change cameras if (GameManager.S.winner != null) { MasterCamController.SwitchCamera("Postgame Freelook"); } }