Internally, it seems that UnityEvents are holding an instance of type ArgumentCache that performs this logic on serialization / deserialization:
View attachment 158999
When profiling, i see these generate GC allocations (all due to performing Regex replacements):
View attachment 159000
Generally, this should only happens *once* when displaying the object, but in our game, we have different scenes added and destroyed dynamically (happens many times during a play session), so...
UnityEvents are generating lots of garbage
View attachment 158999
When profiling, i see these generate GC allocations (all due to performing Regex replacements):
View attachment 159000
Generally, this should only happens *once* when displaying the object, but in our game, we have different scenes added and destroyed dynamically (happens many times during a play session), so...
UnityEvents are generating lots of garbage