public static PathfindingMarker CreateInstance(string markerName, ref PathfindingGrid grid) { var newMarker = new GameObject(markerName).AddComponent <PathfindingMarker>(); newMarker.grid = grid; grid.markers.Add(newMarker); return(newMarker); }
public static PathfindingMarker CreateInstance(string markerName, PathfindingGrid grid, Vector3 markerPos, Transform parent, float creationYPosAboveFloor) { var newMarker = new GameObject(markerName).AddComponent <PathfindingMarker>(); newMarker.transform.position = markerPos; newMarker.transform.SetParent(parent); newMarker.creationHeightAboveFloor = creationYPosAboveFloor; newMarker.Inject(grid); grid.markers.Add(newMarker); return(newMarker); }
private void Inject(PathfindingGrid currGrid) { grid = currGrid; }