23 lines
466 B
C#
23 lines
466 B
C#
using UnityEngine;
|
|
using RPG.Movement;
|
|
|
|
namespace RPG.Combat
|
|
{
|
|
public class Fighter : MonoBehaviour
|
|
{
|
|
Transform target;
|
|
private void Update()
|
|
{
|
|
if(target != null)
|
|
{
|
|
GetComponent<Mover>().MoveTo(target.position);
|
|
target = null;
|
|
}
|
|
}
|
|
public void Attack(CombatTarget combatTarget)
|
|
{
|
|
target = combatTarget.transform;
|
|
}
|
|
}
|
|
}
|