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