|
override void | ActOnCollision (Collision CollidedWith, Rigidbody CollieddWithRb) |
|
Collision control is the code that is Unique to the Game. It is initialized by the reusable object ObjectsColliding.
◆ ActOnCollision()
override void RiverExplorer.CollisionControl.ActOnCollision |
( |
Collision | CollidedWith, |
|
|
Rigidbody | CollieddWithRb ) |
|
inline |
Something collided with something. Generally, I attach the CollisionControl component to the object that is moving only. If I attached it to both the moving object and the non-moving object, then it would be called twice, once for each object.
- Parameters
-
CollidedWith | The object that was collided with. the CollidedWith value is supplied by the system from ObjectColliding.cs |
CollieddWithRb | The Rigidbody of the the object collided with. Might be null. We only care about this when DetectByRigidBody is true. |
- Note
- The other object might not have a RigidBody, so CollieddWithRb may be null.
Check all of the tag names we care about to see if they match.
If the CollidedWith tag name is in the list of tags we care about.
If we are supposed to check if they have a rigid body, and they have one. Or if we are not supposed to check if they have a rigid body.
It matched a tag name we care about. Now see if we need to play a sound.
If we have a user defined function to call when we hit something.
◆ OnCollisionEnter()
void RiverExplorer.ObjectsColliding.OnCollisionEnter |
( |
Collision | CollidedWith | ) |
|
|
inlineprivateinherited |
◆ DetectByRigidBody
bool RiverExplorer.CollisionControl.DetectByRigidBody = false |
|
private |
◆ HitMatrix
WhoHitWhat [] RiverExplorer.CollisionControl.HitMatrix |
|
private |
◆ OthersRigidBody
Rigidbody RiverExplorer.ObjectsColliding.OthersRigidBody |
|
privateinherited |
The other objects rigidbody. It might not have one.
The documentation for this class was generated from the following file:
- G:/Unity/AssetStoreProjects/MovementKit/Assets/RiverExplorer/PlayerControl/Scripts/CollisionControl.cs