Greetings,
I have a class with a GameObject variable. The class doesn’t inherit from any other class. The GameObject has a a Rigidbody and a BoxCollider components.
public class Example {
private GameObject gameObject;
public Example () {
// init gameObject
// add Rigidbody
// add BoxCollider
}
// How can I detect OnCollisionEnter in this class?
}
Is there any way of detecting OnCollisionEnter in this class; because the class doesn’t inherit from MonoBehaviour, I am not sure how to do it.
Appreciate your help.
Thank you,
Jude