Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/extrys/unitycollisioncomputer
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.
https://github.com/extrys/unitycollisioncomputer
data-oriented-technology-stack dots jobs optimization performance physical-computing physics unity unity-package unity3d unity3d-plugin
Last synced: 4 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/extrys/unitycollisioncomputer
- Owner: Extrys
- Created: 2024-07-17T23:11:31.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-08-16T10:48:23.000Z (6 months ago)
- Last Synced: 2024-10-10T10:04:53.328Z (4 months ago)
- Topics: data-oriented-technology-stack, dots, jobs, optimization, performance, physical-computing, physics, unity, unity-package, unity3d, unity3d-plugin
- Language: C#
- Homepage:
- Size: 46.9 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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.