public void PlaySound() { if (randomSound != null) { randomSound.PlaySound(); } }
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(); }
private void OnEnable() { if (particle != null) { particle.Play(); } if (audioSource != null) { if (audioSource.isPlaying) { audioSource.Stop(); } audioSource.Play(); } if (soundPlayer != null) { soundPlayer.PlaySound(); } }