final commit

This commit is contained in:
2022-04-29 21:55:55 +07:00
parent 4172fc94ba
commit e90826e5bb
10 changed files with 247 additions and 20 deletions

View File

@ -4,16 +4,23 @@ using UnityEngine;
public class DumbAI : MonoBehaviour
{
public Transform feetTransform;
// Start is called before the first frame update
[SerializeField]
private List<NavPoint> _aiPathRaw;
private Queue<NavPoint> _aiPath;
private int _nextPointId;
void Start()
{
var current_position = feetTransform.transform.position;
_aiPath = new Queue<NavPoint>(_aiPathRaw);
StepOnNavPoint();
}
// Update is called once per frame
void Update()
private void StepOnNavPoint()
{
if (_aiPath.Count != 0)
{
_nextPointId = _aiPath.Peek().PointId;
_aiPath.Dequeue();
}
}
}