Answer the question
In order to leave comments, you need to log in
How to prevent the editor from calling "readonly static" while editing?
A bit of a tautology in the title.
Maybe someone in the know.
Let's say there is a script, it has static fields, for example:
readonly static string TEST = Localization.Localize("Test");
Answer the question
In order to leave comments, you need to log in
Can't be banned.
A simple option is to add a stub to the Localize method:
#if UNITY_EDITOR // Кода внутри этого #if не будет в собранной версии игры
if (isLocalizationInitialized == false)
return localicationKey;
#endif
see examples of localization plugins. in the same asset store.
this is a lousy way to cache - storing hardcode in static fields.
usually a localization plugin has a separate resource file. where are all localizations.
needed at the start pulled out. stuffed into the RAM / scene and use it.
this is caching itself. from the fact that you stuff all this into readonly static variables it will not get any better))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question