Plugin to control collider communication between child and parent scripts.
iTriggerEnter.cs
iTriggerExit.cs
TriggerEnterMessage.cs
TriggerExitMessage.cs
- Impliment any collider interfaces you need on the scipt that you require. (iTriggerEnter or iTriggerExit)
public class AIController : MonoBehaviour, iTriggerEnter
{
public void TriggerEnter(Collider col)
{
Debug.Log(col);
}
}
public class AIController : MonoBehaviour, iTriggerExit
{
public void TriggerExit(Collider col)
{
Debug.Log(col);
}
}
public class AIController : MonoBehaviour, iTriggerEnter, iTriggerExit
{
public void TriggerEnter(Collider col)
{
Debug.Log(col);
}
public void TriggerExit(Collider col)
{
Debug.Log(col);
}
}
-
Drag the corresponding Trigger[TYPE]Message.cs script onto the child component you want to check for collider. E.g. your SoundDetectorGameObject.
-
Drag your implimented script (AIController.cs) onto the Component variable on your child (SoundDetectorGameObject)