/// <summary> /// Stop the gun firing animation and allow the player to fire again /// </summary> /// <param name="playSpeed">The time to keep the gun animation playing</param> /// <returns></returns> private IEnumerator StopShoot(float playSpeed) { yield return(new WaitForSeconds(playSpeed)); if (_weaponAnimate != null) { Vector3 newPos = new Vector3(_playerWeapon.transform.localPosition.x, _playerWeapon.transform.localPosition.y - _adjustWeapon, _playerWeapon.transform.localPosition.z + _adjustWeapon); _playerWeapon.transform.localPosition = newPos; _weaponAnimate.PlayIdleAnim(); } _shooting = false; }