// Update is called once per frame void Update() { if (RInput.GetButtonDown("Flashlight") && !_modifying) { if (_ool.Toggled && isActiv) { AkSoundEngine.PostEvent("play_flashlight_off", this.gameObject); _ool.ToggleOff(); } else if (!_ool.Toggled && _battery.CurrentBattery > _battery.ToggleOnCost && isActiv) { AkSoundEngine.PostEvent("play_flashlight_on", this.gameObject); Debug.Log("SOUND PLAYER"); _ool.ToggleOn(); } } }
IEnumerator startSequence() { //Turn off lamp1 lamp1.ToggleOff(); lamp3.ToggleOff(); yield return(new WaitForSeconds(delay1)); //Turn on lamp1 lamp1.ToggleOn(); yield return(new WaitForSeconds(delay2)); //Turn off lamp2 lamp2.ToggleOff(); yield return(new WaitForSeconds(delay3)); //Turn off lamp1 lamp1.ToggleOff(); lamp3.ToggleOn(); }