I've made optimizations on some low bearing fruit:
raycast call was corrected to use contact filter
bouncing calculation was fixed (for single bounce per frame, multiple bounces from a single bullet in a single frame won't work)
ProjectileManager.Instance call was cached cause the null check hit the performance hard
Dictionary and List lookups in ProjectileManager were optimized (cached the last looked up type)
This gave me about a 40% performance improvement on my machine, the biggest factor being the raycast call. In the initial attempt I made there were further optimizations done by not calling find on all emitters each frame. I wasn't satisfied with the solution proposed so I left it out here.
I've made optimizations on some low bearing fruit:
This gave me about a 40% performance improvement on my machine, the biggest factor being the raycast call. In the initial attempt I made there were further optimizations done by not calling find on all emitters each frame. I wasn't satisfied with the solution proposed so I left it out here.