public void ChangeWeapon(ItemPickUp weaponPickUp)
 {
     if (!characterDefinition.UnEquipWeapon(weaponPickUp, charInv, characterWeaponSlot))
     {
         characterDefinition.EquipWeapon(weaponPickUp, charInv, characterWeaponSlot);
     }
 }
Exemple #2
0
 public void ChangeWeapon(ItemPickUp weaponPickUp)
 {
     if (!CharacterDefinition.UnEquipWeapon(weaponPickUp, CharacterWeaponSlot))
     {
         CharacterDefinition.EquipWeapon(weaponPickUp, CharacterWeaponSlot);
         weaponPickUp.gameObject.SetActive(false); //Want to destroy it, but somehow it bugs destroy of the weapon in character hand
     }
 }
    // We are making use of the previously wrote Method UnEquipWeapon in CharacterStats_SO which is very smart

    // We need to check if the Current item we want to add is allready equiped and if it is we need to remove it.
    // To make room for a new GameObject.
    // We now have defined the characters Inventors and weaponSlot in the field region. And are to use them now!!!!!!!!!!!!
    // We dont need to pass them because this class has direct access to them wtf am i doing????

    // ChangeWeapon needs to be able to Equip and UnEquip weapons.
    #endregion
    public void ChangeWeapon(ItemPickUp weaponPickUp)
    {
        // Logic statement here!
        if (!charDefinition.UnEquipWeapon(weaponPickUp, charInv, charWeaponSlot))
        {
            charDefinition.EquipWeapon(weaponPickUp, charInv, charWeaponSlot);
        }
    }