IEnumerator Sequence()
    {
        _oolEnviroLight.Toggle();
        AkSoundEngine.PostEvent("play_enemy_bones", gameObject);

        yield return(new WaitForSeconds(1)); // 1

        AkSoundEngine.PostEvent("dial_deathiscoming", gameObject);
        int indice = 0;

        foreach (GameObject angel in angels)
        {
            angel.SetActive(true);
            angelScripts[indice]           = angel.GetComponent <Angel>();
            angelScripts[indice].Activated = false;
            indice++;
        }

        yield return(new WaitForSeconds(2)); // 3

        _flcPlayer1.GetComponent <Player>().IsInvincible = true;
        _flcPlayer2.GetComponent <Player>().IsInvincible = true;
        _oolEnviroLight.Toggle();
        _oolEnviroLight.FlickeringType  = OnOffLight.FlickerType.STROBOSCOPE;
        _oolEnviroLight.StroboscopeRate = 6;
        foreach (Angel angel in angelScripts)
        {
            angel.Activated = true;
        }
        AkSoundEngine.PostEvent("stop_enemy_bones", gameObject);

        yield return(new WaitForSeconds(1)); // 4

        /*_flcPlayer1.DesactivFlashLight();
        *  _flcPlayer2.DesactivFlashLight();*/
        _oolEnviroLight.StroboscopeRate = 6;
        //AkSoundEngine.PostEvent("dial_cantturn", gameObject);

        yield return(new WaitForSeconds(1)); // 6

        _oolEnviroLight.StroboscopeRate = 6;
        AkSoundEngine.StopAll();
        AkSoundEngine.PostEvent("dial_end", gameObject);

        yield return(new WaitForSeconds(4)); // 10

        GameObject.Find("PlayTestMaster").GetComponent <PlayTestMaster>().SwitchSceneStrobo(EndScene, true);

        yield return(new WaitForSeconds(3)); // 13

        BlackImage.SetActive(true);
    }
Beispiel #2
0
    IEnumerator LightFlashing()
    {
        light.FlickeringType = OnOffLight.FlickerType.RandomFlicker;
        yield return(new WaitForSeconds(3));

        light.Toggle();
    }