예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
 private void Inject(PathfindingGrid currGrid)
 {
     grid = currGrid;
 }