Example #1
0
        public override void OnEnable()
        {
            base.OnEnable();

            arcShape = ((ArcShapeSO)scriptableObject).shape;

            angleA   = shape.FindPropertyRelative("angleA");
            angleB   = shape.FindPropertyRelative("angleB");
            radius   = shape.FindPropertyRelative("radius");
            segments = shape.FindPropertyRelative("segments");

            colorMode         = shape.FindPropertyRelative("colorMode");
            blendMode         = shape.FindPropertyRelative("blendMode");
            color             = shape.FindPropertyRelative("color");
            colors            = shape.FindPropertyRelative("colors");
            gradient          = shape.FindPropertyRelative("gradient");
            rendererType      = shape.FindPropertyRelative("rendererType");
            billboardMethod   = shape.FindPropertyRelative("billboardMethod");
            quadLineAlignment = shape.FindPropertyRelative("quadLineAlignment");
            quadLineThickness = shape.FindPropertyRelative("quadLineThickness");

            colorsList = new ReorderableList(serializedObject, colors, true, true, true, true)
            {
                drawHeaderCallback  = (Rect rect) => { EditorGUI.LabelField(rect, $"Colors ({colors.arraySize})"); },
                drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) =>
                {
                    rect.y     += 2;
                    rect.height = EditorGUIUtility.singleLineHeight;
                    EditorGUI.PropertyField(rect, colors.GetArrayElementAtIndex(index));
                    rect.y += 2;
                },
                onReorderCallback = (ReorderableList list) => { arcShape.MarkDirty(); }
            };
            colorsList.list = arcShape.colors;

            SceneView.duringSceneGui += DuringSceneGUI;
        }
Example #2
0
 public override void GetProps(out Shape shape)
 {
     shape = this.shape;
 }