docs.unity.cn
    Show / Hide Table of Contents

    Class SplineDataHandle<T>

    SplineDataHandle is a base class to override in order to enable custom handles for spline data. The Drawer needs to inherit from this class and override the method corresponding to the correct splineData type. Either one of the method or both can be overriden regarding the user needs.

    Inheritance
    Object
    SplineDataHandle<T>
    Namespace: UnityEditor.Splines
    Syntax
    public abstract class SplineDataHandle<T> : object, ISplineDataHandle
    Type Parameters
    Name Description
    T

    The type parameter of the SplineData<T> that this drawer targets.

    Properties

    attribute

    Declaration
    public SplineDataHandleAttribute attribute { get; }
    Property Value
    Type Description
    SplineDataHandleAttribute

    controlIDs

    Array of reserved control IDs used for SplineData<T> handles.

    Declaration
    public int[] controlIDs { get; }
    Property Value
    Type Description
    Int32[]

    Methods

    DrawDataPoint(Int32, Vector3, Vector3, Vector3, SplineData<T>, Int32)

    Override this method to create custom handles for a DataPoint<TDataType>in SplineData<T>, 'position' and 'direction' are given in the Spline-space basis. This method is called after DrawSplineData in the render loop.

    Declaration
    public virtual void DrawDataPoint(int controlID, Vector3 position, Vector3 direction, Vector3 upDirection, SplineData<T> splineData, int dataPointIndex)
    Parameters
    Type Name Description
    Int32 controlID

    A control ID from controlIDs that represents this handle.

    Vector3 position

    The position of the keyframe data in spline space.

    Vector3 direction

    The direction of the spline at the current keyframe.

    Vector3 upDirection

    The up vector orthogonal to the spline direction at the current keyframe regarding knot rotation.

    SplineData<T> splineData

    The SplineData<T> for which the method is drawing handles.

    Int32 dataPointIndex

    The index of the current keyframe to handle.

    DrawSplineData(SplineData<T>, Spline, Matrix4x4, Color)

    Override this method to create custom handles for SplineData<T>, this method is called before DrawKeyframe in the render loop.

    Declaration
    public virtual void DrawSplineData(SplineData<T> splineData, Spline spline, Matrix4x4 localToWorld, Color color)
    Parameters
    Type Name Description
    SplineData<T> splineData

    The SplineData<T> for which the method is drawing handles.

    Spline spline

    The target Spline associated to the SplineData for the drawing.

    Matrix4x4 localToWorld

    The spline localToWorld Matrix.

    Color color

    The color defined in the SplineData scene interface.

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Monday, April 4, 2022
    Terms of use