Esempio n. 1
0
 /// <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;
 }
Esempio n. 2
0
 public void TextSpacingGUI(SerializedProperty m_UseTextSpacing, SerializedProperty m_TextSpacing, ref bool m_TextSpacingPanelOpen)
 {
     EditorUtilExt.LayoutF(() => {
         EditorGUILayout.PropertyField(m_UseTextSpacing);
         if (m_UseTextSpacing.boolValue)
         {
             EditorUtilExt.Space();
             EditorUtilExt.LayoutH(() => {
                 EditorGUI.PropertyField(EditorUtilExt.GUIRect(0, 18), m_TextSpacing, new GUIContent());
             });
         }
     }, "Text Spacing", ref m_TextSpacingPanelOpen, true);
 }
Esempio n. 3
0
    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();
    }