Yay for performance!
One thing I’m not sure has been given much love is AddComponent and Destroy(Component).
GetComponent has likely already been super-polished by the performance team, but has AddComponent and Destroy(Component)?
Not all games can completely avoid the use of AddComponent. And while I make it a priority to never use it — because the performance hit is impressive — there are cases where I feel it would be advised to use AddComponent, rather than trying to work around it.
Take power-ups for instance — wouldn’t it be nice and easy to just add a new “PowerUp” component to the GameObject that touched the power-up, and the component would just perform the power-up’s effect on that GameObject? And what if that power-up was less of a power-up, and more of a unique attack or action?
That sounds like an ideal and simple way to solve what would have been a potentially complicated problem!
What if you had a large multiplayer survival game where “upgrading” yourself, specifically your abilities, was a key part to surviving? Shouldn’t it be viable to use AddComponent for these in-game upgrades?
Then… what if you had procedurally generated, AI-controlled enemies, too?
And what if everybody started out as a simple, procedurally generated player, to further lean on the mechanic?
All I’m saying is; it would be nice if AddComponent (and to a slightly lesser extent Destroy(Component)) would be viable solutions to these sorts of problems without you having to worry that it could come back and bite you down the road!
Right now, it feels like they aren’t viable solutions — simply because the performance hit is so large and they really don’t scale well for games that decide to go down that path.
I would love if AddComponent and Destroy(Component) were looked at!
P.S. Nobody go touting about ECS. I am aware of its existence, but I still feel like this should be addressed.
P.S.S. Alternatively, we could just push for .Net CoreCLR and solve the root of all our performance problems.
EDIT:
Yeah, I’m just realizing this thread was about EDITOR performance optimizations…
Ugh.