Exemple #1
0
    // Use this for initialization
    void Start () {
        buttonStart.onClick.AddListener(delegate { onClick(0); });
        buttonExit.onClick.AddListener(delegate { onClick(1); });
        buttonResume.onClick.AddListener(delegate { onClick(2); });

        gameState = FindObjectOfType<PersistantState>();

        if (gameState.Stage > 0)
            buttonResume.interactable = true;
    }
Exemple #2
0
    //public GameObject gameLogic;

    // Use this for initialization
    void Start () {
        gameState = FindObjectOfType<PersistantState>();
        currentDecision = gameState.Decisions[gameState.Stage];

        textDay.text = string.Format("Day {0}", gameState.Stage + 1);
        textQuery.text = currentDecision.query;
        buttonAlternative1.GetComponentInChildren<Text>().text = currentDecision.alternatives[0];
        buttonAlternative1.onClick.AddListener(delegate { onClick(0); });
        buttonAlternative2.GetComponentInChildren<Text>().text = currentDecision.alternatives[1];
        buttonAlternative2.onClick.AddListener(delegate { onClick(1); });
    }
Exemple #3
0
    void Awake()
    {
        persistantState = FindObjectOfType<PersistantState>();
        Consequence consequnce = persistantState.Decisions[persistantState.Stage].consequences[persistantState.Alternative];
        diageticText.text = consequnce.startMessage;
        successScreen.GetComponentInChildren<Text>().text = consequnce.successMessage;
        failureScreen.GetComponentInChildren<Text>().text = consequnce.failMessage;

        if (consequnce.settings.extraTask)
        {
            secondCoffeeMachine.SetActive(true);
            foreach (ProgrammerLogic pl in FindObjectsOfType<ProgrammerLogic>())
            {
                pl.randomizeCoffeePreference();
            }
        }
    }