RemoveKeyPointAt() 공개 메소드

Removes a key point at a specified index
public RemoveKeyPointAt ( int index ) : bool
index int The index of the key point that will be removed
리턴 bool
        protected virtual void OnEnable()
        {
            this.curve = (BezierCurve3D)this.target;
            if (curve.KeyPointsCount < 2)
            {
                while (curve.KeyPointsCount != 0)
                {
                    curve.RemoveKeyPointAt(this.curve.KeyPointsCount - 1);
                }

                BezierCurve3DEditor.AddDefaultPoints(this.curve);
            }

            this.keyPoints = new ReorderableList(this.serializedObject, serializedObject.FindProperty("keyPoints"), true, true, false, false);
            this.keyPoints.drawElementCallback = this.DrawElementCallback;
            this.keyPoints.drawHeaderCallback =
                (Rect rect) =>
                {
                    EditorGUI.LabelField(rect, string.Format("Reorderable List | Points: {0}", this.keyPoints.serializedProperty.arraySize), EditorStyles.boldLabel);
                };
        }
예제 #2
0
        protected virtual void OnEnable()
        {
            this.curve = (BezierCurve3D)this.target;
            if (curve.KeyPointsCount < 2)
            {
                while (curve.KeyPointsCount != 0)
                {
                    curve.RemoveKeyPointAt(this.curve.KeyPointsCount - 1);
                }

                BezierCurve3DEditor.AddDefaultPoints(this.curve);
            }

            this.keyPoints = new ReorderableList(this.serializedObject, serializedObject.FindProperty("keyPoints"), true, true, false, false);
            this.keyPoints.drawElementCallback = this.DrawElementCallback;
            this.keyPoints.drawHeaderCallback  =
                (Rect rect) =>
            {
                EditorGUI.LabelField(rect, string.Format("Points: {0}", this.keyPoints.serializedProperty.arraySize), EditorStyles.boldLabel);
            };
        }