示例#1
0
 // Final state
 IEnumerator Celebrate()
 {
     onCelebrationEvent.Invoke();
     Debug.Log("Celebrating");
     respondState = RespondToPlayerState.Celebration;
     yield break;
 }
示例#2
0
    IEnumerator Idle()
    {
        onIdleEvent.Invoke();

        Debug.Log("Start Idle");
        respondState = RespondToPlayerState.IsIdle;
        while (platformCount == gm.playerOrder.Count)
        {
            Debug.Log("Idle");
            platformCount = gm.playerOrder.Count;
            yield return(new WaitForFixedUpdate());
        }
        if (gm.playerOrder.Count == gm.platformOrder.Count)
        {
            currentStateCoroutine = StartCoroutine("Celebrate");
        }
        else if (gm.playerOrder.Count == 0)
        {
            platformCount         = 0;
            currentStateCoroutine = StartCoroutine("Idle");
        }
        else if ((platformCount + 1) == gm.playerOrder.Count)
        {
            platformCount         = gm.playerOrder.Count;
            currentStateCoroutine = StartCoroutine("Cheer");
        }
        yield return(null);
    }
示例#3
0
    IEnumerator Cheer()
    {
        onCheerEvent.Invoke();

        respondState = RespondToPlayerState.Cheering;
        Debug.Log("Start Cheering");
        yield return(new WaitForSeconds(cheerDuration));

        currentStateCoroutine = StartCoroutine("Idle");
    }
示例#4
0
    // All the states for the FSM with their Unity Events
    IEnumerator PlayMusic()
    {
        Debug.Log("Start Play Music");
        onPlayMusicEvent.Invoke();

        respondState = RespondToPlayerState.PlayingMusic;
        while (gm.isPlayingAudio)
        {
            Debug.Log("Playing Audio");
            yield return(new WaitForFixedUpdate());
        }
        currentStateCoroutine = StartCoroutine("Idle");
        yield return(null);
    }