Example #1
0
 void Update()
 {
     if (Input.GetMouseButtonDown(1) && !EventSystem.current.IsPointerOverGameObject())
     {
         ChestMain chest = FindChest();
         if (chest)
         {
             OpenChestPanel(chest);
         }
     }
 }
    public void DepositTo(int amount, ChestMain chest)
    {
        if (amount > OccupiedSlots)
        {
            return;
        }
        OccupiedSlots -= amount;
        int remaining = chest.Deposit(amount);

        if (remaining > 0)
        {
            OccupiedSlots += remaining;
        }
    }
Example #3
0
 void OpenChestPanel(ChestMain chest)
 {
     ChestPanel.SetChest(chest);
     ChestPanel.gameObject.SetActive(true);
     Cursor.lockState = CursorLockMode.None;
 }
Example #4
0
 public void SetChest(ChestMain chest)
 {
     Chest = chest;
 }