///────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── /// <summary> /// Pistol Attack Mode /// </summary> protected virtual void PistolAttack() { if (isReloading) { return; } if (Gun.AmmoInChamber > 0) //If there's Ammo on the chamber { if (RC.WeaponAction == WeaponActions.Fire_Proyectile) { //Me falta interrumpir el mismo tiro } RC.SetAction(WeaponActions.Fire_Proyectile); //Set the Weapon Action to Fire Proyectile // RC.Anim.SetInteger(HashCombat.IDIntHash, -99); //Avoid to execute the Lower Attack Animation clip (HorseSyncAnimation) for the rider // RC.Anim.SetBool(HashCombat.attack1Hash, true); //Set Attack1 = True in the Animator Gun.FireProyectile(RC.AimRayCastHit); RC.OnAttack.Invoke(RC.Active_IMWeapon); //Invoke the On Attack Event currentFireRateTime = Time.time; } else { if (Time.time - currentFireRateTime > 0.5f) { Gun.PlaySound(4); //Play Empty Sound Which is stored in the 4 Slot currentFireRateTime = Time.time; } } }
/// <summary> Pistol Attack Mode</summary> protected virtual void PistolAttack() { if (isReloading) { return; } if (Gun.AmmoInChamber > 0) //If there's Ammo on the chamber { RC.WeaponAction = WA.Fire_Proyectile; //Set the Weapon Action to Fire Proyectile Let the Animator Know!!! Gun.FireProyectile(RC.Aimer.AimHit); RC.OnAttack.Invoke(RC.ActiveWeapon); //Invoke the On Attack Event currentFireRateTime = Time.time; } else { if (Time.time - currentFireRateTime > 0.5f) { Gun.PlaySound(4); //Play Empty Sound Which is stored in the 4 Slot currentFireRateTime = Time.time; } } }