docs.unity.cn
    Show / Hide Table of Contents

    Class EditorSplineUtility

    Editor utility functions for working with Spline and SplineData<T>.

    Inheritance
    Object
    EditorSplineUtility
    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 EditorSplineUtility

    Properties

    DefaultTangentMode

    Represents the default TangentMode used to place or insert knots. If the user does not define tangent handles, then the tangent takes the default TangentMode.

    Declaration
    public static TangentMode DefaultTangentMode { get; }
    Property Value
    Type Description
    TangentMode

    Methods

    CopySplineDataIfEmpty(ISplineContainer, Int32, Int32, EmbeddedSplineDataType, String)

    Copy an embedded SplineData<T> collection to a new Spline if the destination does not already contain an entry matching the type and key.

    Declaration
    public static bool CopySplineDataIfEmpty(ISplineContainer container, int source, int destination, EmbeddedSplineDataType type, string key)
    Parameters
    Type Name Description
    ISplineContainer container
    Int32 source

    The index of the Spline in the container to copy data from.

    Int32 destination

    The index of the Spline in the container to copy data to.

    EmbeddedSplineDataType type

    The EmbeddedSplineDataType.

    String key

    A string value used to identify and access a SplineData<T>.

    Returns
    Type Description
    Boolean

    True if data was copied, otherwise false.

    RegisterSplineDataChanged<T>(Action<SplineData<T>>)

    Use this function to register a callback that gets invoked once per-frame if any SplineData<T> changes occur.

    Declaration
    public static void RegisterSplineDataChanged<T>(Action<SplineData<T>> action)
    Parameters
    Type Name Description
    Action<SplineData<T>> action

    The callback to register.

    Type Parameters
    Name Description
    T

    The type parameter of SplineData<T>.

    SetKnotPlacementTool()

    Sets the current active context to the SplineToolContext and the current active tool to the Draw Splines Tool (UnityEditor.Splines.KnotPlacementTool)

    Declaration
    public static void SetKnotPlacementTool()

    UnregisterSplineDataChanged<T>(Action<SplineData<T>>)

    Use this function to unregister SplineData<T> change callback.

    Declaration
    public static void UnregisterSplineDataChanged<T>(Action<SplineData<T>> action)
    Parameters
    Type Name Description
    Action<SplineData<T>> action

    The callback to unregister.

    Type Parameters
    Name Description
    T

    The type parameter of SplineData<T>.

    Events

    AfterSplineWasModified

    Invoked once per-frame if a spline property has been modified.

    Declaration
    public static event Action<Spline> AfterSplineWasModified
    Event Type
    Type Description
    Action<Spline>
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, August 2, 2023