コード例 #1
0
    IEnumerator InitCryoChamber()
    {
        MasterAudio.StartPlaylist("Nautilus Atmo");
        MasterAudio.PlaylistMasterVolume = 0.3f;
        _OnMenu = false;

        if (EndlessPersistance._CryoCount == 0)
        {
            // If _CryoCount = 0, do the extended intro
            StartCoroutine(EndlessPersistance.FadeControl(0));
            yield return(new WaitForSeconds(10f));

            MasterAudio.PlaySound("Ethereal_Welcome01", 1);
            yield return(new WaitForSeconds(5f));

            MasterAudio.PlaySound("Ethereal_Intro01", 1);
            yield return(new WaitForSeconds(5f));
        }
        else
        {
            // If _CryoCount is any other number, do the short intro
            StartCoroutine(EndlessPersistance.FadeControl(0));
            yield return(new WaitForSeconds(3f));

            MasterAudio.PlaySound("Ethereal_Welcome02", 1);
            yield return(new WaitForSeconds(3f));
        }

        MasterAudio.PlaySoundAndForget("cryo_release", 1);
        StartCoroutine(EndlessPersistance.FadeControl(1));
        yield return(new WaitForSeconds(2f));

        Player_OVRPC.transform.position = _StartLoc.position;
        Player_OVRPC.transform.rotation = Quaternion.Euler(0, 0, 0); // reset rotation
        _CryoEffect.SetActive(false);                                // turn off cryo chamber
        StartCoroutine(EndlessPersistance.FadeControl(0));
        yield return(new WaitForSeconds(3f));

        OVRCharacter.enabled = true;
        OVRGamepad.enabled   = true;
        OVRPlayer.enabled    = true;

        if (EndlessPersistance._CryoCount == 0)
        {
            MasterAudio.PlaySound("Ethereal_Intro02", 1);
            yield return(new WaitForSeconds(3.8f));

            MasterAudio.PlaySound("Ethereal_Intro03", 1);
            yield return(new WaitForSeconds(5f));

            MasterAudio.PlaySound("Ethereal_Background01", 1);
            yield return(new WaitForSeconds(20f));
        }
        MasterAudio.PlaySound("Ethereal_Prompt01", 1);
        EndlessPersistance._CryoCount++;  // add one to the cryo counter
    }
コード例 #2
0
    IEnumerator InitNautilus()
    {
        yield return(new WaitForSeconds(0.4f));

        StartCoroutine(EndlessPersistance.FadeControl(1));
        _MainMenuRoot.SetActive(false);
        MasterAudio.StopPlaylist("Menu Music");
        yield return(new WaitForSeconds(3f));

        Player_OVRPC.transform.position = _CryoLoc.position;           // move player into the Nautilus
        Player_OVRPC.transform.rotation = Quaternion.Euler(0, -90, 0); // reset rotation
        StartCoroutine(InitCryoChamber());
    }
コード例 #3
0
    IEnumerator InitMenu()
    {
        StopCoroutine("InitCryoChamber");
        EndlessPersistance._CryoCount++;  // add one to the cryo counter
        OVRCharacter.enabled = false;
        OVRGamepad.enabled   = false;
        OVRPlayer.enabled    = false;
        MasterAudio.StopPlaylist("Nautilus_Atmo");
        StartCoroutine(EndlessPersistance.FadeControl(1));
        _MainMenuRoot.SetActive(true);
        yield return(new WaitForSeconds(1f));

        Player_OVRPC.transform.position = _MainMenuLoc.position;  // move player to the main menu
        StartCoroutine(EndlessPersistance.FadeControl(0));
        MasterAudio.StartPlaylist("Menu Music");

        yield return(new WaitForSeconds(3f));
    }
コード例 #4
0
    IEnumerator LoadLevel()
    {
        _FX_Loading.SetActive(true);
        _FX_StagingArea.SetActive(false);
        iTween.RotateAdd(_AurgusDrone, new Vector3(0, 0, 100), 8); // rotate out
        iTween.MoveAdd(_AurgusDrone, new Vector3(40, -35, 0), 8);  // move up slightly
        float OverloadEndTime = Time.realtimeSinceStartup + 4f;

        while (Time.realtimeSinceStartup < OverloadEndTime)
        {
            if (Time.timeScale > 0.1f)
            {
                Time.timeScale -= 0.01f;
            }
            yield return(null);
        }
        Instantiate(_AurgusBoost, _AurgusDrone.transform.position, Quaternion.identity);
        iTween.MoveTo(_AurgusDrone, iTween.Hash("position", _DroneDestination.transform.position, "time", 4, "easetype", iTween.EaseType.linear, "ignoretimescale", true));
        StartCoroutine(EndlessPersistance.FadeControl(1));
        yield return(new WaitForSeconds(1f));

        // DESTROY ALL ITWEENS
        iTween.Destructor();

        // LOAD A LEVEL
        switch (LevelToLoad)
        {
        case 1:
            Application.LoadLevel(1);
            break;

        case 2:
            Application.LoadLevel(2);
            break;

        case 3:
            Application.LoadLevel(3);
            break;

        case 4:
            Application.LoadLevel(4);
            break;

        case 5:
            //Application.LoadLevel(5);
            break;

        case 6:
            //Application.LoadLevel(6);
            break;

        case 7:
            //Application.LoadLevel(7);
            break;

        case 8:
            //Application.LoadLevel(8);
            break;

        case 9:
            //Application.LoadLevel(9);
            break;

        case 10:
            //Application.LoadLevel(10);
            break;

        default:
            //_LoadingBack.SendMessage("OnClick");  // return to main menu if no level to load
            break;
        }
    }