少年修仙传客户端基础资源
dabaoji
2023-11-13 0a23e1b83f8fda8ab9f9e32fe71c26c431faf63a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using UnityEditor;
using UnityEngine;
 
[CustomEditor(typeof(ImageEx), true), CanEditMultipleObjects]
public class ImageExEditor : UnityEditor.UI.ImageEditor
{
 
    SerializedProperty m_Gray;
    SerializedProperty m_IconKey;
 
    protected override void OnEnable()
    {
        base.OnEnable();
        m_Gray = this.serializedObject.FindProperty("m_Gray");
        m_IconKey = this.serializedObject.FindProperty("m_IconKey");
    }
 
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        EditorGUILayout.Space();
 
        EditorGUILayout.PropertyField(m_Gray, new GUIContent("Gray"));
        EditorGUILayout.PropertyField(m_IconKey, new GUIContent("IconKey"));
 
        base.serializedObject.ApplyModifiedProperties();
        Repaint();
    }
 
}