void Awake() { if (instance == null) { instance = this; } else { Debug.LogWarning("A TutorialEventScript object already exists!"); Destroy(this.gameObject); return; } audioSource = this.GetComponent <AudioSource>(); audioSource.clip = BackgroundTrack; }
private IEnumerator PlayEvent() { player.SetLightningBody(true); cam.Shake(); cam.Flash(Color.white, 2.0f); TutorialEventScripts.EnableAllCameras(); TutorialEventScripts.SetLights(true); doorToUnlock.Unlock(); audioSource.PlayOneShot(electricExplosionSound, 0.1f); yield return(new WaitForSeconds(0.8f)); audioSource.PlayOneShot(chargeUpSound, 0.1f); yield return(new WaitForSeconds(1.0f)); TutorialEventScripts.PlayBackgroundTrack(); player.SetLightningBody(false); }