Exemple #1
0
        // PRIVATE METHODS: ----------------------------------------------------

        private void ShootGeneric(CharacterShooter shooter, float deviation,
                                  CharacterShooter.ShotType shotType)
        {
            shooter.UpdateShootFireRate(this.ammoID);
            shooter.PlayAudio(this.audioShoot);

            if (this.animationShoot && shooter.animator != null)
            {
                shooter.animator.CrossFadeGesture(
                    this.animationShoot, 1f,
                    this.maskShoot,
                    0.05f, 0.2f
                    );
            }

            if (this.prefabMuzzleFlash)
            {
                GameObject muzzleInstance = PoolManager.Instance.Pick(this.prefabMuzzleFlash);
                muzzleInstance.transform.SetPositionAndRotation(
                    shooter.muzzle.GetPosition(),
                    shooter.muzzle.GetRotation()
                    );
            }

            if (this.delay < 0.01f)
            {
                this.ShootSelection(shooter, deviation, shotType);
            }
            else
            {
                CoroutinesManager.Instance.StartCoroutine(
                    this.ShootSelectionDelayed(shooter, deviation, shotType)
                    );
            }
        }