Welcome, Guest
Username: Password: Remember me

TOPIC: "On Localize Call" without target

"On Localize Call" without target 4 years 10 months ago #126

  • Multiplayer
  • Multiplayer's Avatar
Hi

I would like to use the localize scripts "On Localize Call" to call my own script whenever language is changed, since I use none of the pre-implemented components such as NGUI or TextMesh.

But it seems like there is no message sent unless something is selected as a target (other than "none") for the localize script, even if I do not need the script to do anything by itself. Everything works if i simply add a component like GuiText and set it as the target. I can then disable that component and my script gets called anyway. But it would of course be much better if I did not have to do that.

Is there a way to use only the "On Localize Call" without using any other components?
The administrator has disabled public write access.

"On Localize Call" without target 4 years 9 months ago #131

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1206
  • Thank you received: 256
  • Karma: 78
Hi,

I just added an event that gets called whenever the language is changed. (Version 2.1.0 b3)

There is no longer need to add a Localize component to an object in order receive a call, just register the function that will handle the custom localization.
void Start()
{
	LocalizationManager.OnLocalizeEvent += CustomLocalization;
}

public static void CustomLocalization()
{
	// This function gets called whenever the language is changed
}

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.

"On Localize Call" without target 4 years 9 months ago #132

  • Multiplayer
  • Multiplayer's Avatar
Thanks a lot for the quick change, that should do it.

I will send you an email to get access to the newest version.
The administrator has disabled public write access.
Time to create page: 0.104 seconds
Template by JoomlaShine