/// <inheritdoc /> public void Execute() { for (int i = 0; i < ItemList.Length; i++) { SpatialHash.Remove(ItemList[i].SpatialHashingIndex); } }
public void SpatialHashRemove() { SpatialHash <Item> sh = new SpatialHash <Item>(new Bounds(new float3(15F), new float3(30F)), new float3(1F), 15, Allocator.Temp); var item = new Item { Center = new float3(5.5F), Size = new float3(1.1F) }; sh.Add(ref item); Assert.AreEqual(1, sh.ItemCount); Assert.AreEqual(3 * 3 * 3, sh.BucketItemCount); sh.Remove(item.SpatialHashingIndex); Assert.AreEqual(0, sh.ItemCount); Assert.AreEqual(0, sh.BucketItemCount); sh.Dispose(); }
/// <summary> /// removes the collider from the physics system /// </summary> /// <returns>The collider.</returns> /// <param name="collider">Collider.</param> public static void RemoveCollider(Collider collider) { _spatialHash.Remove(collider); }
public void RemoveLandParcel(LandParcel land) { landParcelSet.Remove(land); landParcelHash.Remove(land, land.bounds); }
void OnDestroy() { hash.Remove(this.gameObject); }