public AddCollision ( |
||
other | The CollisionUnit that was collided with. | |
Résultat | void |
public void AddCollision(CollisionUnit other)
{
if (!mCollisions.Contains(other))
{
mCollisions.Add(other);
bCollisionsChanged = true;
if (!bHasCollisions)
{
bHasCollisions = true;
}
}
}
/// <summary> /// Update the collision status between this and the <paramref name="other"/> CollisionUnit. /// </summary> /// <param name="other">The CollisionUnit to update.</param> public void UpdateCollisionsWith(CollisionUnit other) { if (CollidesWith(other)) { AddCollision(other); other.AddCollision(this); } else { RemoveCollision(other); other.RemoveCollision(this); } }