public override void OnInspectorGUI() { base.OnInspectorGUI(); if (_languageCodes == null) { _languageCodes = LanguageManager.GetAvailableLanguageCodes(); var defaultCode = LanguageManager.HasInstance ? LanguageManager.Instance.CurrentlyLoadedCulture.languageCode : LanguageManager.DefaultLanguage; _selectedLanguageIdx = Array.IndexOf(_languageCodes, defaultCode); } var buttonsPerLine = (int)(EditorGUIUtility.currentViewWidth - 20) / 40; _selectedLanguageIdx = GUILayout.SelectionGrid(_selectedLanguageIdx, _languageCodes, buttonsPerLine); EditorGUI.BeginChangeCheck(); var selectedKey = LocalizedKeySelector.SelectKeyGUI(Obj.localizedKey, true, LocalizedObjectType.String); if (EditorGUI.EndChangeCheck() && selectedKey != null) { Undo.RecordObject(Obj, "Set localization key"); Obj.localizedKey = selectedKey; } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); selectedKey = LocalizedKeySelector.SelectKeyGUI(selectedKey, true, LocalizedObjectType.STRING); if (!Application.isPlaying && GUILayout.Button("Use Key", GUILayout.Width(70))) { LocalizedText textObject = ((LocalizedText)target); textObject.localizedKey = selectedKey; } }
/// <summary> /// Override of the OnInspectorGUI method /// </summary> public override void OnInspectorGUI() { base.OnInspectorGUI(); selectedKey = LocalizedKeySelector.SelectKeyGUI(selectedKey, true, LocalizedObjectType.AUDIO); if (!Application.isPlaying && GUILayout.Button("Use Key", GUILayout.Width(70))) { LocalizedAudioSource audioObject = ((LocalizedAudioSource)target); audioObject.localizedKey = selectedKey; } }
/// <summary> /// Override of the OnInspectorGUI method /// </summary> public override void OnInspectorGUI() { base.OnInspectorGUI(); selectedKey = LocalizedKeySelector.SelectKeyGUI(selectedKey, true, LocalizedObjectType.Texture); if (!Application.isPlaying) { var obj = ((LocalizedSprite)target); obj.localizedKey = selectedKey; } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); selectedKey = LocalizedKeySelector.SelectKeyGUI(selectedKey, true, LocalizedObjectType.GAME_OBJECT); if (!Application.isPlaying && GUILayout.Button("Use Key", GUILayout.Width(70))) { SL_NGUISpriteAtlas atlasObject = ((SL_NGUISpriteAtlas)target); atlasObject.localizedKey = selectedKey; } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); LocalizedText textObject = ((LocalizedText)target); selectedKey = LocalizedKeySelector.SelectKeyGUI(selectedKey, true, LocalizedObjectType.STRING); if (selectedKey != textObject.localizedKey) { Undo.RecordObject(textObject, "Set Smart Localization text"); textObject.localizedKey = selectedKey; } }
/// <summary> /// Override of the OnInspectorGUI method /// </summary> public override void OnInspectorGUI() { base.OnInspectorGUI(); selectedKey = LocalizedKeySelector.SelectKeyGUI(selectedKey, true, LocalizedObjectType.STRING); if (!Application.isPlaying && GUILayout.Button("Use Key", GUILayout.Width(70))) { LocalizedGUIText textObject = ((LocalizedGUIText)target); textObject.localizedKey = selectedKey; EditorUtility.SetDirty(textObject);// ADDED to have new value serialized } }
/// <summary> /// Override of the OnInspectorGUI method /// </summary> public override void OnInspectorGUI() { base.OnInspectorGUI(); // LocalizedTextMesh changuer = ((LocalizedTextMesh)target); selectedKey = LocalizedKeySelector.SelectKeyGUI(selectedKey, true, LocalizedObjectType.STRING); bool isChangued = false; if (!Application.isPlaying && GUILayout.Button("Use Key", GUILayout.Width(70))) { // LocalizedTextMesh textObject = ((LocalizedTextMesh)target); // textObject.localizedKey = selectedKey; serializedObject.FindProperty("localizedKey").stringValue = selectedKey; isChangued = true; } if (isChangued) { serializedObject.ApplyModifiedProperties(); } }