Example #1
0
 private void Equip(Equipable equipable, Transform transform)
 {
     equipable.transform.parent        = transform;
     equipable.transform.localPosition = Vector3.zero;
     equipable.transform.localRotation = Quaternion.identity;
     equipable.OnEquip(this);
 }
Example #2
0
 public void Equip(Equipable equip, int skillIndex)
 {
     if (skillIndex > 4 || skillIndex < 0)
     {
         return;
     }
     //unequip previous skill if there was one
     if (skillSlots[skillIndex] != null)
     {
         skillSlots[skillIndex].OnUnequip(game, this);
     }
     //equip new skill
     skillSlots[skillIndex] = equip;
     equip.OnEquip(game, this);
 }
Example #3
0
 private void Equip(Equipable equipable, Vector3 positionOffset, Quaternion rotationOffset)
 {
     equipable.transform.localPosition = positionOffset;
     equipable.transform.localRotation = rotationOffset;
     equipable.OnEquip(this);
 }