scripts 1 var
This commit is contained in:
1 parent
6df424ea8e
commit
1798ac3fc5
10 files changed
+364
No files matched your search
@@ -0,0 +1,24 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class PathFollower : Seek
|
||||
{
|
||||
public Path path;
|
||||
public float pathOffset = 0.0f;
|
||||
float currentParam;
|
||||
|
||||
public override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
target = new GameObject();
|
||||
currentParam = 0f;
|
||||
}
|
||||
|
||||
public override Steering GetSteering()
|
||||
{
|
||||
currentParam = path.GetParam(transform.position, currentParam);
|
||||
float targetParam = currentParam + pathOffset;
|
||||
target.transform.position = path.GetPosition(targetParam);
|
||||
return base.GetSteering();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user