Class TimelineClip
Represents a clip on the timeline.
Inherited Members
Namespace: UnityEngine.Timeline
Syntax
[Serializable]
public class TimelineClip : ICurvesOwner, ISerializationCallbackReceiver
Fields
kDefaultClipCaps
The default capabilities for a clip
Declaration
public static readonly ClipCaps kDefaultClipCaps
Field Value
Type | Description |
---|---|
ClipCaps |
kDefaultClipDurationInSeconds
The default length of a clip in seconds.
Declaration
public static readonly float kDefaultClipDurationInSeconds
Field Value
Type | Description |
---|---|
Single |
kTimeScaleMax
The maximum timescale allowed on a clip
Declaration
public static readonly double kTimeScaleMax
Field Value
Type | Description |
---|---|
Double |
kTimeScaleMin
The minimum timescale allowed on a clip
Declaration
public static readonly double kTimeScaleMin
Field Value
Type | Description |
---|---|
Double |
Properties
animationClip
If this contains an animation asset, returns the animation clip attached. Otherwise returns null.
Declaration
public AnimationClip animationClip { get; }
Property Value
Type | Description |
---|---|
AnimationClip |
asset
The PlayableAsset attached to the clip.
Declaration
public Object asset { get; set; }
Property Value
Type | Description |
---|---|
Object |
blendInCurveMode
The mode for calculating the blend curve of the overlap at the start of the clip
Declaration
public TimelineClip.BlendCurveMode blendInCurveMode { get; set; }
Property Value
Type | Description |
---|---|
TimelineClip.BlendCurveMode |
blendInDuration
The amount of overlap in seconds on the start of a clip.
Declaration
public double blendInDuration { get; set; }
Property Value
Type | Description |
---|---|
Double |
blendOutCurveMode
The mode for calculating the blend curve of the overlap at the end of the clip
Declaration
public TimelineClip.BlendCurveMode blendOutCurveMode { get; set; }
Property Value
Type | Description |
---|---|
TimelineClip.BlendCurveMode |
blendOutDuration
The amount of overlap in seconds at the end of a clip.
Declaration
public double blendOutDuration { get; set; }
Property Value
Type | Description |
---|---|
Double |
clipAssetDuration
The length, in seconds, of the PlayableAsset attached to the clip.
Declaration
public double clipAssetDuration { get; }
Property Value
Type | Description |
---|---|
Double |
clipCaps
Returns the capabilities supported by this clip.
Declaration
public ClipCaps clipCaps { get; }
Property Value
Type | Description |
---|---|
ClipCaps |
clipIn
Local offset time of the clip.
Declaration
public double clipIn { get; set; }
Property Value
Type | Description |
---|---|
Double |
curves
An animation clip containing animated properties of the attached PlayableAsset
Declaration
public AnimationClip curves { get; }
Property Value
Type | Description |
---|---|
AnimationClip |
Remarks
This is where animated clip properties are stored.
displayName
The name displayed on the clip
Declaration
public string displayName { get; set; }
Property Value
Type | Description |
---|---|
String |
duration
The length, in seconds, of the clip
Declaration
public double duration { get; set; }
Property Value
Type | Description |
---|---|
Double |
easeInDuration
The ease in duration of the timeline clip in seconds. This only applies if the start of the clip is not overlapping.
Declaration
public double easeInDuration { get; set; }
Property Value
Type | Description |
---|---|
Double |
easeOutDuration
The ease out duration of the timeline clip in seconds. This only applies if the end of the clip is not overlapping.
Declaration
public double easeOutDuration { get; set; }
Property Value
Type | Description |
---|---|
Double |
easeOutTime
The time in seconds that the ease out begins
Declaration
public double easeOutTime { get; }
Property Value
Type | Description |
---|---|
Double |
eastOutTime
eastOutTime property is obsolete use easeOutTime property instead
Declaration
[Obsolete("Use easeOutTime instead (UnityUpgradable) -> easeOutTime", true)]
public double eastOutTime { get; }
Property Value
Type | Description |
---|---|
Double |
end
The end time, in seconds of the clip
Declaration
public double end { get; }
Property Value
Type | Description |
---|---|
Double |
exposedParameters
exposedParameter is deprecated and will be removed in a future release
Declaration
[Obsolete("exposedParameter is deprecated and will be removed in a future release", true)]
public List<string> exposedParameters { get; }
Property Value
Type | Description |
---|---|
List<String> |
extrapolatedDuration
The length of the clip in seconds, including extrapolation.
Declaration
public double extrapolatedDuration { get; }
Property Value
Type | Description |
---|---|
Double |
extrapolatedStart
The start time of the clip, accounting for pre-extrapolation
Declaration
public double extrapolatedStart { get; }
Property Value
Type | Description |
---|---|
Double |
hasBlendIn
Returns whether the clip is blending in
Declaration
public bool hasBlendIn { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasBlendOut
Returns whether the clip is blending out
Declaration
public bool hasBlendOut { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasCurves
Whether this clip contains animated properties for the attached PlayableAsset.
Declaration
public bool hasCurves { get; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
This property is false if the curves property is null or if it contains no information.
hasPostExtrapolation
Is the clip being extrapolated past its end time?
Declaration
public bool hasPostExtrapolation { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasPreExtrapolation
Is the clip being extrapolated before its start time?
Declaration
public bool hasPreExtrapolation { get; }
Property Value
Type | Description |
---|---|
Boolean |
mixInCurve
The animation curve used for calculating weights during an ease in or a blend in.
Declaration
public AnimationCurve mixInCurve { get; set; }
Property Value
Type | Description |
---|---|
AnimationCurve |
mixInDuration
The amount of the clip blending or easing in, in seconds
Declaration
public double mixInDuration { get; }
Property Value
Type | Description |
---|---|
Double |
mixInPercentage
The amount of the clip being used for ease or blend in as a percentage
Declaration
public float mixInPercentage { get; }
Property Value
Type | Description |
---|---|
Single |
mixOutCurve
The animation curve used for calculating weights during an ease out or a blend out.
Declaration
public AnimationCurve mixOutCurve { get; set; }
Property Value
Type | Description |
---|---|
AnimationCurve |
mixOutDuration
The amount of the clip blending or easing out, in seconds
Declaration
public double mixOutDuration { get; }
Property Value
Type | Description |
---|---|
Double |
mixOutPercentage
The amount of the clip being used for ease or blend out as a percentage
Declaration
public float mixOutPercentage { get; }
Property Value
Type | Description |
---|---|
Single |
mixOutTime
The time in seconds that an ease out or blend out starts
Declaration
public double mixOutTime { get; }
Property Value
Type | Description |
---|---|
Double |
parentTrack
Returns the TrackAsset to which this clip is attached.
Declaration
[Obsolete("parentTrack is deprecated and will be removed in a future release. Use GetParentTrack() and TimelineClipExtensions::MoveToTrack() or TimelineClipExtensions::TryMoveToTrack() instead.", false)]
public TrackAsset parentTrack { get; set; }
Property Value
Type | Description |
---|---|
TrackAsset |
postExtrapolationMode
Returns whether the clip is being extrapolated past the end time.
Declaration
public TimelineClip.ClipExtrapolation postExtrapolationMode { get; }
Property Value
Type | Description |
---|---|
TimelineClip.ClipExtrapolation |
preExtrapolationMode
Returns whether the clip is being extrapolated before the start time.
Declaration
public TimelineClip.ClipExtrapolation preExtrapolationMode { get; }
Property Value
Type | Description |
---|---|
TimelineClip.ClipExtrapolation |
recordable
Returns whether this clip is recordable in editor
Declaration
public bool recordable { get; }
Property Value
Type | Description |
---|---|
Boolean |
start
The start time, in seconds, of the clip
Declaration
public double start { get; set; }
Property Value
Type | Description |
---|---|
Double |
timeScale
A speed multiplier for the clip;
Declaration
public double timeScale { get; set; }
Property Value
Type | Description |
---|---|
Double |
underlyingAsset
underlyingAsset property is obsolete. Use asset property instead
Declaration
[Obsolete("underlyingAsset property is obsolete. Use asset property instead", true)]
public Object underlyingAsset { get; set; }
Property Value
Type | Description |
---|---|
Object |
Methods
ConformEaseValues()
Use this method to adjust ease in and ease out values to avoid overlapping.
Declaration
public void ConformEaseValues()
Remarks
Ease values will be adjusted to respect the ratio between ease in and ease out.
CreateCurves(String)
Creates an AnimationClip to store animated properties for the attached PlayableAsset.
Declaration
public void CreateCurves(string curvesClipName)
Parameters
Type | Name | Description |
---|---|---|
String | curvesClipName | The name of the AnimationClip to create. This method does not ensure unique names. If you want a unique clip name, you must provide one. See ObjectNames.GetUniqueName for information on a method that creates unique names. |
Remarks
If curves already exists for this clip, this method produces no result regardless of the value specified for curvesClipName.
EvaluateMixIn(Double)
Given a time, returns the weight from the mix in
Declaration
public float EvaluateMixIn(double time)
Parameters
Type | Name | Description |
---|---|---|
Double | time | Time (relative to the timeline) |
Returns
Type | Description |
---|---|
Single |
EvaluateMixOut(Double)
Given a time, returns the weight from the mix out
Declaration
public float EvaluateMixOut(double time)
Parameters
Type | Name | Description |
---|---|---|
Double | time | Time (relative to the timeline) |
Returns
Type | Description |
---|---|
Single |
GetParentTrack()
Get the TrackAsset to which this clip is attached.
Declaration
public TrackAsset GetParentTrack()
Returns
Type | Description |
---|---|
TrackAsset | the parent TrackAsset |
IsExtrapolatedTime(Double)
Given a time, returns whether it falls within the clip's extrapolation
Declaration
public bool IsExtrapolatedTime(double sequenceTime)
Parameters
Type | Name | Description |
---|---|---|
Double | sequenceTime | The time relative to the timeline |
Returns
Type | Description |
---|---|
Boolean | True if |
IsPostExtrapolatedTime(Double)
Given a time, returns whether it falls within the clip's post-extrapolation
Declaration
public bool IsPostExtrapolatedTime(double sequenceTime)
Parameters
Type | Name | Description |
---|---|---|
Double | sequenceTime | The time relative to the timeline |
Returns
Type | Description |
---|---|
Boolean | True if |
IsPreExtrapolatedTime(Double)
Given a time, returns whether it falls within the clip's pre-extrapolation
Declaration
public bool IsPreExtrapolatedTime(double sequenceTime)
Parameters
Type | Name | Description |
---|---|---|
Double | sequenceTime | The time relative to the timeline |
Returns
Type | Description |
---|---|
Boolean | True if |
ToLocalTime(Double)
Converts from global time to a clips local time.
Declaration
public double ToLocalTime(double time)
Parameters
Type | Name | Description |
---|---|---|
Double | time | time relative to the timeline |
Returns
Type | Description |
---|---|
Double | The local time with extrapolation applied |
ToLocalTimeUnbound(Double)
Converts from global time to local time of the clip
Declaration
public double ToLocalTimeUnbound(double time)
Parameters
Type | Name | Description |
---|---|---|
Double | time | The time relative to the timeline |
Returns
Type | Description |
---|---|
Double | The local time, ignoring any extrapolation or bounds |
ToString()
Outputs a more readable representation of the timeline clip as a string
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
Explicit Interface Implementations
ISerializationCallbackReceiver.OnAfterDeserialize()
Called after Unity deserializes this object.
Declaration
void ISerializationCallbackReceiver.OnAfterDeserialize()
Implements
ISerializationCallbackReceiver.OnBeforeSerialize()
Called before Unity serializes this object.
Declaration
void ISerializationCallbackReceiver.OnBeforeSerialize()