Пример #1
0
    IEnumerator lookForInput(int cost)
    {
        do
        {
            if (chosen == optionChosen.norevive)
            {
                gameObject.GetComponent <Animator>().Play("Notification_Out");
                yield return(new WaitForSeconds(0.3f));

                chosen = optionChosen.nothing;
                MainGameManager.Game_Over();
                yield break;
            }
            else if (chosen == optionChosen.revive)
            {
                chosen = optionChosen.nothing;
                gameObject.GetComponent <Animator>().Play("Notification_Out");
                if (MainGameManager.player.GetComponentInChildren <Animator> ().GetBool("RotatedUp") == false)
                {
                    MainGameManager.player.GetComponentInChildren <Animator> ().SetBool("RotatedUp", true);
                    MainGameManager.player.GetComponentInChildren <Animator> ().Play("ToDown");
                }
                MainGameManager.coins -= cost;
                MainGameManager.coinReadout.GetComponentInChildren <TextMesh>().text = MainGameManager.coins.ToString();
                SaveManager.SetCoins(MainGameManager.coins);
                yield return(new WaitForSeconds(0.5f));

                MainGameManager.current_game_state = MainGameManager.game_state.Playing;
                MainGameManager.Revive();
                yield break;
            }
            yield return(null);
        } while(true);
    }