Пример #1
0
        private void keyColumn()
        {
            int strings = serializedLocales.FindProperty("items").arraySize;

            EditorGUITools.DoVertical(() => {
                EditorGUILayout.LabelField(new GUIContent("String name", "The name used to identify this translation"));
                for (int keyIndex = 0; keyIndex < strings; keyIndex++)
                {
                    var keyProp = serializedLocales.FindProperty("items").GetArrayElementAtIndex(keyIndex).FindPropertyRelative("key");
                    EditorGUILayout.PropertyField(keyProp);
                }
            });
            serializedLocales.ApplyModifiedProperties();
        }
Пример #2
0
        private void localeColumn(SerializedObject locale)
        {
            int strings = serializedLocales.FindProperty("items").arraySize;

            EditorGUITools.DoVertical(() => {
                string label = locale.targetObject.name;
                if (settings.DefaultLocale == locale.targetObject.name)
                {
                    label += " (Default)";
                }
                EditorGUILayout.LabelField(label);
                for (int keyIndex = 0; keyIndex < strings; keyIndex++)
                {
                    var localisationProp = locale.FindProperty("items").GetArrayElementAtIndex(keyIndex).FindPropertyRelative("value");
                    EditorGUILayout.PropertyField(localisationProp);
                }
            });
            locale.ApplyModifiedProperties();
        }