diff options
author | chai <chaifix@163.com> | 2020-10-08 09:50:33 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-10-08 09:50:33 +0800 |
commit | 00dae1bd426d892dff73a50f1c505afd1ac00a90 (patch) | |
tree | 5d75f8495406f5b8dd01595e3dd9216887996a34 /Assets/uGUI-2017.1/Editor/UI/MaskEditor.cs |
+init
Diffstat (limited to 'Assets/uGUI-2017.1/Editor/UI/MaskEditor.cs')
-rw-r--r-- | Assets/uGUI-2017.1/Editor/UI/MaskEditor.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Assets/uGUI-2017.1/Editor/UI/MaskEditor.cs b/Assets/uGUI-2017.1/Editor/UI/MaskEditor.cs new file mode 100644 index 0000000..8a1a486 --- /dev/null +++ b/Assets/uGUI-2017.1/Editor/UI/MaskEditor.cs @@ -0,0 +1,28 @@ +using UnityEngine.UI; + +namespace UnityEditor.UI +{ + [CustomEditor(typeof(Mask), true)] + [CanEditMultipleObjects] + public class MaskEditor : Editor + { + SerializedProperty m_ShowMaskGraphic; + + protected virtual void OnEnable() + { + m_ShowMaskGraphic = serializedObject.FindProperty("m_ShowMaskGraphic"); + } + + public override void OnInspectorGUI() + { + var graphic = (target as Mask).GetComponent<Graphic>(); + + if (graphic && !graphic.IsActive()) + EditorGUILayout.HelpBox("Masking disabled due to Graphic component being disabled.", MessageType.Warning); + + serializedObject.Update(); + EditorGUILayout.PropertyField(m_ShowMaskGraphic); + serializedObject.ApplyModifiedProperties(); + } + } +} |