docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class EmbeddedSplineData

    Wrapper for accessing a SplineData<T> value stored on Spline through one of the embedded key value collections. It is not required to use this class to access embedded SplineData<T>, however it does provide some convenient functionality for working with this data in the Inspector.

    Inheritance
    object
    EmbeddedSplineData
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Splines
    Assembly: Unity.Splines.dll
    Syntax
    [Serializable]
    public class EmbeddedSplineData

    Constructors

    EmbeddedSplineData()

    Create a new EmbeddedSplineData instance with no parameters.

    Declaration
    public EmbeddedSplineData()
    See Also
    EmbeddedSplineDataFieldsAttribute
    GetOrCreateFloatData(string)
    GetOrCreateFloat4Data(string)
    GetOrCreateIntData(string)
    GetOrCreateObjectData(string)

    EmbeddedSplineData(string, EmbeddedSplineDataType, SplineContainer, int)

    Create a new EmbeddedSplineData with parameters.

    Declaration
    public EmbeddedSplineData(string key, EmbeddedSplineDataType type, SplineContainer container = null, int splineIndex = 0)
    Parameters
    Type Name Description
    string key

    A unique string value used to identify and access a SplineData<T> collection stored in a Spline.

    EmbeddedSplineDataType type

    The type of data stored by the SplineData<T> collection.

    SplineContainer container

    The SplineContainer that holds the Spline.

    int splineIndex

    The index of the Spline on the SplineContainer.

    See Also
    EmbeddedSplineDataFieldsAttribute
    GetOrCreateFloatData(string)
    GetOrCreateFloat4Data(string)
    GetOrCreateIntData(string)
    GetOrCreateObjectData(string)

    Properties

    Container

    The SplineContainer that holds the Spline.

    Declaration
    public SplineContainer Container { get; set; }
    Property Value
    Type Description
    SplineContainer
    See Also
    EmbeddedSplineDataFieldsAttribute
    GetOrCreateFloatData(string)
    GetOrCreateFloat4Data(string)
    GetOrCreateIntData(string)
    GetOrCreateObjectData(string)

    Key

    A unique string value used to identify and access a SplineData<T> collection stored in a Spline.

    Declaration
    public string Key { get; set; }
    Property Value
    Type Description
    string
    See Also
    EmbeddedSplineDataFieldsAttribute
    GetOrCreateFloatData(string)
    GetOrCreateFloat4Data(string)
    GetOrCreateIntData(string)
    GetOrCreateObjectData(string)

    SplineIndex

    The index of the Spline on the SplineContainer.

    Declaration
    public int SplineIndex { get; set; }
    Property Value
    Type Description
    int
    See Also
    EmbeddedSplineDataFieldsAttribute
    GetOrCreateFloatData(string)
    GetOrCreateFloat4Data(string)
    GetOrCreateIntData(string)
    GetOrCreateObjectData(string)

    Type

    The type of data stored by the SplineData<T> collection. Embedded SplineData<T> is restricted to a pre-defined set of primitive types.

    Declaration
    public EmbeddedSplineDataType Type { get; set; }
    Property Value
    Type Description
    EmbeddedSplineDataType
    See Also
    EmbeddedSplineDataFieldsAttribute
    GetOrCreateFloatData(string)
    GetOrCreateFloat4Data(string)
    GetOrCreateIntData(string)
    GetOrCreateObjectData(string)

    Methods

    GetOrCreateFloat4Data()

    Returns a SplineData<T> for Key and Type. If an instance matching the key and type does not exist, a new entry is appended to the internal collection and returned. Note that this is a reference to the stored SplineData<T>, not a copy. Any modifications to this collection will affect the Spline data.

    Declaration
    public SplineData<float4> GetOrCreateFloat4Data()
    Returns
    Type Description
    SplineData<float4>

    A SplineData<T> of the requested type.

    Exceptions
    Type Condition
    InvalidCastException

    An exception is thrown if the requested SplineData<T> does not match the EmbeddedSplineDataType.

    See Also
    EmbeddedSplineDataFieldsAttribute
    GetOrCreateFloatData(string)
    GetOrCreateFloat4Data(string)
    GetOrCreateIntData(string)
    GetOrCreateObjectData(string)

    GetOrCreateFloatData()

    Returns a SplineData<T> for Key and Type. If an instance matching the key and type does not exist, a new entry is appended to the internal collection and returned. Note that this is a reference to the stored SplineData<T>, not a copy. Any modifications to this collection will affect the Spline data.

    Declaration
    public SplineData<float> GetOrCreateFloatData()
    Returns
    Type Description
    SplineData<float>

    A SplineData<T> of the requested type.

    Exceptions
    Type Condition
    InvalidCastException

    An exception is thrown if the requested SplineData<T> does not match the EmbeddedSplineDataType.

    See Also
    EmbeddedSplineDataFieldsAttribute
    GetOrCreateFloatData(string)
    GetOrCreateFloat4Data(string)
    GetOrCreateIntData(string)
    GetOrCreateObjectData(string)

    GetOrCreateIntData()

    Returns a SplineData<T> for Key and Type. If an instance matching the key and type does not exist, a new entry is appended to the internal collection and returned. Note that this is a reference to the stored SplineData<T>, not a copy. Any modifications to this collection will affect the Spline data.

    Declaration
    public SplineData<int> GetOrCreateIntData()
    Returns
    Type Description
    SplineData<int>

    A SplineData<T> of the requested type.

    Exceptions
    Type Condition
    InvalidCastException

    An exception is thrown if the requested SplineData<T> does not match the EmbeddedSplineDataType.

    See Also
    EmbeddedSplineDataFieldsAttribute
    GetOrCreateFloatData(string)
    GetOrCreateFloat4Data(string)
    GetOrCreateIntData(string)
    GetOrCreateObjectData(string)

    GetOrCreateObjectData()

    Returns a SplineData<T> for Key and Type. If an instance matching the key and type does not exist, a new entry is appended to the internal collection and returned. Note that this is a reference to the stored SplineData<T>, not a copy. Any modifications to this collection will affect the Spline data.

    Declaration
    public SplineData<Object> GetOrCreateObjectData()
    Returns
    Type Description
    SplineData<Object>

    A SplineData<T> of the requested type.

    Exceptions
    Type Condition
    InvalidCastException

    An exception is thrown if the requested SplineData<T> does not match the EmbeddedSplineDataType.

    See Also
    EmbeddedSplineDataFieldsAttribute
    GetOrCreateFloatData(string)
    GetOrCreateFloat4Data(string)
    GetOrCreateIntData(string)
    GetOrCreateObjectData(string)

    TryGetFloat4Data(out SplineData<float4>)

    Attempt to get a reference to the SplineData<T> described by this object.

    Declaration
    public bool TryGetFloat4Data(out SplineData<float4> data)
    Parameters
    Type Name Description
    SplineData<float4> data

    A SplineData<T> reference if the Container, SplineIndex, Key, and Type are valid, otherwise null.

    Returns
    Type Description
    bool

    Returns true if a SplineData<T> value exists, otherwise false.

    Exceptions
    Type Condition
    InvalidCastException

    An exception is thrown if the requested SplineData<T> does not match the EmbeddedSplineDataType.

    See Also
    EmbeddedSplineDataFieldsAttribute
    GetOrCreateFloatData(string)
    GetOrCreateFloat4Data(string)
    GetOrCreateIntData(string)
    GetOrCreateObjectData(string)

    TryGetFloatData(out SplineData<float>)

    Attempt to get a reference to the SplineData<T> described by this object.

    Declaration
    public bool TryGetFloatData(out SplineData<float> data)
    Parameters
    Type Name Description
    SplineData<float> data

    A SplineData<T> reference if the Container, SplineIndex, Key, and Type are valid, otherwise null.

    Returns
    Type Description
    bool

    Returns true if a SplineData<T> value exists, otherwise false.

    Exceptions
    Type Condition
    InvalidCastException

    An exception is thrown if the requested SplineData<T> does not match the EmbeddedSplineDataType.

    See Also
    EmbeddedSplineDataFieldsAttribute
    GetOrCreateFloatData(string)
    GetOrCreateFloat4Data(string)
    GetOrCreateIntData(string)
    GetOrCreateObjectData(string)

    TryGetIntData(out SplineData<int>)

    Attempt to get a reference to the SplineData<T> described by this object.

    Declaration
    public bool TryGetIntData(out SplineData<int> data)
    Parameters
    Type Name Description
    SplineData<int> data

    A SplineData<T> reference if the Container, SplineIndex, Key, and Type are valid, otherwise null.

    Returns
    Type Description
    bool

    Returns true if a SplineData<T> value exists, otherwise false.

    Exceptions
    Type Condition
    InvalidCastException

    An exception is thrown if the requested SplineData<T> does not match the EmbeddedSplineDataType.

    See Also
    EmbeddedSplineDataFieldsAttribute
    GetOrCreateFloatData(string)
    GetOrCreateFloat4Data(string)
    GetOrCreateIntData(string)
    GetOrCreateObjectData(string)

    TryGetObjectData(out SplineData<Object>)

    Attempt to get a reference to the SplineData<T> described by this object.

    Declaration
    public bool TryGetObjectData(out SplineData<Object> data)
    Parameters
    Type Name Description
    SplineData<Object> data

    A SplineData<T> reference if the Container, SplineIndex, Key, and Type are valid, otherwise null.

    Returns
    Type Description
    bool

    Returns true if a SplineData<T> value exists, otherwise false.

    Exceptions
    Type Condition
    InvalidCastException

    An exception is thrown if the requested SplineData<T> does not match the EmbeddedSplineDataType.

    See Also
    EmbeddedSplineDataFieldsAttribute
    GetOrCreateFloatData(string)
    GetOrCreateFloat4Data(string)
    GetOrCreateIntData(string)
    GetOrCreateObjectData(string)

    TryGetSpline(out Spline)

    Attempt to get a reference to the Spline described by this object.

    Declaration
    public bool TryGetSpline(out Spline spline)
    Parameters
    Type Name Description
    Spline spline

    A Spline if the Container and SplineIndex are valid, otherwise null.

    Returns
    Type Description
    bool

    Returns true if the Container and SplineIndex are valid, otherwise false.

    See Also
    EmbeddedSplineDataFieldsAttribute
    GetOrCreateFloatData(string)
    GetOrCreateFloat4Data(string)
    GetOrCreateIntData(string)
    GetOrCreateObjectData(string)

    See Also

    EmbeddedSplineDataFieldsAttribute
    GetOrCreateFloatData(string)
    GetOrCreateFloat4Data(string)
    GetOrCreateIntData(string)
    GetOrCreateObjectData(string)
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)