/// <summary> /// Returns true if the window should show, returns false if not. /// If false, it will draw an editor label that says the window is unavailable /// </summary> public static bool ShouldShowWindow(bool isAvailableInPlayMode = false) { if(Application.isPlaying && !isAvailableInPlayMode) { GUILayout.Label ("This Smart Localization Window is not available in play mode", EditorStyles.boldLabel); if(LanguageManager.HasInstance) { if(GUILayout.Button("Go to translation window")) { TranslateLanguageWindow.ShowWindow(LanguageManager.Instance.GetCultureInfo(LanguageManager.Instance.CurrentlyLoadedCulture.languageCode), null); } } return false; } else if(!LocalizationWorkspace.Exists()) { GUILayout.Label ("There is no localization workspace available in this project", EditorStyles.boldLabel); if(GUILayout.Button("Create localization workspace")) { if(LocalizationWorkspace.Create()) { return true; } } return false; } else { return true; } }
void ShowTranslateWindow(SmartCultureInfo info) { translateLanguageWindow = TranslateLanguageWindow.ShowWindow(info, this); translateLanguageWindow.InitializeTranslator(automaticTranslator); translateLanguageWindow.Show(); }