/// <summary> /// Sprite's custom properties based on the selected image shape /// </summary> protected void ShapeGUI() { EditorGUILayout.PropertyField(m_ImageShape); ++EditorGUI.indentLevel; { ImageExt.ImageShape shapeEnum = (ImageExt.ImageShape)m_ImageShape.enumValueIndex; m_ShowNormal = new AnimBool(!m_ImageShape.hasMultipleDifferentValues && shapeEnum == ImageExt.ImageShape.Normal); m_ShowCircle = new AnimBool(!m_ImageShape.hasMultipleDifferentValues && shapeEnum == ImageExt.ImageShape.Circle); m_ShowTilletRect = new AnimBool(!m_ImageShape.hasMultipleDifferentValues && shapeEnum == ImageExt.ImageShape.FilletRect); m_ShowRing = new AnimBool(!m_ImageShape.hasMultipleDifferentValues && shapeEnum == ImageExt.ImageShape.Ring); EditorUtilExt.LayoutGroup(m_ShowCircle, () => { EditorGUILayout.PropertyField(m_SegmentCount); EditorGUILayout.PropertyField(m_FillPercent); }); EditorUtilExt.LayoutGroup(m_ShowRing, () => { EditorGUILayout.PropertyField(m_SegmentCount); EditorGUILayout.PropertyField(m_Thickness); }); EditorUtilExt.LayoutGroup(m_ShowTilletRect, () => { //EditorGUILayout.PropertyField(m_FilletSegments); EditorGUILayout.PropertyField(m_FilletRadius); }); } --EditorGUI.indentLevel; }
public override void OnInspectorGUI() { base.OnInspectorGUI(); serializedObject.Update(); EditorGUILayout.Space(); EditorGUILayout.PropertyField(m_isDragValide, new GUIContent("Dragable")); m_ShowShape.target = m_Sprite.objectReferenceValue != null; EditorUtilExt.LayoutGroup(m_ShowShape, () => { ShapeGUI(); }); serializedObject.ApplyModifiedProperties(); }