public EquippableSlot GetBestEquipSlot(EquippableInventoryItem item, EquippableSlot[] slots, InventoryPlayer player) { if (slots.Length > 0) { return(slots[0]); } return(null); }
private void EquipEquippable(int instanceID) { Debug.Log(string.Format("Item {0} equipped on player {1}", instanceID, Identity.OwnerConnection.ConnectionID)); NetworkIdentity networkIdentity = NetworkIdentityManager.Instance.Get(instanceID); EquippableInventoryItem item = networkIdentity.GetComponent <EquippableInventoryItem>(); m_Equippables.Add(item); EquippableEquipped(item); }
public EquippableSlot[] GetEquippableSlots(EquippableInventoryItem item, InventoryPlayer player) { if (player == null || player.characterUI == null) { return(new EquippableSlot[0]); } player.characterUI.IndexManuallyDefinedCollection(); player.characterUI.UpdateEquippableSlots(); return(player.characterUI.GetEquippableSlots(item)); }
public InventoryEquippableField[] GetEquippableSlots(EquippableInventoryItem item, InventoryPlayer player) { if (player == null || player.characterCollection == null || player.characterCollection.container == null) return new InventoryEquippableField[0]; var equipSlots = new List<InventoryEquippableField>(4); foreach (var field in player.characterCollection.container.GetComponentsInChildren<InventoryEquippableField>(true)) { foreach (var type in field._equipTypes) { if (item._equipType == type) { equipSlots.Add(field); } } } return equipSlots.ToArray(); }
public InventoryEquippableField GetBestEquipSlot(EquippableInventoryItem item, InventoryEquippableField[] fields, InventoryPlayer player) { if (fields.Length > 0) return fields[0]; return null; }
protected virtual void EquippableUnequipped(EquippableInventoryItem item) { }