コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
        /// <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;
            }
        }
コード例 #4
0
        /// <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;
            }
        }
コード例 #5
0
        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;
            }
        }
コード例 #6
0
        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;
            }
        }
コード例 #7
0
        /// <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
            }
        }
コード例 #8
0
        /// <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();
            }
        }