示例#1
0
    public IEnumerator TriggerEnding(float positionX)
    {
        gameManager.board.ToggleBoardSelectable(false);
        topPanel.ToggleModulesSelectable(false);
        gameManager.optionsMenu.ToggleOptionMenuButton(false);
        GameObject mittens = gameManager.InstantiateObject(mittensPrefab, gameManager.ship.shipAnimation.transform, 3.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f);

        yield return(new WaitForSeconds(0.4f));

        yield return(StartCoroutine(gameManager.messageScreen.PlayMessagePause(99, "Meeeoooowwww")));

        yield return(StartCoroutine(gameManager.messageScreen.PlayMessagePause(0, "Mittens! You are alive!\nHmmm, it's a good thing\ncats can breathe in\nspace.\nGet over here!")));

        while (mittens.transform.localPosition.x > 2.0f)
        {
            mittens.transform.localPosition -= new Vector3(0.02f, 0.0f, 0.0f);
            gameManager.board.ToggleBoardSelectable(false);
            topPanel.ToggleModulesSelectable(false);
            yield return(new WaitForSeconds(0.02f));
        }
        yield return(StartCoroutine(gameManager.messageScreen.PlayMessagePause(99, "Meeeoooowwww")));

        yield return(StartCoroutine(gameManager.messageScreen.PlayMessagePause(0, "For how much effort I...\nwe... went through to find\nyou Mittens, you sure\ntake your sweet time.")));

        while (mittens.transform.localPosition.x > 0.0f)
        {
            mittens.transform.localPosition -= new Vector3(0.02f, 0.0f, 0.0f);
            yield return(new WaitForSeconds(0.02f));
        }

        //activate scratch whirlwind
        mittens.GetComponent <Animator>().enabled = true;

        yield return(new WaitForSeconds(2.0f));

        mittens.SetActive(false);
        yield return(StartCoroutine(gameManager.messageScreen.PlayMessagePause(100, "Why did we want to\nsave you again?              \nJust kidding...\nWelcome back Mittens.\nWe missed you.\nI'll tell you about this\nperson that keeps trying\nto control our ship on\nout trip home.")));

        gameManager.optionsMenu.ToggleOptionMenuButton(true);
    }