Exemplo n.º 1
0
    // Draw movement handles
    private void MoveHandle(int index, int handle, Vector3 position)
    {
        EditorGUI.BeginChangeCheck();
        Quaternion rotation = Tools.pivotRotation == PivotRotation.Global ? componentRotation : component.GetRotation(activeSpline, index);

        position = Handles.DoPositionHandle(position, rotation);
        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(component, "Move Point");
            EditorUtility.SetDirty(component);
            if (handle == 0)
            {
                component.SetAnchorPosition(activeSpline, index, position);
            }
            else
            {
                component.SetHandlePosition(activeSpline, index, handle - 1, position);
            }
        }
    }