lab3
This commit is contained in:
1 parent
a70076ebe9
commit
854835878c
20 files changed
+2542
No files matched your search
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user