コード例 #1
0
    // ==================== MINIGAME 1 LOGIC / FUNCTIONS ==================== //

    /*
     * 1. Generate combo string
     * 2. Register each input and check for match (done in Update() loop)
     * 3. a) If correct, move on to next input
     *    b) Else, player moves to next carriage and repeats this
     * 4. a) If player clears the combo string, he gets the seat and go straights to cutscene
     *    b) Otherwise, when player uses up all his attempts, he will also be directed to cutscene
     */
    public void TriggerMinigame(ReturnFlowToGameState callback)
    {
        GenerateComboString(numCorrectAttempts + 1);
        callbackToGameState = callback;
        m_GamePanel.SetActive(true);
        StartCoroutine(ShowInstructionsCoroutine());
    }
コード例 #2
0
    // ==================== MINIGAME 2 LOGIC / FUNCTIONS ==================== //

    /*
     * 1. A random passenger will lift their foot and hold them in mid-air for some time,
     *    then put his/her foot down.
     * 2. Player must press 'A' or 'D' to retrieve the item underneath that passenger's foot,
     *    depending on which passenger raised his/her foot.
     *    a) If input is registered in time, the item is retrieved from under the passenger's seat
     *    b) Else, player must wait for next trigger.
     * 3. If player finally takes back all items from underneath every seat, he clears the game.
     *    Otherwise, the game continues until the end state is reached.
     */
    public void TriggerMinigame(ReturnFlowToGameState callback)
    {
        callbackToGameState = callback;
        m_GamePanel.SetActive(true);
    }