Exemplo n.º 1
0
    public void reset()
    {
        for (int i = 2; i < 10; i++)
        {
            GameObject go = GameObject.Find("Choice " + i);

            try
            {
                Destroy(go.gameObject);
            }
            catch (Exception e) { }
        }
        print((resourceManager.getMoney()).ToString() + " " + (resourceManager.getCitizenHappiness()).ToString() + " " + (resourceManager.getPaperSupply()).ToString());
        questionsDone++;
        if (questionsDone > questionQuota && resourceManager.getMoney() > 0 && resourceManager.getCitizenHappiness() > 0 && resourceManager.getPaperSupply() > 0)
        {
            SceneManager.LoadScene(4);
        }

        if (!(resourceManager.getMoney() > 0 && resourceManager.getCitizenHappiness() > 0 && resourceManager.getPaperSupply() > 0))
        {
            SceneManager.LoadScene(5);
        }

        button.GetComponent <Button>().onClick.RemoveAllListeners();
        setup();
    }
Exemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        text.text  = "Public Opinion: " + rLogic.getCitizenHappiness() + " - Profit: " + rLogic.getMoney() + " -  Resources: " + rLogic.getPaperSupply();
        score.text = "Score: " + (rLogic.getCitizenHappiness() + rLogic.getMoney() + rLogic.getPaperSupply());
        Text forestFact = GameObject.Find("ForestFact").GetComponent <Text>();

        forestFact.text = facts[Random.Range(0, 4)];
        Debug.Log(forestFact);
    }
    void Start()
    {
        string reason = "Error";

        if (rLogic.getMoney() < 1)
        {
            reason = "Lack of Funds Were";
        }
        else if (rLogic.getCitizenHappiness() < 1)
        {
            reason = "Riots Were";
        }
        else if (rLogic.getPaperSupply() < 1)
        {
            reason = "Lack of stock was";
        }
        text.text = reason + " the death of your company";
        Debug.Log(rLogic.getMoney() + " " + rLogic.getCitizenHappiness() + " " + rLogic.getPaperSupply());
        Text forestFact = GameObject.Find("ForestFact").GetComponent <Text>();

        forestFact.text = facts[Random.Range(0, 4)];
    }