//to-do: Add other ways for Resource values to change
    void Awake()
    {
        button = gameObject.GetComponent <Button>();
        button.onClick.AddListener(ResourceUsage);//Method for reducing resource use for each resource that the policy/decision requires
        int i = 0;

        while (i < otherButtons.Count)
        {
            otherButtons[i].onClick.AddListener(PressedTheOtherButtons);//check if narratively conflicting buttons are pressed
            i++;
        }
        if (unlockButton)
        {
            text      = gameObject.transform.Find("UnlockNeeded").gameObject.GetComponent <Text>();
            text.text = unlockButton.gameObject.name + " Needed";
        }
        else if (!unlockButton)
        {
            text     = null;
            unlocked = true;
        }
        gameResources[0] = GameObject.Find("Energy").GetComponent <GameResource>();
        gameResources[1] = GameObject.Find("Wealth").GetComponent <GameResource>();
        gameResources[2] = GameObject.Find("Renewables").GetComponent <GameResource>();
        hiddenPlayer     = GameObject.Find("HiddenPlayer").GetComponent <HiddenPlayer>();
        gainModifier     = GetComponent <GainModifier>();
    }
Exemple #2
0
 void Awake()
 {
     gainModifier = GetComponentInParent <GainModifier>();
     text         = GetComponent <Text>();
 }