Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        levelScript = GameObject.Find("Boton de Giro").GetComponent <TurnButton> ();

        redButton[0].onClick.AddListener(redButtonSoundStart);
        redButton[1].onClick.AddListener(redButtonSoundFinish);
    }
Ejemplo n.º 2
0
    private void LoadReferences()
    {
        year    = GlobalInfo.instance.year;
        gold    = GlobalInfo.instance.gold;
        stamina = GlobalInfo.instance.stamina;
        tax     = (year - 1) * 5;

        workers        = new List <Worker>();
        cropHexes      = new List <Hex>();
        canvas         = GameObject.Find("Canvas");
        yearText       = canvas.transform.Find("YearText").GetComponent <Text>();
        taxText        = canvas.transform.Find("TaxText").GetComponent <Text>();
        goldText       = canvas.transform.Find("GoldText").GetComponent <Text>();
        movesText      = canvas.transform.Find("MovesText").GetComponent <Text>();
        resourceParent = GameObject.Find("Resources");
        workerParent   = GameObject.Find("Workers");
        screenFader    = canvas.GetComponentInChildren <ScreenFader>();
        turnButton     = canvas.GetComponentInChildren <TurnButton>();
        resultsCanvas  = canvas.GetComponentInChildren <CanvasGroup>();
        resultsText    = resultsCanvas.transform.Find("ResultsGold").GetComponent <Text>();
        growingCrops   = new List <Crop>();
        workerMenu     = canvas.GetComponentInChildren <WorkerMenu>();
    }