Пример #1
0
 public void RemoveActiveTool(int removeCount)
 {
     if (Inventory != null)
     {
         Inventory.RemoveSlotItems(Inventory.ActiveSlotIndex, removeCount);
     }
 }
Пример #2
0
 public bool Place(TerrainRaycastResult raycastResult)
 {
     if (Place1 != null)
     {
         return(Place1(raycastResult));
     }
     if (Place(raycastResult, ActiveBlockValue))
     {
         if (Inventory != null)
         {
             Inventory.RemoveSlotItems(Inventory.ActiveSlotIndex, 1);
         }
         return(true);
     }
     return(false);
 }
Пример #3
0
        public void DamageActiveTool(int damageCount)
        {
            if (m_subsystemGameInfo.WorldSettings.GameMode == GameMode.Creative || Inventory == null)
            {
                return;
            }
            int num = BlocksManager.DamageItem(ActiveBlockValue, damageCount);

            if (num != 0)
            {
                int slotCount = Inventory.GetSlotCount(Inventory.ActiveSlotIndex);
                Inventory.RemoveSlotItems(Inventory.ActiveSlotIndex, slotCount);
                if (Inventory.GetSlotCount(Inventory.ActiveSlotIndex) == 0)
                {
                    Inventory.AddSlotItems(Inventory.ActiveSlotIndex, num, slotCount);
                }
            }
            else
            {
                Inventory.RemoveSlotItems(Inventory.ActiveSlotIndex, 1);
            }
        }