示例#1
0
        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();
            }
        }
示例#2
0
        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;
        }
示例#3
0
 public void SubdueBackground()
 {
     subdueBackgroundRoutine.StopCoroutine();
     subdueBackgroundRoutine.StartCoroutine(subduedVolume);
 }