Пример #1
0
 /// <inheritdoc />
 public void Execute()
 {
     for (int i = 0; i < ItemList.Length; i++)
     {
         SpatialHash.Remove(ItemList[i].SpatialHashingIndex);
     }
 }
Пример #2
0
        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();
        }
Пример #3
0
 /// <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);
 }
Пример #4
0
 public void RemoveLandParcel(LandParcel land)
 {
     landParcelSet.Remove(land);
     landParcelHash.Remove(land, land.bounds);
 }
Пример #5
0
 void OnDestroy()
 {
     hash.Remove(this.gameObject);
 }