Exemplo n.º 1
0
 public void SetBorderEmpty(bool recalculate = false)
 {
     UseShapeBorder = BorderFillType.None;
     if (recalculate)
     {
         RecalculateMesh();
     }
 }
Exemplo n.º 2
0
 public void SetBorderUnicolor(Color color, float outerScale = 0.01f, float innerScale = 0f, bool recalculate = false)
 {
     StandardBorder            = new StandardBorder();
     UseShapeBorder            = BorderFillType.Unicolor;
     StandardBorder.color      = color;
     StandardBorder.outerScale = Mathf.Max(0, Mathf.Min(4, outerScale));
     StandardBorder.innerScale = Mathf.Max(0, Mathf.Min(1, innerScale));
     if (recalculate)
     {
         RecalculateMesh();
     }
 }
Exemplo n.º 3
0
        private void DrawBorderInspector()
        {
            SerializedProperty useBorderProp = serializedObject.FindProperty("UseShapeBorder");

            EditorGUILayout.LabelField("Border", EditorStyles.boldLabel);

            Rect rect = EditorGUILayout.GetControlRect(false, 2);

            rect.x     = 0.0f;
            rect.y    -= 1.0f;
            rect.width = Screen.width;
            EditorGUI.DrawRect(rect, seperatorColor);

            EditorGUILayout.PropertyField(useBorderProp, new GUIContent(""));

            bool           allowMultiobjectEditing = true;
            BorderFillType firstShapeBorderType    = ((QuickPolygon)targets[0]).UseShapeBorder;

            for (int i = 1; i < targets.Length && allowMultiobjectEditing; i++)
            {
                if (((QuickPolygon)targets[i]).UseShapeBorder != firstShapeBorderType)
                {
                    allowMultiobjectEditing = false;
                }
            }

            if (allowMultiobjectEditing)
            {
                switch ((BorderFillType)useBorderProp.enumValueIndex)
                {
                case BorderFillType.Unicolor:
                    SerializedProperty standardBorderProp = serializedObject.FindProperty("StandardBorder");
                    EditorGUILayout.PropertyField(standardBorderProp);
                    break;

                default:
                    break;
                }
            }
            else
            {
                EditorGUI.indentLevel++;
                EditorGUILayout.HelpBox(MSG.Warnings.BORDER_MULTIOBJECT_SETUP_DISABLED, MessageType.Info);
                EditorGUI.indentLevel--;
            }
        }