protected virtual void CheckDownSelection() { // no relavent input, restart cooldown if (!playerInput.IsDownPress() && !playerInput.IsDown()) { downWait.StopCoroutine(); return; } // single press, just move along if (playerInput.IsDownPress()) { MoveDown(); downWait.StartCoroutine(); return; } // hold, go if off cooldown if (playerInput.IsDown()) { if (downWait.IsRunning) { return; } MoveDown(); downWait.StartCoroutine(); } }
private void StartCrossfade(AudioClip clip, ManagedCoroutine <AudioSource, AudioSource> crossfade, ref AudioSource current, ref AudioSource next) { // stop any previous crossfade crossfade.StopCoroutine(); // start up crossfade AudioSource entering = next; AudioSource exiting = current; entering.clip = clip; entering.Play(); crossfade.StartCoroutine(entering, exiting); // swap values current = entering; next = exiting; }
public void SubdueBackground() { subdueBackgroundRoutine.StopCoroutine(); subdueBackgroundRoutine.StartCoroutine(subduedVolume); }