Struct DataPoint<TDataType>
A pair containing an interpolation ratio and {TDataType} value.
Inherited Members
Namespace: UnityEngine.Splines
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(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
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. |
Implements
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. |
Implements
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. |