MovementKit
Loading...
Searching...
No Matches
RiverExplorer.CollisionControl Class Reference
Inheritance diagram for RiverExplorer.CollisionControl:
Collaboration diagram for RiverExplorer.CollisionControl:

Public Member Functions

override void ActOnCollision (Collision CollidedWith, Rigidbody CollieddWithRb)
 

Private Member Functions

void OnCollisionEnter (Collision CollidedWith)
 

Private Attributes

bool DetectByRigidBody = false
 
WhoHitWhat[] HitMatrix
 
Rigidbody OthersRigidBody
 

Detailed Description

Collision control is the code that is Unique to the Game. It is initialized by the reusable object ObjectsColliding.

Member Function Documentation

◆ 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
CollidedWithThe object that was collided with. the CollidedWith value is supplied by the system from ObjectColliding.cs
CollieddWithRbThe 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
Here is the call graph for this function:

Member Data Documentation

◆ 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: