Version: 2022.3
LanguageEnglish
  • C#

AnimationCurve

class in UnityEngine

/

Implemented in:UnityEngine.CoreModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Store a collection of Keyframes that can be evaluated over time.

Properties

keysAll keys defined in the animation curve.
lengthThe number of keys in the curve. (Read Only)
postWrapModeThe behaviour of the animation after the last keyframe.
preWrapModeThe behaviour of the animation before the first keyframe.
this[int]Retrieves the key at index. (Read Only)

Constructors

AnimationCurveCreates an animation curve from an arbitrary number of keyframes.

Public Methods

AddKeyAdd a new key to the curve.
ClearKeysErases all KeyFrame from this instance of the AnimationCurve.
CopyFromCopies the keys and properties of the specified AnimationCurve object into this instance of the AnimationCurve class.
EvaluateEvaluate the curve at time.
GetHashCodeA HashCode for the animation curve, computed using all individual Keyframe.
MoveKeyMoves the key at index to key.time and key.value.
RemoveKeyRemoves a key.
SmoothTangentsSmooth the in and out tangents of the keyframe at index.

Static Methods

ConstantCreates a constant "curve" starting at timeStart, ending at timeEnd, and set to the value value.
EaseInOutCreates an ease-in and out curve starting at timeStart, valueStart and ending at timeEnd, valueEnd.
LinearA straight Line starting at timeStart, valueStart and ending at timeEnd, valueEnd.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961