Ejemplo n.º 1
0
    public void Start()
    {
        // Add all posible states
        game   = gameObject.AddComponent <GameState>();
        paused = gameObject.AddComponent <PausedState>();

        // Default state
        state = paused.State();

        StartCoroutine(Run());
    }
Ejemplo n.º 2
0
    public IEnumerable State()
    {
        countdown = 3;

        while (countdown > 0)
        {
            Debug.Log("Playing for " + countdown + "...");
            countdown--;
            yield return(new WaitForSecondsRealtime(1));
        }

        fsm.state = paused.State();
    }