2using System.Collections.Generic;
14 [SerializeField]
private ObjectMove _objectMove;
16 [SerializeField]
private bool _isDrive =
true;
18 [SerializeField]
private bool _isWait;
20 [SerializeField]
private bool _isRepeat =
true;
22 private List<Vector3> _points;
23 private Vector3 _currentPoint;
24 private int _pointIndex;
36 _wait =
Random.Range(1.0f, 5.0f);
42 _currentPoint = _points[0];
47 if (!_isDrive)
return;
51 _objectMove.
Move(_currentPoint);
54 private void OnEnable()
59 private void OnDisable()
66 #region PRIVATE_METHODS
68 private void WaitStart()
70 _wait -= Time.deltaTime;
72 if (_wait < 0) _isWait =
false;
75 private void GetNextPoint()
79 if (_pointIndex >= _points.Count - 1)
81 if (_pointIndex == _points.Count - 1)
88 _currentPoint = _points[0];
94 _currentPoint = _points[_pointIndex];
99 if (_pointIndex >= _points.Count - 1)
106 _currentPoint = _points[_pointIndex];
111 private void EndPath()
void Move(Vector3 currentPoint)
List< Vector3 > _curvePoints