Ejemplo n.º 1
0
    void GetRewardFromWork()
    {
        //RandomItems MyRandom = new RandomItems();


        //items_to_get = MyRandom.GetRandomItems(_items_to_mine, _item_chanse);
        //for (int i = 0; i < items_to_get.GetList().Count; i++)
        //{
        //    _item_to_storage.AddObject(items_to_get.GetList()[i].name, items_to_get.GetList()[i].Description, items_to_get.GetList()[i], _count_items_to_mine);
        //}



        _item_to_storage.AddObject(_items_to_mine.GetList()[0].name, _items_to_mine.GetList()[0].Description, _items_to_mine.GetList()[0], _count_items_to_mine);
    }
Ejemplo n.º 2
0
    void BuyUnit()
    {
        int count_truebool = 0;

        for (int i = 0; i < _countItemsToBuyUnit.Length; i++)
        {
            if (_addNewItemToStorage.GetItem(_needItemsToBuy.GetList()[i], _countItemsToBuyUnit[i]))
            {
                count_truebool += 1;
            }
        }

        if (count_truebool == _countItemsToBuyUnit.Length)
        {
            _addNewArmyUnit.GetComponent <AddNewArmyUnit>().AddObject(info_name_header, info_description_main_text, id_unit);
            for (int i = 0; i < _countItemsToBuyUnit.Length; i++)
            {
                _addNewItemToStorage.AddObject(_needItemsToBuy.GetList()[i].name, _countItemsToBuyUnit[i].ToString(), _needItemsToBuy.GetList()[i], -_countItemsToBuyUnit[i]);
            }
            Debug.Log("Unit Succes buy");
        }
    }