コード例 #1
0
    //EquipedConsumable//////////////////////////////////


    //EquipedArmor///////////////////////////////////////
    public void EquipArmor(GameObject item, ArmorType armorType) //MUST UNEQUIP BEFORE EQUIPPING IF NOT NULL
    {
        ItemMaster tempMaster   = item.GetComponent <ItemMaster>();
        int        itemSubArray = (int)tempMaster.ReturnItemType();
        Armor      armorScript  = item.GetComponent <Armor>();

        UnEquipArmor(armorType);

        EquippedArmor[(int)armorType] = item;
        InventoryStorage[itemSubArray][tempMaster.ReturnItemName()].Remove(item);

        playerStats.AddAttributeEffect(AttributesEnum.armor, STARTUP_DECLARATIONS.ArmorTypeEnumReverse[(int)armorType], true, armorScript.returnArmor());     //second entry is name e.g. "Head"
        playerStats.AddAttributeEffect(AttributesEnum.plating, STARTUP_DECLARATIONS.ArmorTypeEnumReverse[(int)armorType], true, armorScript.returnPlating()); //second entry is name e.g. "Head"
        playerStats.AddAttributeEffect(AttributesEnum.stamina_regen, STARTUP_DECLARATIONS.ArmorTypeEnumReverse[(int)armorType], false, armorScript.returnEEnergyRegenModifier());

        // UMA Component
        playerAvatar.SetSlot(armorScript.GetWardrobePiece().Item1);
        if (armorScript.GetWardrobePiece().Item2)
        {
            playerAvatar.SetSlot(armorScript.GetWardrobePiece().Item2);
        }
        playerAvatar.BuildCharacter();
    }