void Update() { // Don't do anything if game is paused if (pause.IsPaused()) { return; } // Set next camera position based on user input if (Input.GetKeyDown(KeyCode.E)) { currentPos = currentPos.getNextPos(); if (audioSource) { audioSource.PlayOneShot(snapSound); } } else if (Input.GetKeyDown(KeyCode.Q)) { currentPos = currentPos.getPreviousPos(); if (audioSource && snapSound) { audioSource.PlayOneShot(snapSound); } } // Move to next position if (currentPos != null) { MoveToNextPos(); } }
public void SetSnapPos(CamSnapPos levelDefaultSnapPos) { currentPos = levelDefaultSnapPos; }