Files
real-shooter/Assets/Scripts/Character/DumbAI.cs
2022-04-29 21:55:55 +07:00

27 lines
543 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DumbAI : MonoBehaviour
{
[SerializeField]
private List<NavPoint> _aiPathRaw;
private Queue<NavPoint> _aiPath;
private int _nextPointId;
void Start()
{
_aiPath = new Queue<NavPoint>(_aiPathRaw);
StepOnNavPoint();
}
private void StepOnNavPoint()
{
if (_aiPath.Count != 0)
{
_nextPointId = _aiPath.Peek().PointId;
_aiPath.Dequeue();
}
}
}