public void Use() { if (PlayerManager.LocalPlayerScript != null) { if (!PlayerManager.LocalPlayerScript.playerMove.allowInput || PlayerManager.LocalPlayerScript.playerMove.isGhost) { return; } } if (!CurrentSlot.IsFull) { return; } var type = Slots.GetItemType(CurrentSlot.Item); var masterType = Slots.GetItemMasterType(CurrentSlot.Item); switch (masterType) { case SpriteType.Clothing: var slot = Slots.GetSlotByItem(CurrentSlot.Item); SwapItem(slot); break; case SpriteType.Items: case SpriteType.Guns: break; } }
public void Use() { if (PlayerManager.LocalPlayerScript != null) { if (!PlayerManager.LocalPlayerScript.playerMove.allowInput || PlayerManager.LocalPlayerScript.playerMove.isGhost) { return; } } if (!CurrentSlot.IsFull) { return; } //This checks which UI slot the item can be equiped too and swaps it there var type = Slots.GetItemType(CurrentSlot.Item); var masterType = Slots.GetItemMasterType(CurrentSlot.Item); switch (masterType) { case SpriteType.Clothing: var slot = Slots.GetSlotByItem(CurrentSlot.Item); SwapItem(slot); break; case SpriteType.Items: var itemSlot = Slots.GetSlotByItem(CurrentSlot.Item); SwapItem(itemSlot); break; case SpriteType.Guns: break; } }