This commit is contained in:
MrTorex committed 2026-02-10 12:35:10 +03:00
1 parent a70076ebe9
commit 854835878c
20 files changed
+2542

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
using Code.Base;
using Code.Lab1;
using UnityEngine;
namespace Code.Lab3
{
public class PathFollower : Seek
{
public Path path;
public float pathOffset;
private float _currentParam;
public override void Awake()
{
base.Awake();
target = new GameObject();
_currentParam = 0;
}
public override Steering GetSteering()
{
_currentParam = path.GetParam(transform.position, _currentParam);
var targetParam = _currentParam + pathOffset;
target.transform.position = path.GetPosition(targetParam);
return base.GetSteering();
}
}
}