System that listens for Collision events and checks each of the involved Entities for a CollisionComponent. If either of the Entities is found to have a CollisionComponent, its onCollide member function is called with the two objects. The first parameter to onCollide is always the Entity to which the CollisionComponent is attached.
Whenever the OnCollision function Component is called, the CollisionSystem performs the following for each Entity involved in the collision:
- If the
Entityhas aCollisionComponent- Call
onCollision(go, other), withgoandotherbeing the references to the twoEntitiesinvolved.
- Call