Welcome, Guest
Username: Password: Remember me

TOPIC: Spike of cpu usage onLocalize

Spike of cpu usage onLocalize 3 years 3 months ago #852

  • kung94
  • kung94's Avatar
  • Offline
  • New Member
  • Posts: 2
  • Karma: 0
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 3 months ago #853

  • Frank
  • Frank's Avatar
  • Online
  • Administrator
  • Posts: 1129
  • Thank you received: 241
  • Karma: 70
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
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
The administrator has disabled public write access.

Spike of cpu usage onLocalize 3 years 3 months ago #854

  • kung94
  • kung94's Avatar
  • Offline
  • New Member
  • Posts: 2
  • Karma: 0
Perfect. thanks for the answer :)
The administrator has disabled public write access.
Time to create page: 0.208 seconds
Colors