Exemple #1
0
    public void OpenCraftingTable()
    {
        if (craftingPanel.activeSelf)
        {
            CloseAllWindows();
        }
        else
        {
            CursorControll.UnlockCursor();
            HideHUD.Hide();
            CloseAllWindows();
            craftingPanel.SetActive(true);
            inventoryPanel.SetActive(true);
            craftingTier = 1;

            /*
             * foreach (Crafting.CraftingClass crft in craftingScript.craftItems)
             * {
             *  if (crft.tier == 1)
             *  {
             *      crft.btn.interactable = true;
             *  }
             * }
             */
        }
    }
Exemple #2
0
 void OpenInventory()
 {
     if (inventoryPanel.activeSelf)
     {
         CloseAllWindows();
     }
     else
     {
         for (int i = 0; i < items.Count; i++)
         {
             if (items[i].item > 0)
             {
                 items[i].text.transform.parent.gameObject.SetActive(true);
             }
             else
             {
                 items[i].text.transform.parent.gameObject.SetActive(false);
             }
         }
         inventoryPanel.SetActive(true);
         craftingPanel.SetActive(true);
         foreach (Building.BuildingsClass build in buildingScript.buildings)
         {
             build.key = false;
         }
         CursorControll.UnlockCursor();
         foreach (ItemsClass itm in items)
         {
             itm.text.text = itm.item.ToString();
         }
         craftingTier = 0;
         HideHUD.Hide();
     }
 }
Exemple #3
0
        public static void Notify(object sender, GameEventArgs e)
        {
            switch (e.type)
            {
            case BLOCK_INPUT:
                BlockInput?.Invoke(sender, e);
                break;

            case UNBLOCK_INPUT:
                UnblockInput?.Invoke(sender, e);
                break;

            case BLOCK_HUD:
                BlockHUD?.Invoke(sender, e);
                break;

            case UNBLOCK_HUD:
                UnblockHUD?.Invoke(sender, e);
                break;

            case HIDE_HUD:
                HideHUD?.Invoke(sender, e);
                break;

            case SHOW_HUD:
                ShowHUD?.Invoke(sender, e);
                break;
            }
        }
Exemple #4
0
        /// <summary>
        /// Use it for notify from EventTrigger Component. Requires to be component on GameObject!
        /// </summary>
        /// <param name="sender">The sender object.</param>
        /// <param name="e">Event arguments</param>
        public void Notify(string type)
        {
            switch (type)
            {
            case BLOCK_INPUT:
                BlockInput?.Invoke(null, new GameEventArgs(type));
                break;

            case UNBLOCK_INPUT:
                UnblockInput?.Invoke(null, new GameEventArgs(type));
                break;

            case BLOCK_HUD:
                BlockHUD?.Invoke(null, new GameEventArgs(type));
                break;

            case UNBLOCK_HUD:
                UnblockHUD?.Invoke(null, new GameEventArgs(type));
                break;

            case HIDE_HUD:
                HideHUD?.Invoke(null, new GameEventArgs(type));
                break;

            case SHOW_HUD:
                ShowHUD?.Invoke(null, new GameEventArgs(type));
                break;
            }
        }
Exemple #5
0
 public void CloseAllWindows()
 {
     smeltingPanel.SetActive(false);
     craftingPanel.SetActive(false);
     inventoryPanel.SetActive(false);
     CursorControll.LockCursor();
     HideHUD.Show();
 }
Exemple #6
0
 public void OpenCampfire()
 {
     if (smeltingPanel.activeSelf)
     {
         CloseAllWindows();
     }
     else
     {
         CursorControll.UnlockCursor();
         HideHUD.Hide();
         CloseAllWindows();
         smeltingPanel.SetActive(true);
         inventoryPanel.SetActive(true);
     }
 }