Esempio n. 1
0
 public NodeHasher(AstarPath active)
 {
     hasher                = default;
     this.debugData        = active.debugPathData;
     includePathSearchInfo = debugData != null && (active.debugMode == GraphDebugMode.F || active.debugMode == GraphDebugMode.G || active.debugMode == GraphDebugMode.H || active.showSearchTree);
     includeAreaInfo       = active.debugMode == GraphDebugMode.Areas;
     hasher.Add(active.debugMode);
     hasher.Add(active.debugFloor);
     hasher.Add(active.debugRoof);
     hasher.Add(AstarColor.ColorHash());
 }
Esempio n. 2
0
 public void Init(AstarPath active, DrawingData.Hasher hasher, DrawingData gizmos, RedrawScope redrawScope)
 {
     if (active != null)
     {
         debugData      = active.debugPathData;
         debugPathID    = active.debugPathID;
         debugMode      = active.debugMode;
         debugFloor     = active.debugFloor;
         debugRoof      = active.debugRoof;
         showSearchTree = active.showSearchTree && debugData != null;
     }
     this.hasher = hasher;
     builder     = gizmos.GetBuilder(hasher, redrawScope);
 }
Esempio n. 3
0
 /// <summary>
 /// Get an empty builder for queuing drawing commands.
 /// TODO: Example usage.
 ///
 /// See: <see cref="Drawing.CommandBuilder"/>
 /// </summary>
 /// <param name="hasher">Hash of whatever inputs you used to generate the drawing data.</param>
 /// <param name="redrawScope">Scope for this command builder. See #GetRedrawScope.</param>
 /// <param name="renderInGame">If true, this builder will be rendered in standalone games and in the editor even if gizmos are disabled.</param>
 public static CommandBuilder GetBuilder(DrawingData.Hasher hasher, RedrawScope redrawScope = default, bool renderInGame = false)
 {
     return(instance.gizmos.GetBuilder(hasher, redrawScope, renderInGame));
 }
Esempio n. 4
0
        public static GraphGizmoHelper GetGizmoHelper(DrawingData gizmos, AstarPath active, DrawingData.Hasher hasher, RedrawScope redrawScope)
        {
            var helper = ObjectPool <GraphGizmoHelper> .Claim();

            helper.Init(active, hasher, gizmos, redrawScope);
            return(helper);
        }