Beispiel #1
0
 private void ProcessorOnColliderRemoved(StaticColliderComponent component, StaticColliderData data)
 {
     builder.Remove(data);
     if (AutomaticRebuild)
     {
         pendingRebuild = true;
     }
 }
Beispiel #2
0
 /// <summary>
 /// Removes a specific collider from the builder
 /// </summary>
 /// <param name="colliderData">The collider data object to remove</param>
 public void Remove(StaticColliderData colliderData)
 {
     lock (colliders)
     {
         if (!registeredGuids.Contains(colliderData.Component.Id))
         {
             throw new InvalidOperationException("Trying to remove unregistered collider");
         }
         colliders.Remove(colliderData);
         registeredGuids.Remove(colliderData.Component.Id);
     }
 }
Beispiel #3
0
 /// <summary>
 /// Adds information about a collider to this builder
 /// </summary>
 /// <remarks>
 /// You can only register a single <see cref="StaticColliderComponent"/> once
 /// </remarks>
 /// <exception cref="InvalidOperationException">When trying to register collider data with the same <see cref="StaticColliderComponent"/> twice</exception>
 /// <param name="colliderData">A collider data object to add</param>
 public void Add(StaticColliderData colliderData)
 {
     lock (colliders)
     {
         if (registeredGuids.Contains(colliderData.Component.Id))
         {
             throw new InvalidOperationException("Duplicate collider added");
         }
         colliders.Add(colliderData);
         registeredGuids.Add(colliderData.Component.Id);
     }
 }