docs.unity3d.com
    Show / Hide Table of Contents

    Class SplineHandles

    This class provides the ability to draw a handle for a spline.

    Inheritance
    Object
    SplineHandles
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEditor.Splines
    Syntax
    public static class SplineHandles

    Properties

    lineBehindColor

    The color of sections of spline curve handles that are behind objects in the Scene view.

    Declaration
    public static Color lineBehindColor { get; }
    Property Value
    Type Description
    Color

    lineColor

    The color of sections of spline curves handles that are in front of objects in the Scene view.

    Declaration
    public static Color lineColor { get; }
    Property Value
    Type Description
    Color

    pickingDistance

    The distance to pick a spline knot, tangent, or curve handle at.

    Declaration
    public static float pickingDistance { get; }
    Property Value
    Type Description
    Single

    tangentColor

    The color of tangent handles for a spline.

    Declaration
    public static Color tangentColor { get; }
    Property Value
    Type Description
    Color

    Methods

    DoCurve(Int32, BezierCurve)

    Draws a handle for a BezierCurve.

    Declaration
    public static void DoCurve(int controlID, BezierCurve curve)
    Parameters
    Type Name Description
    Int32 controlID

    The spline mesh controlID.

    BezierCurve curve

    The BezierCurve to create handles for.

    DoCurve(BezierCurve)

    Draws a handle for a BezierCurve.

    Declaration
    public static void DoCurve(BezierCurve curve)
    Parameters
    Type Name Description
    BezierCurve curve

    The BezierCurve to create handles for.

    DoHandles(IReadOnlyList<SplineInfo>)

    Creates handles for a set of splines. These handles display the knots, tangents, and segments of a spline. These handles support selection and the direct manipulation of spline elements.

    Declaration
    public static void DoHandles(IReadOnlyList<SplineInfo> splines)
    Parameters
    Type Name Description
    IReadOnlyList<SplineInfo> splines

    The set of splines to draw handles for.

    DoKnotHandles(SelectableKnot)

    Create handles for a knot. These handles the support selection and direct manipulation of spline elements. Call DoKnotHandles in a SplineHandleScope.

    Declaration
    public static void DoKnotHandles(SelectableKnot knot)
    Parameters
    Type Name Description
    SelectableKnot knot

    The knot to draw handles for.

    DoKnotsAndTangentsHandles(IReadOnlyList<SplineInfo>)

    Creates knot and tangent handles for multiple splines. Call DoKnotsAndTangentsHandles in a SplineHandleScope. This method is used internally by DoHandles.

    Declaration
    public static void DoKnotsAndTangentsHandles(IReadOnlyList<SplineInfo> splines)
    Parameters
    Type Name Description
    IReadOnlyList<SplineInfo> splines

    The splines to create knot and tangent handles for.

    DoKnotsAndTangentsHandles(SplineInfo)

    Creates knot and tangent handles for a spline. Call DoKnotsAndTangentsHandles in a SplineHandleScope. This method is used internally by DoHandles.

    Declaration
    public static void DoKnotsAndTangentsHandles(SplineInfo spline)
    Parameters
    Type Name Description
    SplineInfo spline

    The spline to create knot and tangent handles for.

    DoKnotWithTangentsHandles(SelectableKnot)

    Creates handles for a knot and its tangents if those tangents are modifiable. These handles support the selection and direct manipulation of spline elements. Call DoKnotWithTangentsHandles in a SplineHandleScope.

    Declaration
    public static void DoKnotWithTangentsHandles(SelectableKnot knot)
    Parameters
    Type Name Description
    SelectableKnot knot

    The knot to draw handles for.

    DoSegmentsHandles(SplineInfo)

    Creates segment handles for a spline. Call DoCurvesHandles in a SplineHandleScope. This method is used internally by DrawHandles.

    Declaration
    public static void DoSegmentsHandles(SplineInfo splineInfo)
    Parameters
    Type Name Description
    SplineInfo splineInfo

    The splineInfo of the spline to draw knots and tangents for.

    DoSpline<T>(T)

    Draws a handle for a spline.

    Declaration
    public static void DoSpline<T>(T spline)
        where T : ISpline
    Parameters
    Type Name Description
    T spline

    The target spline.

    Type Parameters
    Name Description
    T

    A type implementing ISpline.

    DoSpline<T>(Int32, T)

    Draws a handle for a spline.

    Declaration
    public static void DoSpline<T>(int controlID, T spline)
        where T : ISpline
    Parameters
    Type Name Description
    Int32 controlID

    The spline mesh controlID.

    T spline

    The target spline.

    Type Parameters
    Name Description
    T

    A type implementing ISpline.

    DoTangentsHandles(SelectableKnot)

    Create handles for a knot's tangents if those tangents are modifiable. DoTangentsHandles does not create handles for the knot. These handles support the selection and direct manipulation of the spline elements. Call DoTangentsHandles in a SplineHandleScope.

    Declaration
    public static void DoTangentsHandles(SelectableKnot knot)
    Parameters
    Type Name Description
    SelectableKnot knot

    The knot to draw tangent handles for.

    DrawKnot(Int32, SelectableKnot, Boolean, Boolean)

    Draws handles for a knot. These handles are drawn only during repaint events and not on selection.

    Declaration
    public static void DrawKnot(int controlID, SelectableKnot knot, bool selected = false, bool hovered = false)
    Parameters
    Type Name Description
    Int32 controlID

    The controlID of the tangent to create handles for.

    SelectableKnot knot

    The SelectableKnot to create handles for.

    Boolean selected

    Set to true to draw the knot handle as a selected element.

    Boolean hovered

    Set to true to draw the knot handle as a hovered element.

    DrawKnot(SelectableKnot, Boolean, Boolean)

    Draws handles for a knot. These handles are drawn only during repaint events and not on selection.

    Declaration
    public static void DrawKnot(SelectableKnot knot, bool selected = false, bool hovered = false)
    Parameters
    Type Name Description
    SelectableKnot knot

    The SelectableKnot to create handles for.

    Boolean selected

    Set to true to draw the knot handle as a selected element.

    Boolean hovered

    Set to true to draw the knot handle as a hovered element.

    DrawTangent(Int32, SelectableTangent, Boolean, Boolean)

    Draws handles for a tangent. These handles are drawn only during repaint events and not on selection.

    Declaration
    public static void DrawTangent(int controlID, SelectableTangent tangent, bool selected = false, bool hovered = false)
    Parameters
    Type Name Description
    Int32 controlID

    The controlID of the tangent to create handles for.

    SelectableTangent tangent

    The SelectableTangent to create handles for.

    Boolean selected

    Set to true to draw the tangent handle as a selected element.

    Boolean hovered

    Set to true to draw the tangent handle as a hovered element.

    DrawTangent(SelectableTangent, Boolean, Boolean)

    Draws handles for a tangent. These handles are drawn only during repaint events and not on selection.

    Declaration
    public static void DrawTangent(SelectableTangent tangent, bool selected = false, bool hovered = false)
    Parameters
    Type Name Description
    SelectableTangent tangent

    The SelectableTangent to create handles for.

    Boolean selected

    Set to true to draw the tangent handle as a selected element.

    Boolean hovered

    Set to true to draw the tangent handle as a hovered element.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023