Пример #1
0
    private void ManageState(int choiceNumber)
    {
        // End game in death
        if (numberOfDrinks == maxDrinks)
        {
            currentState = EndStateOne;
            UpdateStory();
            return;
        }

        // Story leg
        if (!currentState.callsBartender)
        {
            secondaryStates = currentState.GetAvailableStates();
            currentState    = secondaryStates[choiceNumber];
        }

        // Back to barkeep
        else if (currentState.callsBartender)
        {
            currentState = mainStates[choiceNumber];

            if (mainStates[choiceNumber].finishedState != null)
            {
                mainStates[choiceNumber] = mainStates[choiceNumber].finishedState;
            }
        }

        UpdateStory();
    }
Пример #2
0
 private void Start()
 {
     currentState                    = startingState;
     secondaryStates                 = currentState.GetAvailableStates();
     numberOfChoicesAvailable        = secondaryStates.Length;
     backgroundImageComponent.sprite = currentState.GetBackground();
     numberOfDrinks                  = 0;
     UpdateStory();
 }