diff options
author | chai <chaifix@163.com> | 2021-05-08 23:15:13 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-05-08 23:15:13 +0800 |
commit | d07e14add74e017b52ab2371efeea1aa4ea10ced (patch) | |
tree | efd07869326e4c428f5bfe43fad0c2583d32a401 /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(); + } + } +} |