Skip to content

Makes use of Unity's Physics API, and it's used to handle custom collision events in a more efficient way than Unity's default collision events.

Notifications You must be signed in to change notification settings

Extrys/UnityCollisionComputer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

The problem: Unity's OnCollisionEnter and OnCollisionExit are executed per instance, and when 2 objects collide, both objects execute the event, causing duplicated events. It makes harder to handle things like particles, sounds, or any other effect that should be executed only once per collision.

This code is working with Unity's Physics API, and it's used to handle custom collision events in a more efficient way than Unity's default collision events.
The whole file contains all needed code to make it work just implement ICustomCollisionListener interface in your class and use StartListenCollisions and StopListenCollisions extension methods to start and stop listening to collisions. it requires a Rigidbody reference in each listener for now.

About

Makes use of Unity's Physics API, and it's used to handle custom collision events in a more efficient way than Unity's default collision events.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages