示例#1
0
    override protected void UpdateMe()
    {
        if (isPowered)
        {
            Decrease();
        }
        else
        {
            Increase();
        }

        if (text)
        {
            text.text = ((int)currentParameter).ToString();
        }

        if ((int)currentParameter == 0 && !sceneLoading)
        {
            sceneLoading = true;
            LoadScene load = new LoadScene(1, 2, "Intro");
            StartCoroutine(load.LoadGame());
            vol = audio.volume;
        }

        if (sceneLoading)
        {
            float newVol = (vol * (audio.volume / vol)) * Time.deltaTime;
            Mathf.Clamp(newVol, 0, 1);
            audio.volume -= newVol;
            Debug.Log(newVol);
        }
    }
示例#2
0
    public IEnumerator OxygenOutFailStateRoutine()
    {
        LoadScene load = new LoadScene(0, 1, "Attract", Color.black);

        StartCoroutine(load.LoadGame());
        yield return(null);
    }
示例#3
0
    internal IEnumerator TriggerWinState()
    {
        hasWon = true;
        if (cryo.GetAliveCryoBeds().Count == 6)
        {
            dialogueRunner.StartDialogue("WinState-AllColonistsRemain");
        }
        else
        {
            dialogueRunner.StartDialogue("WinState-SomeColonistsRemain");
        }
        yield return(new WaitWhile(() => {
            return dialogueRunner.isDialogueRunning;
        }));

        foreach (GameObject cryo in cryo.GetAliveCryoBeds())
        {
            Instantiate(teleportParticlePrefab, cryo.transform.position, cryo.transform.rotation, cryo.transform);
            yield return(new WaitForSeconds(1f));
        }

        Instantiate(playerTeleportParticlePrefab, playerTransform.position, playerTransform.rotation, playerTransform);

        LoadScene load = new LoadScene(0, 10, "Attract", Color.grey);

        StartCoroutine(load.LoadGame());
    }
示例#4
0
    public IEnumerator AllColonistsDeadRoutine()
    {
        allDead = true;
        dialogueRunner.StartDialogue("FailState-AllColonistsDead");
        yield return(new WaitWhile(() => {
            return dialogueRunner.isDialogueRunning;
        }));

        Debug.Log("Fading to black");
        LoadScene load = new LoadScene(0, 4, "Attract", Color.black);

        StartCoroutine(load.LoadGame());
    }