Ejemplo n.º 1
0
        public EquippableSlot GetBestEquipSlot(EquippableInventoryItem item, EquippableSlot[] slots, InventoryPlayer player)
        {
            if (slots.Length > 0)
            {
                return(slots[0]);
            }

            return(null);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 6
0
 protected virtual void EquippableUnequipped(EquippableInventoryItem item)
 {
 }