private void Apply2D(BGCurveSettings.SettingsForHandles handlesSettings)
        {
            handlesSettings.RemoveX = Curve.Mode2D == BGCurve.Mode2DEnum.YZ;
            handlesSettings.RemoveY = Curve.Mode2D == BGCurve.Mode2DEnum.XZ;
            handlesSettings.RemoveZ = Curve.Mode2D == BGCurve.Mode2DEnum.XY;

            handlesSettings.RemoveXY = Curve.Mode2D == BGCurve.Mode2DEnum.XZ || Curve.Mode2D == BGCurve.Mode2DEnum.YZ;
            handlesSettings.RemoveXZ = Curve.Mode2D == BGCurve.Mode2DEnum.XY || Curve.Mode2D == BGCurve.Mode2DEnum.YZ;
            handlesSettings.RemoveYZ = Curve.Mode2D == BGCurve.Mode2DEnum.XZ || Curve.Mode2D == BGCurve.Mode2DEnum.XY;
        }
Beispiel #2
0
        // ==============================================  Custom handles

        public static Vector3 ControlHandleCustom(int number, Vector3 position, Quaternion rotation, BGCurveSettings.SettingsForHandles handlesSettings)
        {
            var handleSize = GetHandleSize(position);

            var axisSize = handleSize * handlesSettings.AxisScale;

            var color = Handles.color;

            if (!handlesSettings.RemoveX)
            {
                position = AxisHandle(position, rotation, axisSize, Handles.xAxisColor, "xAxis", Vector3.right, xSnap, handlesSettings.Alpha);
            }

            if (!handlesSettings.RemoveY)
            {
                position = AxisHandle(position, rotation, axisSize, Handles.yAxisColor, "yAxis", Vector3.up, ySnap, handlesSettings.Alpha);
            }

            if (!handlesSettings.RemoveZ)
            {
                position = AxisHandle(position, rotation, axisSize, Handles.zAxisColor, "zAxis", Vector3.forward, zSnap, handlesSettings.Alpha);
            }

            if (!handlesSettings.RemoveXZ)
            {
                position = PlanarHandle("xz" + number, position, rotation, handleSize * .3f * handlesSettings.PlanesScale, Vector3.right, Vector3.forward, Handles.yAxisColor);
            }

            if (!handlesSettings.RemoveYZ)
            {
                position = PlanarHandle("yz" + number, position, rotation, handleSize * .3f * handlesSettings.PlanesScale, Vector3.up, Vector3.forward, Handles.xAxisColor);
            }

            if (!handlesSettings.RemoveXY)
            {
                position = PlanarHandle("xy" + number, position, rotation, handleSize * .3f * handlesSettings.PlanesScale, Vector3.up, Vector3.right, Handles.zAxisColor);
            }

            Handles.color = color;
            return(position);
        }
 private void Apply3D(BGCurveSettings.SettingsForHandles handlesSettings)
 {
     handlesSettings.RemoveX = handlesSettings.RemoveY = handlesSettings.RemoveZ = handlesSettings.RemoveXY = handlesSettings.RemoveXZ = handlesSettings.RemoveYZ = false;
 }
        internal Vector3 Handle(int number, BGCurveSettings.HandlesTypeEnum type, Vector3 position, Quaternion rotation, BGCurveSettings.SettingsForHandles handlesSettings)
        {
            switch (type)
            {
            case BGCurveSettings.HandlesTypeEnum.FreeMove:
                position = Handles.FreeMoveHandle(position, rotation, BGEditorUtility.GetHandleSize(position, .2f), Vector3.zero, Handles.CircleCap);
                break;

            case BGCurveSettings.HandlesTypeEnum.Standard:
                position = Handles.PositionHandle(position, rotation);
                break;

            case BGCurveSettings.HandlesTypeEnum.Configurable:
                position = BGEditorUtility.ControlHandleCustom(number, position, rotation, handlesSettings);
                break;
            }
            return(position);
        }