private void Update() { RenderSettings.skybox.SetFloat("_Rotation", Time.time); if (endgame) { circularEndgmae += Time.deltaTime / 14; vCam.GetCinemachineComponent <CinemachineTrackedDolly>().m_PathPosition = circularEndgmae; } else if (!ficha.tetraToSpawnFace().Equals(lastFace)) { lastFace = ficha.tetraToSpawnFace(); MoveCamera(lastFace); } if (virtualCameraNoise != null) { if (ShakeElapsedTime > 0) { virtualCameraNoise.m_AmplitudeGain = ShakeAmplitude; virtualCameraNoise.m_FrequencyGain = ShakeFrequency; ShakeElapsedTime -= Time.deltaTime; } else { virtualCameraNoise.m_AmplitudeGain = 0f; ShakeElapsedTime = 0f; } } }
public void MoveCamera(Spawner.Face face) { switch (face) { case Spawner.Face.FRONT: vCam.GetCinemachineComponent <CinemachineTrackedDolly>().m_PathPosition = 0f; break; case Spawner.Face.LEFT: vCam.GetCinemachineComponent <CinemachineTrackedDolly>().m_PathPosition = 1; break; case Spawner.Face.BACK: vCam.GetCinemachineComponent <CinemachineTrackedDolly>().m_PathPosition = 2; break; case Spawner.Face.RIGHT: vCam.GetCinemachineComponent <CinemachineTrackedDolly>().m_PathPosition = 3; break; } }