public override void OnMove(GameObject player) { state = EnemyState.MOVE; animator.SetBool("movement", true); Vector2 vec = player.transform.position - transform.position; if (vec.x > 0) { controllerMovement.AddIntent(new Intent(Intent.Type.H_MOVE_RIGHT)); } else { controllerMovement.AddIntent(new Intent(Intent.Type.H_MOVE_LEFT)); } }
public override void OnMove(GameObject player) { if (state == EnemyState.ATACK || state == EnemyState.NONE) { return; } animator.SetBool("isMov", true); Vector2 vec = player.transform.position - transform.position; if (vec.x > 0) { controllerMovement.AddIntent(new Intent(Intent.Type.H_MOVE_RIGHT)); } else { controllerMovement.AddIntent(new Intent(Intent.Type.H_MOVE_LEFT)); } }