kirill loh
This commit is contained in:
@ -6,12 +6,12 @@ using UnityEngine.AI;
|
||||
[RequireComponent(typeof(NavMeshAgent))]
|
||||
public class MovementController : MonoBehaviour
|
||||
{
|
||||
public NavPoint currentPosition { get; private set; }
|
||||
public NavPoint currentPosition { get; set; }
|
||||
[SerializeField] private NavMeshAgent navMeshAgent;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
navMeshAgent.speed = SettingsReader.Instance.GetSettings.movementSpeed;
|
||||
navMeshAgent.speed = SettingsReader.Instance.GetSettings.movementSpeed;
|
||||
}
|
||||
|
||||
public void MoveToRandomPoint()
|
||||
@ -23,7 +23,7 @@ public class MovementController : MonoBehaviour
|
||||
public List<NavPoint> getPointsCandidate()
|
||||
{
|
||||
return MapManager.navPoints
|
||||
.Where(point => (currentPosition.position - point.position).magnitude <= SettingsReader.Instance.GetSettings.movementSpeed)
|
||||
.Where(point => (currentPosition.position - point.position).magnitude < SettingsReader.Instance.GetSettings.movementSpeed)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user