public void PlaySound()
 {
     if (randomSound != null)
     {
         randomSound.PlaySound();
     }
 }
Пример #2
0
 public void HitCheckpoint()
 {
     if (currentCheckpoint == 0)
     {
         currentLaps--;
         if (currentLaps < 0 && !lose)
         {
             win = true;
         }
     }
     currentCheckpoint++;
     if (currentCheckpoint == checkpoints.Count)
     {
         currentCheckpoint = 0;
     }
     checkpoints[currentCheckpoint].Activate();
     currentTime += checkpointTime;
     startEndSounds.PlaySound();
 }
Пример #3
0
    private void OnEnable()
    {
        if (particle != null)
        {
            particle.Play();
        }

        if (audioSource != null)
        {
            if (audioSource.isPlaying)
            {
                audioSource.Stop();
            }
            audioSource.Play();
        }

        if (soundPlayer != null)
        {
            soundPlayer.PlaySound();
        }
    }