235 lines
5.7 KiB
C#
235 lines
5.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine.Animations;
|
|
using UnityEngine.Playables;
|
|
|
|
namespace UnityEngine.Timeline
|
|
{
|
|
// Token: 0x02000026 RID: 38
|
|
[NotKeyable]
|
|
[Serializable]
|
|
public class AnimationPlayableAsset : PlayableAsset, ITimelineClipAsset, IPropertyPreview
|
|
{
|
|
// Token: 0x17000069 RID: 105
|
|
// (get) Token: 0x06000155 RID: 341 RVA: 0x000070D8 File Offset: 0x000052D8
|
|
// (set) Token: 0x06000156 RID: 342 RVA: 0x000070F3 File Offset: 0x000052F3
|
|
public Vector3 position
|
|
{
|
|
get
|
|
{
|
|
return this.m_Position;
|
|
}
|
|
set
|
|
{
|
|
this.m_Position = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700006A RID: 106
|
|
// (get) Token: 0x06000157 RID: 343 RVA: 0x00007100 File Offset: 0x00005300
|
|
// (set) Token: 0x06000158 RID: 344 RVA: 0x0000711B File Offset: 0x0000531B
|
|
public Quaternion rotation
|
|
{
|
|
get
|
|
{
|
|
return this.m_Rotation;
|
|
}
|
|
set
|
|
{
|
|
this.m_Rotation = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700006B RID: 107
|
|
// (get) Token: 0x06000159 RID: 345 RVA: 0x00007128 File Offset: 0x00005328
|
|
// (set) Token: 0x0600015A RID: 346 RVA: 0x00007143 File Offset: 0x00005343
|
|
public bool useTrackMatchFields
|
|
{
|
|
get
|
|
{
|
|
return this.m_UseTrackMatchFields;
|
|
}
|
|
set
|
|
{
|
|
this.m_UseTrackMatchFields = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700006C RID: 108
|
|
// (get) Token: 0x0600015B RID: 347 RVA: 0x00007150 File Offset: 0x00005350
|
|
// (set) Token: 0x0600015C RID: 348 RVA: 0x0000716B File Offset: 0x0000536B
|
|
public MatchTargetFields matchTargetFields
|
|
{
|
|
get
|
|
{
|
|
return this.m_MatchTargetFields;
|
|
}
|
|
set
|
|
{
|
|
this.m_MatchTargetFields = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700006D RID: 109
|
|
// (get) Token: 0x0600015D RID: 349 RVA: 0x00007178 File Offset: 0x00005378
|
|
// (set) Token: 0x0600015E RID: 350 RVA: 0x00007193 File Offset: 0x00005393
|
|
internal bool removeStartOffset
|
|
{
|
|
get
|
|
{
|
|
return this.m_RemoveStartOffset;
|
|
}
|
|
set
|
|
{
|
|
this.m_RemoveStartOffset = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700006E RID: 110
|
|
// (get) Token: 0x0600015F RID: 351 RVA: 0x000071A0 File Offset: 0x000053A0
|
|
// (set) Token: 0x06000160 RID: 352 RVA: 0x000071BB File Offset: 0x000053BB
|
|
public AnimationClip clip
|
|
{
|
|
get
|
|
{
|
|
return this.m_Clip;
|
|
}
|
|
set
|
|
{
|
|
if (value != null)
|
|
{
|
|
base.name = "AnimationPlayableAsset of " + value.name;
|
|
}
|
|
this.m_Clip = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700006F RID: 111
|
|
// (get) Token: 0x06000161 RID: 353 RVA: 0x000071E8 File Offset: 0x000053E8
|
|
public override double duration
|
|
{
|
|
get
|
|
{
|
|
double num;
|
|
if (this.clip == null)
|
|
{
|
|
num = double.MaxValue;
|
|
}
|
|
else
|
|
{
|
|
double num2 = (double)this.clip.length;
|
|
if (this.clip.frameRate > 0f)
|
|
{
|
|
double num3 = (double)Mathf.Round(this.clip.length * this.clip.frameRate);
|
|
num2 = num3 / (double)this.clip.frameRate;
|
|
}
|
|
num = num2;
|
|
}
|
|
return num;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000070 RID: 112
|
|
// (get) Token: 0x06000162 RID: 354 RVA: 0x00007270 File Offset: 0x00005470
|
|
public override IEnumerable<PlayableBinding> outputs
|
|
{
|
|
get
|
|
{
|
|
yield return new PlayableBinding
|
|
{
|
|
streamType = DataStreamType.Animation,
|
|
streamName = "Animation"
|
|
};
|
|
yield break;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06000163 RID: 355 RVA: 0x00007294 File Offset: 0x00005494
|
|
public override Playable CreatePlayable(PlayableGraph graph, GameObject go)
|
|
{
|
|
AnimationClipPlayable animationClipPlayable = AnimationClipPlayable.Create(graph, this.m_Clip);
|
|
this.m_AnimationClipPlayable = animationClipPlayable;
|
|
this.m_AnimationClipPlayable.SetRemoveStartOffset(this.removeStartOffset);
|
|
Playable playable = animationClipPlayable;
|
|
if (this.applyRootMotion)
|
|
{
|
|
AnimationOffsetPlayable animationOffsetPlayable = AnimationOffsetPlayable.Create(graph, this.m_Position, this.m_Rotation, 1);
|
|
graph.Connect<AnimationClipPlayable, AnimationOffsetPlayable>(animationClipPlayable, 0, animationOffsetPlayable, 0);
|
|
playable = animationOffsetPlayable;
|
|
}
|
|
this.LiveLink();
|
|
return playable;
|
|
}
|
|
|
|
// Token: 0x17000071 RID: 113
|
|
// (get) Token: 0x06000164 RID: 356 RVA: 0x00007310 File Offset: 0x00005510
|
|
private bool applyRootMotion
|
|
{
|
|
get
|
|
{
|
|
return this.m_Position != Vector3.zero || this.m_Rotation != Quaternion.identity || (this.m_Clip != null && this.m_Clip.hasRootMotion);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06000165 RID: 357 RVA: 0x00007371 File Offset: 0x00005571
|
|
public void LiveLink()
|
|
{
|
|
}
|
|
|
|
// Token: 0x17000072 RID: 114
|
|
// (get) Token: 0x06000166 RID: 358 RVA: 0x00007374 File Offset: 0x00005574
|
|
public ClipCaps clipCaps
|
|
{
|
|
get
|
|
{
|
|
ClipCaps clipCaps = ClipCaps.All;
|
|
if (this.m_Clip == null || !this.m_Clip.isLooping)
|
|
{
|
|
clipCaps &= ~ClipCaps.Looping;
|
|
}
|
|
return clipCaps;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06000167 RID: 359 RVA: 0x000073B2 File Offset: 0x000055B2
|
|
public void ResetOffsets()
|
|
{
|
|
this.position = Vector3.zero;
|
|
this.rotation = Quaternion.identity;
|
|
}
|
|
|
|
// Token: 0x06000168 RID: 360 RVA: 0x000073CB File Offset: 0x000055CB
|
|
public void GatherProperties(PlayableDirector director, IPropertyCollector driver)
|
|
{
|
|
driver.AddFromClip(this.m_Clip);
|
|
}
|
|
|
|
// Token: 0x0400009D RID: 157
|
|
[SerializeField]
|
|
private AnimationClip m_Clip;
|
|
|
|
// Token: 0x0400009E RID: 158
|
|
[SerializeField]
|
|
private Vector3 m_Position = Vector3.zero;
|
|
|
|
// Token: 0x0400009F RID: 159
|
|
[SerializeField]
|
|
private Quaternion m_Rotation = Quaternion.identity;
|
|
|
|
// Token: 0x040000A0 RID: 160
|
|
[SerializeField]
|
|
private bool m_UseTrackMatchFields = false;
|
|
|
|
// Token: 0x040000A1 RID: 161
|
|
[SerializeField]
|
|
private MatchTargetFields m_MatchTargetFields = MatchTargetFieldConstants.All;
|
|
|
|
// Token: 0x040000A2 RID: 162
|
|
[SerializeField]
|
|
private bool m_RemoveStartOffset = true;
|
|
|
|
// Token: 0x040000A3 RID: 163
|
|
private AnimationClipPlayable m_AnimationClipPlayable;
|
|
}
|
|
}
|