Exemple #1
0
        public override IEnumerator Execute(GameObject target, IAction[] actions, int index)
        {
            CharacterShooter charShooter = this.shooter.GetComponent <CharacterShooter>(target);

            if (charShooter != null)
            {
                yield return(charShooter.Reload());
            }

            yield return(0);
        }
Exemple #2
0
        public override bool InstantExecute(GameObject target, IAction[] actions, int index)
        {
            if (this.waitTillComplete)
            {
                return(false);
            }

            CharacterShooter charShooter = this.shooter.GetComponent <CharacterShooter>(target);

            if (charShooter)
            {
                CoroutinesManager.Instance.StartCoroutine(charShooter.Reload());
            }

            return(true);
        }
Exemple #3
0
        private bool ClipRequirements(CharacterShooter shooter, bool subtract)
        {
            if (shooter.GetAmmoInClip(this.ammoID) > 0)
            {
                if (subtract)
                {
                    shooter.AddAmmoToClip(this.ammoID, -1);
                }
                return(true);
            }

            if (shooter.GetAmmoInStorage(this.ammoID) > 0 && this.autoReload)
            {
                shooter.StartCoroutine(shooter.Reload());
            }
            else
            {
                shooter.PlayAudio(this.audioEmpty);
            }

            return(false);
        }