private void Start() { _item_to_storage = GameObject.FindWithTag("ItemsStorage").GetComponent <AddNewItemToStorage>(); mainAlert = GameObject.Find("Canvas").GetComponent <MainAlerts>(); _info_button.onClick.AddListener(OnInfo); _start_work.onClick.AddListener(Work); animator = this.gameObject.GetComponent <Animator>(); }
private void Start() { mainAlert = GameObject.Find("Canvas").GetComponent <MainAlerts>(); _addNewArmyUnit = GameObject.FindWithTag("Panel_Right").GetComponent <AddNewArmyUnit>(); _addNewItemToStorage = GameObject.FindWithTag("ItemsStorage").GetComponent <AddNewItemToStorage>(); _info_button.onClick.AddListener(OnInfo); _buyUnit.onClick.AddListener(BuyUnit); // Debug.Log(_needItemsToBuy._items_inStorage[0].name); Debug.Log(_needItemsToBuy.GetList()[0].name); for (int i = 0; i < _countItemsToBuyUnit.Length; i++) { _addNeedItemsToBuyUnit.AddObject(_needItemsToBuy.GetList()[i].name, _countItemsToBuyUnit[i].ToString()); } this.OnInfo(); }