MoveKey(int, Keyframe)
Moves the key at index to /key.time/ and /key.value/.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
public int MoveKey(int index, Keyframe key)
Parameters
Returns
Type | Description |
|---|---|
| int | The index of the keyframe after it is moved. |
Remarks
This method removes the keyframe at and inserts the updated at the correctly sorted position in AnimationCurve.keys.
indexkeyUse this method to move a keyframe in two dimensions: time and value.
To use this method as intended, use AnimationCurve.keys to acquire the keyframe, modify the value and/or time, then invoke this method with the updated keyframe. If you use this method with a different keyframe, this method replaces the keyframe with a new one.
AnimationCurve does not support two keys with the same time. If /key.time/ is the same as another keyframe, is reinserted at the time of the keyframe at . This cancels the move operation in the time dimension and keeps the modification in the value dimension.
keyindexSee Also: AnimationCurve.keys