mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
29 lines
747 B
C#
29 lines
747 B
C#
using UnityEditor;
|
|
using UnityEditor.UI;
|
|
|
|
namespace TEngine
|
|
{
|
|
[CustomEditor(typeof(LocalizeText), true)]
|
|
[CanEditMultipleObjects]
|
|
public class LocalizeTextEditor : TextEditor
|
|
{
|
|
public SerializedProperty Key;
|
|
|
|
protected override void OnEnable()
|
|
{
|
|
UnityEngine.Debug.Log(serializedObject.FindProperty("Key"));
|
|
base.OnEnable();
|
|
Key = serializedObject.FindProperty("Key");
|
|
}
|
|
|
|
public override void OnInspectorGUI()
|
|
{
|
|
EditorGUILayout.Space();
|
|
serializedObject.Update();
|
|
EditorGUILayout.PropertyField(Key);
|
|
serializedObject.ApplyModifiedProperties();
|
|
base.OnInspectorGUI();
|
|
}
|
|
}
|
|
}
|