public void Start()
        {
            #region Assign Equipment Holder Slots On Character Model
            EquipmentHolderSlot[] equipmentHolderSlots = GetComponentsInChildren<EquipmentHolderSlot>();
            foreach (EquipmentHolderSlot equipmentHolderSlot in equipmentHolderSlots)
            {
                switch (equipmentHolderSlot.slotType)
                {                   
                    case SlotType.leftHandSlot:
                        leftHandSlot = equipmentHolderSlot;
                        break;
                    case SlotType.rightHandSlot:
                        rightHandSlot = equipmentHolderSlot;
                        break;
                    case SlotType.quiver:
                        quiverSlot = equipmentHolderSlot;
                        break;
                }
            }
            #endregion

            modHandler = GetComponent<EquipmentModifiersHandler>();
            characterStats = GetComponent<CharacterStats>();

            foreach (EquipableItem item in Equipments)
                EquipItem(item);
        }
        public void Start()
        {
            inventoryHandler = GetComponent <InventoryHandler>();
            playerEquipment  = GetComponent <PlayerEquipment>();

            #region Assign Equipment Holder Slots On Character Model
            EquipmentHolderSlot[] equipmentHolderSlots = GetComponentsInChildren <EquipmentHolderSlot>();
            foreach (EquipmentHolderSlot equipmentHolderSlot in equipmentHolderSlots)
            {
                switch (equipmentHolderSlot.slotType)
                {
                case SlotType.leftHandSlot:
                    leftHandSlot = equipmentHolderSlot;
                    break;

                case SlotType.rightHandSlot:
                    rightHandSlot = equipmentHolderSlot;
                    break;

                case SlotType.amulet:
                    amuletSlot = equipmentHolderSlot;
                    break;

                case SlotType.quiver:
                    quiverSlot = equipmentHolderSlot;
                    break;
                }
            }
            #endregion

            #region Assign Equipment Item Slot on Inventory Menu
            InventorySlot[] equipedItems = EquipedItems.GetComponentsInChildren <InventorySlot>();
            foreach (InventorySlot equipedItem in equipedItems)
            {
                switch (equipedItem.slotType)
                {
                case SlotType.amulet:
                    EquipedAmulet = equipedItem;
                    break;

                case SlotType.gloves:
                    EquipedGloves = equipedItem;
                    break;

                case SlotType.leftHandSlot:
                    EquipedLeftHand = equipedItem;
                    break;

                case SlotType.rightHandSlot:
                    EquipedRightHand = equipedItem;
                    break;

                case SlotType.leggings:
                    EquipedLegging = equipedItem;
                    break;

                case SlotType.boots:
                    EquipedBoots = equipedItem;
                    break;

                case SlotType.helmet:
                    EquipedHelmet = equipedItem;
                    break;

                case SlotType.torso:
                    EquipedTorso = equipedItem;
                    break;
                }
            }
            #endregion
        }
Пример #3
0
        public void Awake()
        {
            inventoryHandler = GetComponent <InventoryHandler>();

            EquipmentHolderSlot[] equipmentHolderSlots = GetComponentsInChildren <EquipmentHolderSlot>();
            foreach (EquipmentHolderSlot equipmentHolderSlot in equipmentHolderSlots)
            {
                switch (equipmentHolderSlot.slotType)
                {
                case "helmetSlot":
                    helmetSlot = equipmentHolderSlot;
                    break;

                case "gloveSlot":
                    gloveSlot = equipmentHolderSlot;
                    break;

                case "leggingSlot":
                    leggingSlot = equipmentHolderSlot;
                    break;

                case "torsoSlot":
                    torsoSlot = equipmentHolderSlot;
                    break;

                case "leftHandSlot":
                    leftHandSlot = equipmentHolderSlot;
                    break;

                case "rightHandSlot":
                    rightHandSlot = equipmentHolderSlot;
                    break;

                case "amuletSlot":
                    amuletSlot = equipmentHolderSlot;
                    break;

                case "bootSlot":
                    bootSlot = equipmentHolderSlot;
                    break;
                }
            }

            InventorySlot[] equipedItems = EquipedItems.GetComponentsInChildren <InventorySlot>();
            foreach (InventorySlot equipedItem in equipedItems)
            {
                switch (equipedItem.name)
                {
                case "Amulets":
                    EquipedAmulet = equipedItem;
                    break;

                case "Gloves":
                    EquipedGloves = equipedItem;
                    break;

                case "LeftHandEquip":
                    EquipedLeftHand = equipedItem;
                    break;

                case "RightHandEquip":
                    EquipedRightHand = equipedItem;
                    break;

                case "Leggings":
                    EquipedLegging = equipedItem;
                    break;

                case "Boots":
                    EquipedBoots = equipedItem;
                    break;

                case "Helmets":
                    EquipedHelmet = equipedItem;
                    break;

                case "Torso":
                    EquipedTorso = equipedItem;
                    break;
                }
            }
        }