Just wondering, if I implement the check before accessing AttackBehavior (shown below) is that going to cause any issues? I feel like it’s saving a bit of resources by performing the check before accessing the method. Just curious, thank you!
else
{
GetComponent<Mover>().Cancel();
if (timeSinceLastAttack > timeBetweenAttacks)
{
AttackBehavior();
}
}
}
private void AttackBehavior()
{
GetComponent<Animator>().SetTrigger("isAttacking");
timeSinceLastAttack = 0;
}