Add project files.
This commit is contained in:
22
Assets/Scripts/Combat/Fighter.cs
Normal file
22
Assets/Scripts/Combat/Fighter.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user