Esempio n. 1
0
 /// <summary>
 /// Request all unmanaged resources controlled by the object be
 /// immediately freed and the object marked as disposed.
 /// </summary>
 /// <remarks>
 /// <para>
 /// If the object was created using a public constructor the resources will be freed
 /// immediately.
 /// </para>
 /// </remarks>
 public override void RequestDisposal()
 {
     // Note: There is no external unmanaged allocation.
     if (root != IntPtr.Zero && ResourceType == AllocType.Local)
     {
         NavmeshQueryFilterEx.dtqfFree(root);
     }
     root = IntPtr.Zero;
 }
Esempio n. 2
0
 /// <summary>
 /// The traversal cost for each area, indexed by area.
 /// [Default: <see cref="DefaultAreaCost"/>]
 /// </summary>
 /// <param name="index">The area.</param>
 /// <returns>The traversal cost of the area.</returns>
 public float this[int index]
 {
     get { return(NavmeshQueryFilterEx.dtqfGetAreaCost(root, index)); }
     set { NavmeshQueryFilterEx.dtqfSetAreaCost(root, index, value); }
 }
Esempio n. 3
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="areaCount">The number of used areas.</param>
 public NavmeshQueryFilter(int areaCount)
     : base(AllocType.Local)
 {
     root       = NavmeshQueryFilterEx.dtqfAlloc();
     mAreaCount = Math.Min(Navmesh.MaxArea + 1, mAreaCount);
 }
Esempio n. 4
0
 /// <summary>
 /// Constructor for a filter with the maximum number of areas.
 /// (<see cref="Navmesh.MaxArea"/> + 1)
 /// </summary>
 public NavmeshQueryFilter()
     : base(AllocType.Local)
 {
     root       = NavmeshQueryFilterEx.dtqfAlloc();
     mAreaCount = Navmesh.MaxArea + 1;
 }