Bug in EditorTools - DrawEventCallBack()
10 years 10 months ago #127
by Jos
Bug in EditorTools - DrawEventCallBack() was created by Jos
I'm trying to get the "On Localize Call" bits of the Localize component to work correctly. It seems that the event, when sent, does include a reference to the component itself, however, the DrawEventCallBack() method only lists methods with no arguments, thus you can never actually receive the Localize component via the callback, and programatically actually do something with that text. Also, since the callback is called before the TextMesh's (in my case) .text value is updated, so i can't get the translated text that way either.
Suggestions? Is this an error?
Thanks
Jos
Suggestions? Is this an error?
Thanks
Jos
Please Log in or Create an account to join the conversation.
10 years 10 months ago - 10 years 10 months ago #128
by Frank
Are you
Give I2L
5 stars!
Are you
Please lets us know how to improve it!
Replied by Frank on topic Bug in EditorTools - DrawEventCallBack()
Hi,
Version (2.1.0 b3) fixes the bug regarding methods accepting 1 argument not been selectable in the EventCallBack.
That will allow you to get the Localize component passed as a parameter.
Nonetheless, the Localization Call Back should use temporal translations on the static variables:
In Assets\I2\Localization\Examples\Common\Scripts\CallbackNotification.cs you can find an example on how to modify those values:
When the Localize component is translating a text, it stores the translations in the Localize.MainTranslation and Localize.SecondaryTranslation so that they can be modified by the callback.
Version (2.1.0 b3) fixes the bug regarding methods accepting 1 argument not been selectable in the EventCallBack.
That will allow you to get the Localize component passed as a parameter.
Nonetheless, the Localization Call Back should use temporal translations on the static variables:
Localize.MainTranslation and Localize.SecondaryTranslation;
In Assets\I2\Localization\Examples\Common\Scripts\CallbackNotification.cs you can find an example on how to modify those values:
public void OnModifyLocalization()
{
if (string.IsNullOrEmpty(Localize.MainTranslation))
return;
string PlayerColor = LocalizationManager.GetTermTranslation( "Color/Red" );
Localize.MainTranslation = Localize.MainTranslation.Replace("{PLAYER_COLOR}", PlayerColor);
}
When the Localize component is translating a text, it stores the translations in the Localize.MainTranslation and Localize.SecondaryTranslation so that they can be modified by the callback.
Are you

Are you

To get the betas as soon as they are ready,
check this out
Last edit: 10 years 10 months ago by Frank.
Please Log in or Create an account to join the conversation.
10 years 10 months ago #129
by Jos
Replied by Jos on topic Bug in EditorTools - DrawEventCallBack()
Ah, ok, great - that will let me move forward!
Thanks
Jos
Thanks
Jos
Please Log in or Create an account to join the conversation.
Time to create page: 0.167 seconds