Beispiel #1
0
        /// <summary>
        /// Called by Unity.
        /// Can be overriden but be sure to call base.Start() to allow the agent to initialize properly.
        /// </summary>
        public virtual void Start()
        {
            // CHeck if we have a grid
            if (searchGrid == null)
            {
                // Try to access a default grid
                searchGrid = AStarGridManager.DefaultGrid;

                // Check for error
                if (searchGrid == null)
                {
                    // Print a warning
                    Debug.LogWarning(string.Format("Agent [{0}]: The are no AStar Grids in the scene. Pathfinding is not possible", gameObject.name));
                }
            }
        }
Beispiel #2
0
 internal static void unregisterGrid(AStarAbstractGrid grid)
 {
     // Remove the grid from the list
     activeGrids.Remove(grid);
 }
Beispiel #3
0
 // Methods
 internal static void registerGrid(AStarAbstractGrid grid)
 {
     // Add the grid to the active grids
     activeGrids.Add(grid);
 }