/// <summary>Unequip Weapon from Holders or from Inventory (Called by the Animator)</summary> public virtual void Unequip_Weapon() { WeaponType = null; WeaponAction = WA.None; if (ActiveWeapon == null) { return; } if (debug) { Debug.Log($"Unequip Weapon Type: <b>{ActiveWeapon.WeaponType.name}</b>"); } ActiveWeapon.IsEquiped = false; //Let the weapon know that it has been unequiped OnUnequipWeapon.Invoke(ActiveWeaponGameObject); //Let the rider know that the weapon has been unequiped. if (UseHolders) //If Use Holders Parent the ActiveMWeapon the the Holder { ActiveWeaponGameObject.transform.parent = ActiveHolderTransform.transform; //Parent the weapon to his original holder StartCoroutine(SmoothWeaponTransition(ActiveWeaponGameObject.transform, Vector3.zero, Vector3.zero, 0.3f)); } else if (UseInventory && !AlreadyInstantiated && ActiveWeaponGameObject) { Destroy(ActiveWeaponGameObject); } ActiveWeaponGameObject = null; //IMPORTANT }
public void UnEquip_FAST() { if (Weapon == null) { return; } if (debug) { Debug.Log($"<b>{name}:<color=cyan> [FAST UNEQUIP -> {Weapon.Holster.name} -> {Weapon.name}]</color> </b>"); //Debug } ResetCombat(); // LastStoredWeaponHand = Weapon.IsRightHanded; OnUnequipWeapon.Invoke(Weapon.gameObject); //Let the rider know that the weapon has been unequiped. if (UseHolsters) //If Use holster Parent the ActiveMWeapon the the holster { Weapon.transform.parent = ActiveHolster.Transform; //Parent the weapon to his original holster Weapon.transform.SetLocalTransform(Weapon.HolsterOffset); //Set the Holster Offset Option } else if (UseInventory && !AlreadyInstantiated) { Destroy(Weapon.gameObject); } OnUnequipWeapon.Invoke(Weapon.gameObject); Weapon = null; //IMPORTANT }
///────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── /// <summary> /// Unequip Weapon from Holders or from Inventory /// </summary> public virtual void Unequip_Weapon() { _weaponType = WeaponType.None; SetAction(WeaponActions.Unequip); LinkAnimator(); if (Active_IMWeapon == null) { return; } if (debug) { Debug.Log("Unequip_Weapon"); } Active_IMWeapon.Unequiped(); //Let the weapon know that it has been unequiped OnUnequipWeapon.Invoke(ActiveWeapon); //Let the rider know that the weapon has been unequiped. if (UseHolders) //If Use Holders Parent the ActiveMWeapon the the Holder { ActiveWeapon.transform.parent = ActiveHolderTransform.transform; //Parent the weapon to his original holder StartCoroutine(SmoothWeaponTransition(ActiveWeapon.transform, Vector3.zero, Vector3.zero, 0.3f)); } else if (UseInventory && !AlreadyInstantiated && ActiveWeapon) { Destroy(ActiveWeapon); } activeWeapon = null; }
/// <summary>Unequip Weapon from holster or from Inventory (Called by the Animator)</summary> public virtual void Unequip_Weapon() { // if (!Active) return; ResetCombat(); if (Weapon == null) { return; } if (debug) { Debug.Log($"<b>{name}:<color=cyan> [Unequip -> {Weapon.name}]</color> </b>"); //Debug } OnUnequipWeapon.Invoke(Weapon.gameObject); //Let the rider know that the weapon has been unequiped. if (UseHolsters) //If Use holster Parent the ActiveMWeapon the the holster { Weapon.transform.parent = ActiveHolster.Transform; //Parent the weapon to his original holster StartCoroutine(MTools.AlignTransform(Weapon.transform, Weapon.HolsterOffset, HolsterTime)); } else if (!AlreadyInstantiated) { Destroy(Weapon.gameObject); } Weapon = null; //IMPORTANT }