Hi, i have some issue of lag spikes during the activation of some localized GameObjects. Thanks to profiler I found that the Localize component "relocalize" the GO on every Enable. I don't need this feature because, in my game, the language is set statically. To solve the problem I moved the contents of OnEnable of Localize script inside the Awake method. It seems to work properly. Now the question is, is there another solution? or this is just fine?
The administrator has disabled public write access.
Spike of cpu usage onLocalize
3 years 1 month ago #853
Thanks for pointing out that issue.
The solution you describe is ok as far as you don't switch languages in the game or you should reload the scene after changing the language.
To avoid that problem in future releases, I'm going to add a flag that sets whatever the localize component should "pre-load" on Awake or delay the localization until enabled. And always catch what language it has currently, so that once you localize, it doesn't get any lag on any future enable/disables as far the language is not changed. That way you should be able to enable and disable multiple times without lag.
I'm planning on releasing 2.6.0 b1 this weekend and will try to include this change there!
Hope that helps,
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!