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); }
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); }
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); }