docs.unity3d.com
    Show / Hide Table of Contents

    Struct DataPoint<TDataType>

    A pair containing an interpolation ratio and {TDataType} value.

    Namespace: UnityEngine.Splines
    Syntax
    public struct DataPoint<TDataType> : IComparable<DataPoint<TDataType>>, IComparable<float>, IDataPoint
    Type Parameters
    Name Description
    TDataType

    The type of data this data point stores.

    Constructors

    DataPoint(Single, TDataType)

    Create a new Data Point with interpolation ratio and value.

    Declaration
    public DataPoint(float index, TDataType value)
    Parameters
    Type Name Description
    Single index

    Interpolation ratio.

    TDataType value

    The value to store.

    Properties

    Index

    The interpolation ratio relative to a spline. How this value is interpolated depends on the PathIndexUnit specified by SplineData<T>.

    Declaration
    public float Index { get; set; }
    Property Value
    Type Description
    Single
    Implements
    IDataPoint.Index

    Value

    A value to store with this Data Point.

    Declaration
    public TDataType Value { get; set; }
    Property Value
    Type Description
    TDataType

    Methods

    CompareTo(Single)

    Compare DataPoint Index values.

    Declaration
    public int CompareTo(float other)
    Parameters
    Type Name Description
    Single other

    An interpolation ratio to compare against.

    Returns
    Type Description
    Int32

    An integer less than 0 if other.Key is greater than Index, 0 if key values are equal, and greater than 0 when other.Key is less than Index.

    CompareTo(DataPoint<TDataType>)

    Compare DataPoint Index values.

    Declaration
    public int CompareTo(DataPoint<TDataType> other)
    Parameters
    Type Name Description
    DataPoint<TDataType> other

    The DataPoint to compare against.

    Returns
    Type Description
    Int32

    An integer less than 0 if other.Key is greater than Index, 0 if key values are equal, and greater than 0 when other.Key is less than Index.

    ToString()

    A summary of the DataPoint time and value.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    A summary of the DataPoint key and value.

    In This Article
    • Constructors
      • DataPoint(Single, TDataType)
    • Properties
      • Index
      • Value
    • Methods
      • CompareTo(Single)
      • CompareTo(DataPoint<TDataType>)
      • ToString()
    Back to top
    Terms of use
    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