private void ClearInventorySlot(bool forceClientInform, params string[] slotNames) { for (int i = 0; i < slotNames.Length; i++) { Inventory[slotNames[i]] = null; if (slotNames[i] == "id" || slotNames[i] == "storage01" || slotNames[i] == "storage02" || slotNames[i] == "suitStorage") { //Not clearing onPlayer sprites for these as they don't have any } else { equipment.ClearItemSprite(slotNames[i]); } UpdateSlotMessage.Send(gameObject, slotNames[i], null, forceClientInform); } // Debug.LogFormat("Cleared {0}", slotNames); }
public void CmdDropItem(string eventName) { if (ServerCache.ContainsKey(eventName)) { if (ServerCache[eventName] != null) { GameObject item = ServerCache[eventName]; EquipmentPool.DropGameObject(gameObject.name, ServerCache[eventName]); RpcAdjustItemParent(ServerCache[eventName], null); ServerCache[eventName] = null; equipment.ClearItemSprite(eventName); } else { Debug.Log("Object not found in ServerCache"); } } }