少年修仙传客户端基础资源
client_Wu Xijin
2019-01-05 e629dbec30d73104755cb6513e0e10a6bd3932ad
Assets/Editor/UIComponent/ImageExEditor.cs
@@ -1,13 +1,27 @@
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(ImageEx),true),CanEditMultipleObjects]
public class ImageExEditor:UnityEditor.UI.ImageEditor {
[CustomEditor(typeof(ImageEx), true), CanEditMultipleObjects]
public class ImageExEditor : UnityEditor.UI.ImageEditor
{
    public override void OnInspectorGUI() {
    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();
        ImageEx image = target as ImageEx;
        image.gray = EditorGUILayout.Toggle("Gray",image.gray);
        EditorGUILayout.PropertyField(m_Gray, new GUIContent("Gray"));
        EditorGUILayout.PropertyField(m_IconKey, new GUIContent("IconKey"));
    }
}