Simple, collision system for unity. It is simple, fast, easy to use. For custom purposes.
Simple, collision system for unity. It is simple, fast, easy to use. For custom purposes.
- Add "Collision Box" to your character. You can add as child.
- Add this script to your class:
public CollisionBox collisionBox;
// -----------------------------------------------------------------------
public void OnEnable()
{
collisionBox.collisionStart += collisionStart;
collisionBox.collisionEnd += collisionEnd;
}
// -----------------------------------------------------------------------
public void OnDisable()
{
collisionBox.collisionStart -= collisionStart;
collisionBox.collisionEnd -= collisionEnd;
}
// -----------------------------------------------------------------------
public void collisionStart(CollisionBox box)
{
Debug.Log("I'm collided with : " + box.name);
}
// -----------------------------------------------------------------------
public void collisionEnd(CollisionBox box)
{
Debug.Log("I'm not collided with : " + box.name + " anymore");
}
- And ta da! You are ready to go!
I'm gonna add new collision types like sphere etc. I will add editor handles to edit more efficient.