public override void OnGUI(string searchContext) { GUILayout.Space(10); const float indent = 8; // Small indent to match the other preference editors. var rect = EditorGUILayout.GetControlRect(); rect.xMin += indent; EditorGUI.BeginChangeCheck(); LocalizationEditorSettings.ShowLocaleMenuInGameView = EditorGUI.Toggle(rect, showGameViewToolbar, LocalizationEditorSettings.ShowLocaleMenuInGameView); if (EditorGUI.EndChangeCheck() && Application.isPlaying) { if (LocalizationEditorSettings.ShowLocaleMenuInGameView) { GameViewLanguageMenu.Show(); } else { GameViewLanguageMenu.Hide(); } } }
public override void OnInspectorGUI() { serializedObject.Update(); DrawActiveSettings(); // Player EditorGUILayout.BeginVertical(EditorStyles.helpBox); EditorGUILayout.LabelField(Styles.player, EditorStyles.boldLabel); EditorGUILayout.Space(); EditorGUILayout.PropertyField(m_AvailableLocales, true); m_StartupSelectorsList.DoLayoutList(); EditorGUILayout.PropertyField(m_AssetDatabase, true); EditorGUILayout.PropertyField(m_StringDatabase, true); EditorGUILayout.EndVertical(); // Editor EditorGUILayout.BeginVertical(EditorStyles.helpBox); EditorGUILayout.LabelField(Styles.editor, EditorStyles.boldLabel); EditorGUILayout.Space(); EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(m_ShowLocaleMenuInGameView, Styles.showGameViewToolbar, true); if (EditorGUI.EndChangeCheck() && Application.isPlaying) { if (m_ShowLocaleMenuInGameView.boolValue) { GameViewLanguageMenu.Show(); } else { GameViewLanguageMenu.Hide(); } } EditorGUILayout.EndVertical(); serializedObject.ApplyModifiedProperties(); }