public List <Vector2> SetNewPath(Vector3 newDest) { List <Vector2> p; Vector3 newDestCenterPos = CenterPosition(newDest); Vector3 currCenterPos = CenterPosition(transform.position); currDestCenterPosition = newDestCenterPos; ClearPathMarker(); objPosPair = new Dictionary <Vector2, GameObject>(); p = JumpPointSearch.SearchPath(currCenterPos, newDestCenterPos); DrawPath(p); return(p); }
void Start() { Vector3 sourceCenterPosition = CenterPosition(transform.position); currDestCenterPosition = CenterPosition(bush.transform.position); if (path == null || path.Count == 0) { path = JumpPointSearch.SearchPath(sourceCenterPosition, currDestCenterPosition); DrawPath(path); } lastDestCenterPosition = currDestCenterPosition; }