Exemple #1
0
        public static PathView findViewForGrid(AStarGrid grid)
        {
            // Find all components
            foreach (PathView view in Component.FindObjectsOfType <PathView>())
            {
                // Check for observed grid
                if (view.visualizeGrid == grid)
                {
                    // Get the component
                    return(view);
                }
            }

            // Not found
            return(null);
        }
Exemple #2
0
        public static void setRenderPath(AStarGrid grid, Path path)
        {
            if (!Application.isEditor)
            {
                return;
            }
            // Make sure the path is valid
            if (path == null)
            {
                return;
            }

            // Find the component
            PathView view = findViewForGrid(grid);

            // Check for error
            if (view == null)
            {
                return;
            }

            // Udpate the render path
            view.setRenderPath(path);
        }
 internal static void UnregisterGrid(AStarGrid grid)
 {
     // Remove the grid from the list
     activeGrids.Remove(grid);
 }
 // Methods
 internal static void RegisterGrid(AStarGrid grid)
 {
     // Add the grid to the active grids
     activeGrids.Add(grid);
 }
Exemple #5
0
 private void Awake()
 {
     visualizeGrid = GetComponent <AStarGrid>();
 }