Struct DataPoint<TDataType>
A pair containing an interpolation ratio and {TDataType} value.
Inherited Members
Namespace: UnityEngine.Splines
Assembly: Unity.Splines.dll
Syntax
[Serializable]
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(float, TDataType)
Create a new Data Point with interpolation ratio and value.
Declaration
public DataPoint(float index, TDataType value)
Parameters
Type | Name | Description |
---|---|---|
float | 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 |
---|---|
float |
Value
A value to store with this Data Point.
Declaration
public TDataType Value { get; set; }
Property Value
Type | Description |
---|---|
TDataType |
Methods
CompareTo(float)
Compare DataPoint Index values.
Declaration
public int CompareTo(float other)
Parameters
Type | Name | Description |
---|---|---|
float | other | An interpolation ratio to compare against. |
Returns
Type | Description |
---|---|
int | 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 |
---|---|
int | 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. |