Beispiel #1
0
 public void Inintialize(GameObject go, float speed)
 {
     rigidbody     = go.GetComponent <Rigidbody>();
     movementSpeed = speed;
     path          = null;
     FastPath.FastPath.DefaultMap.OnUpdate += () => { FindPath(); };
 }
Beispiel #2
0
 private void FindPath()
 {
     if (destination == Vector3.zero)
     {
         Debug.Log("FindPath vector zero");
         return;
     }
     path         = new FastPath.Path(rigidbody.position, destination);
     currentIndex = 1;
 }
Beispiel #3
0
 public void Stop()
 {
     destination = Vector3.zero;
     path        = null;
 }