Spike of cpu usage onLocalize
9 years 5 months ago #852
by kung94
Spike of cpu usage onLocalize was created by kung94
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?
Please Log in or Create an account to join the conversation.
9 years 5 months ago #853
by Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
Replied by Frank on topic Spike of cpu usage onLocalize
Hi,
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,
Frank
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,
Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
To get the betas as soon as they are ready,
check this out
Please Log in or Create an account to join the conversation.
9 years 5 months ago #854
by kung94
Replied by kung94 on topic Spike of cpu usage onLocalize
Perfect. thanks for the answer
Please Log in or Create an account to join the conversation.
Time to create page: 0.146 seconds