예제 #1
0
    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);
    }
예제 #2
0
    // -------------------------------------------------
    // 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);
        }
    }
예제 #3
0
 public bool Attack(HealthController target, AttackObject attack)
 {
     attackController.SetTarget(target);
     attackController.SetAttack(attack);
     return(attackController.TryDoAction());
 }