Ejemplo n.º 1
0
 // 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();
         }
     }
 }
Ejemplo n.º 2
0
    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();
    }