// Use this for initialization
    void Start()
    {
        var item_list = engine.GetItemsList();

        for (int i = 0; i < item_list.Count; i++)
        {
            Inventory.Add(item_list[i], 0);
        }
    }
Beispiel #2
0
    public bool AddItem(Item item)
    {
        if (_inventoryData.Count() >= INVENTORY_MAX_ITEMS)
        {
            Debug.Log("Inventory Full");
            return(false);
        }
        if (null != _inventoryData.Contains(item.UniqeId))
        {
            Debug.Log("Inventory already contains " + item.UniqeId);
            return(false);
        }

        _inventoryData.Add(item);
        Notify();
        return(true);
    }
Beispiel #3
0
 public void UpdateProgress(float dt)
 {
     finish_list.Clear();
     for (int i = 0; i < Slots && i < pipeline.Count; i++)
     {
         if (pipeline[i].UpdateProgress(dt * ProgressSpeed, ProgressSpeed) >= 1f)
         {
             finish_list.Add(pipeline[i]);
         }
     }
     while (finish_list.Count > 0)
     {
         BuildPipelineCell finished_cell = finish_list[0];
         welcome.AddBuild(finished_cell.ID, 1);
         Inventory.Add(finished_cell.ID, 1);
         pipeline.Remove(finished_cell);
         finish_list.RemoveAt(0);
         Destroy(finished_cell.gameObject);
         UpdateStates();
         InvView.UpdateView();
         BuildArea.UpdateView();
     }
 }