public AttackController DoAttack(string name) { AttackController spawnedAttack = Instantiate(this.attack, this.transform).GetComponent <AttackController>(); spawnedAttack.isAerial = false; spawnedAttack.SetAttack(FindAttack(name)); attacking = true; return(spawnedAttack); }
// ------------------------------------------------- // Attacks // ------------------------------------------------- public void CheckAttack() { attackMachine.Update(grounded, CheckAttacking()); if (attackMachine.Attacking) { attacking = true; GetComponent <AudioSource>().Play(); AttackController spawnedAttack = Instantiate(attack, transform).GetComponent <AttackController>(); spawnedAttack.isAerial = attackMachine.IsAerial; spawnedAttack.SetAttack(attackMachine.CurrentAttack); } }
public bool Attack(HealthController target, AttackObject attack) { attackController.SetTarget(target); attackController.SetAttack(attack); return(attackController.TryDoAction()); }