void OnEnable() { mLocalize = (Localize)target; mProp_mTerm = serializedObject.FindProperty("mTerm"); mProp_mTermSecondary = serializedObject.FindProperty("mTermSecondary"); mProp_TranslatedObjects = serializedObject.FindProperty("TranslatedObjects"); mProp_IgnoreRTL = serializedObject.FindProperty("IgnoreRTL"); mProp_MaxCharactersInRTL = serializedObject.FindProperty("MaxCharactersInRTL"); mProp_CorrectAlignmentForRTL = serializedObject.FindProperty("CorrectAlignmentForRTL"); mProp_LocalizeOnAwake = serializedObject.FindProperty("LocalizeOnAwake"); if (LocalizationManager.Sources.Count == 0) { LocalizationManager.UpdateSources(); } //LocalizationEditor.ParseTerms (true); mGUI_ShowReferences = (mLocalize.TranslatedObjects != null && mLocalize.TranslatedObjects.Length > 0); mGUI_ShowCallback = (mLocalize.LocalizeCallBack.Target != null); mGUI_ShowTems = true; LocalizationEditor.mKeysDesc_AllowEdit = false; GUI_SelectedTerm = 0; mNewKeyName = mLocalize.Term; if (mLocalize.Source != null) { LocalizationEditor.mLanguageSource = mLocalize.Source; } //UpgradeManager.EnablePlugins(); LocalizationEditor.ApplyInferredTerm(mLocalize); }
void OnEnable() { mLocalize = (Localize)target; mProp_mTerm = serializedObject.FindProperty("mTerm"); mProp_mTermSecondary = serializedObject.FindProperty("mTermSecondary"); mProp_TranslatedObjects = serializedObject.FindProperty("TranslatedObjects"); mProp_IgnoreRTL = serializedObject.FindProperty("IgnoreRTL"); mProp_SeparateWords = serializedObject.FindProperty("AddSpacesToJoinedLanguages"); mProp_MaxCharactersInRTL = serializedObject.FindProperty("MaxCharactersInRTL"); mProp_IgnoreNumbersInRTL = serializedObject.FindProperty("IgnoreNumbersInRTL"); mProp_CorrectAlignmentForRTL = serializedObject.FindProperty("CorrectAlignmentForRTL"); mProp_LocalizeOnAwake = serializedObject.FindProperty("LocalizeOnAwake"); mProp_AlwaysForceLocalize = serializedObject.FindProperty("AlwaysForceLocalize"); mProp_TermSuffix = serializedObject.FindProperty("TermSuffix"); mProp_TermPrefix = serializedObject.FindProperty("TermPrefix"); // Check Copy/Paste Localize component into another gameObject if (mLocalize.mTarget != null) { var cmp = mLocalize.mTarget as Component; if (cmp != null && cmp.gameObject != mLocalize.gameObject) { serializedObject.ApplyModifiedProperties(); mLocalize.ReleaseTarget(); serializedObject.Update(); } } if (LocalizationManager.Sources.Count == 0) { LocalizationManager.UpdateSources(); } //LocalizationEditor.ParseTerms (true); //mGUI_ShowReferences = (mLocalize.TranslatedObjects!=null && mLocalize.TranslatedObjects.Length>0); //mGUI_ShowCallback = (mLocalize.LocalizeCallBack.Target!=null); //mGUI_ShowTems = true; LocalizationEditor.mKeysDesc_AllowEdit = false; GUI_SelectedTerm = 0; mNewKeyName = mLocalize.Term; if (mLocalize.Source != null) { LocalizationEditor.mLanguageSource = mLocalize.Source; } else { if (LocalizationManager.Sources.Count == 0) { LocalizationManager.UpdateSources(); } LocalizationEditor.mLanguageSource = LocalizationManager.GetSourceContaining(mLocalize.Term); } //UpgradeManager.EnablePlugins(); LocalizationEditor.ApplyInferredTerm(mLocalize); }
void OnEnable() { mLocalize = (Localize)target; mLocalizeInspector = this; LocalizationEditor.mCurrentInspector = this; mProp_mTerm = serializedObject.FindProperty("mTerm"); mProp_mTermSecondary = serializedObject.FindProperty("mTermSecondary"); mProp_TranslatedObjects = serializedObject.FindProperty("TranslatedObjects"); mProp_IgnoreRTL = serializedObject.FindProperty("IgnoreRTL"); mProp_SeparateWords = serializedObject.FindProperty("AddSpacesToJoinedLanguages"); mProp_MaxCharactersInRTL = serializedObject.FindProperty("MaxCharactersInRTL"); mProp_IgnoreNumbersInRTL = serializedObject.FindProperty("IgnoreNumbersInRTL"); mProp_CorrectAlignmentForRTL = serializedObject.FindProperty("CorrectAlignmentForRTL"); mProp_LocalizeOnAwake = serializedObject.FindProperty("LocalizeOnAwake"); mProp_AlwaysForceLocalize = serializedObject.FindProperty("AlwaysForceLocalize"); mProp_TermSuffix = serializedObject.FindProperty("TermSuffix"); mProp_TermPrefix = serializedObject.FindProperty("TermPrefix"); mProp_CallbackEvent = serializedObject.FindProperty("LocalizeEvent"); mProp_AllowLocalizedParameters = serializedObject.FindProperty("AllowLocalizedParameters"); mProp_AllowParameters = serializedObject.FindProperty("AllowParameters"); if (LocalizationManager.Sources.Count == 0) { LocalizationManager.UpdateSources(); } //LocalizationEditor.ParseTerms (true); //mGUI_ShowReferences = (mLocalize.TranslatedObjects!=null && mLocalize.TranslatedObjects.Length>0); //mGUI_ShowCallback = (mLocalize.LocalizeCallBack.Target!=null); //mGUI_ShowTems = true; LocalizationEditor.mKeysDesc_AllowEdit = false; GUI_SelectedTerm = 0; mNewKeyName = mLocalize.Term; if (mLocalize.Source != null) { LocalizationEditor.mLanguageSource = mLocalize.Source.SourceData; } else { if (LocalizationManager.Sources.Count == 0) { LocalizationManager.UpdateSources(); } LocalizationEditor.mLanguageSource = LocalizationManager.GetSourceContaining(mLocalize.Term); } //UpgradeManager.EnablePlugins(); LocalizationEditor.ApplyInferredTerm(mLocalize); RemoveUnusedReferences(mLocalize); }