Struct Keyframe<T>
A pair containing an interpolation ratio and {T} value.
Namespace: UnityEngine.Splines
Syntax
[Serializable]
public struct Keyframe<T> : IComparable<Keyframe<T>>, IComparable<float>, IKeyframe
Type Parameters
Name | Description |
---|---|
T | The type of data this keyframe stores. |
Constructors
Keyframe(Single, T)
Create a new Keyframe with interpolation ratio and value.
Declaration
public Keyframe(float t, T value)
Parameters
Type | Name | Description |
---|---|---|
Single | t | Interpolation ratio. |
T | value | The value to store. |
Properties
Time
The interpolation ratio relative to a spline. How this value is interpolated depends on the PathIndexUnit specified by SplineData<T>.
Declaration
public float Time { get; set; }
Property Value
Type | Description |
---|---|
Single |
Implements
Value
A value to store with this keyframe.
Declaration
public T Value { get; set; }
Property Value
Type | Description |
---|---|
T |
Methods
CompareTo(Single)
Compare keyframe Time 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.Time is greater than Time, 0 if time values are equal, and greater than 0 when other.Time is less than Time. |
CompareTo(Keyframe<T>)
Compare keyframe Time values.
Declaration
public int CompareTo(Keyframe<T> other)
Parameters
Type | Name | Description |
---|---|---|
Keyframe<T> | other | The Keyframe to compare against. |
Returns
Type | Description |
---|---|
Int32 | An integer less than 0 if other.Time is greater than Time, 0 if time values are equal, and greater than 0 when other.Time is less than Time. |
ToString()
A summary of the keyframe time and value.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A summary of the keyframe time and value. |