Start AI COntroller
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
using RPG.Combat;
|
||||
using RPG.Core;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace RPG.Movement
|
||||
{
|
||||
public class Mover : MonoBehaviour
|
||||
public class Mover : MonoBehaviour, IAction
|
||||
{
|
||||
[SerializeField] private Transform target;
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace RPG.Movement
|
||||
}
|
||||
public void StartMoveAction(Vector3 destination)
|
||||
{
|
||||
GetComponent<Fighter>().Cancel();
|
||||
GetComponent<ActionScheduler>().StartAction(this);
|
||||
MoveTo(destination);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace RPG.Movement
|
||||
navMeshAgent.destination = destination;
|
||||
navMeshAgent.isStopped = false;
|
||||
}
|
||||
public void Stop()
|
||||
public void Cancel()
|
||||
{
|
||||
navMeshAgent.isStopped = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user