This commit is contained in:
niko
2026-06-04 11:42:34 +02:00
parent f39ba70a9f
commit e720b98cd1
7488 changed files with 2493818 additions and 0 deletions
@@ -0,0 +1,125 @@
using System;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x02000030 RID: 48
public class ActivationControlPlayable : PlayableBehaviour
{
// Token: 0x060001B5 RID: 437 RVA: 0x0000931C File Offset: 0x0000751C
public static ScriptPlayable<ActivationControlPlayable> Create(PlayableGraph graph, GameObject gameObject, ActivationControlPlayable.PostPlaybackState postPlaybackState)
{
ScriptPlayable<ActivationControlPlayable> scriptPlayable;
if (gameObject == null)
{
scriptPlayable = ScriptPlayable<ActivationControlPlayable>.Null;
}
else
{
ScriptPlayable<ActivationControlPlayable> scriptPlayable2 = ScriptPlayable<ActivationControlPlayable>.Create(graph, 0);
ActivationControlPlayable behaviour = scriptPlayable2.GetBehaviour();
behaviour.gameObject = gameObject;
behaviour.postPlayback = postPlaybackState;
scriptPlayable = scriptPlayable2;
}
return scriptPlayable;
}
// Token: 0x060001B6 RID: 438 RVA: 0x00009367 File Offset: 0x00007567
public override void OnBehaviourPlay(Playable playable, FrameData info)
{
if (!(this.gameObject == null))
{
this.gameObject.SetActive(true);
}
}
// Token: 0x060001B7 RID: 439 RVA: 0x0000938C File Offset: 0x0000758C
public override void OnBehaviourPause(Playable playable, FrameData info)
{
if (!(this.gameObject == null))
{
this.gameObject.SetActive(false);
}
}
// Token: 0x060001B8 RID: 440 RVA: 0x000093B1 File Offset: 0x000075B1
public override void ProcessFrame(Playable playable, FrameData info, object userData)
{
if (this.gameObject != null)
{
this.gameObject.SetActive(true);
}
}
// Token: 0x060001B9 RID: 441 RVA: 0x000093D1 File Offset: 0x000075D1
public override void OnGraphStart(Playable playable)
{
if (this.gameObject != null)
{
if (this.m_InitialState == ActivationControlPlayable.InitialState.Unset)
{
this.m_InitialState = ((!this.gameObject.activeSelf) ? ActivationControlPlayable.InitialState.Inactive : ActivationControlPlayable.InitialState.Active);
}
}
}
// Token: 0x060001BA RID: 442 RVA: 0x00009410 File Offset: 0x00007610
public override void OnGraphStop(Playable playable)
{
if (!(this.gameObject == null) && this.m_InitialState != ActivationControlPlayable.InitialState.Unset)
{
ActivationControlPlayable.PostPlaybackState postPlaybackState = this.postPlayback;
if (postPlaybackState != ActivationControlPlayable.PostPlaybackState.Active)
{
if (postPlaybackState != ActivationControlPlayable.PostPlaybackState.Inactive)
{
if (postPlaybackState == ActivationControlPlayable.PostPlaybackState.Revert)
{
this.gameObject.SetActive(this.m_InitialState == ActivationControlPlayable.InitialState.Active);
}
}
else
{
this.gameObject.SetActive(false);
}
}
else
{
this.gameObject.SetActive(true);
}
}
}
// Token: 0x040000CC RID: 204
public GameObject gameObject = null;
// Token: 0x040000CD RID: 205
public ActivationControlPlayable.PostPlaybackState postPlayback = ActivationControlPlayable.PostPlaybackState.Revert;
// Token: 0x040000CE RID: 206
private ActivationControlPlayable.InitialState m_InitialState;
// Token: 0x02000031 RID: 49
public enum PostPlaybackState
{
// Token: 0x040000D0 RID: 208
Active,
// Token: 0x040000D1 RID: 209
Inactive,
// Token: 0x040000D2 RID: 210
Revert
}
// Token: 0x02000032 RID: 50
private enum InitialState
{
// Token: 0x040000D4 RID: 212
Unset,
// Token: 0x040000D5 RID: 213
Active,
// Token: 0x040000D6 RID: 214
Inactive
}
}
}
@@ -0,0 +1,97 @@
using System;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x02000020 RID: 32
internal class ActivationMixerPlayable : PlayableBehaviour
{
// Token: 0x17000064 RID: 100
// (get) Token: 0x0600013D RID: 317 RVA: 0x00006AF0 File Offset: 0x00004CF0
// (set) Token: 0x0600013E RID: 318 RVA: 0x00006B0A File Offset: 0x00004D0A
public GameObject boundGameObject { get; set; }
// Token: 0x0600013F RID: 319 RVA: 0x00006B14 File Offset: 0x00004D14
public static ScriptPlayable<ActivationMixerPlayable> Create(PlayableGraph graph, int inputCount)
{
return ScriptPlayable<ActivationMixerPlayable>.Create(graph, inputCount);
}
// Token: 0x17000065 RID: 101
// (get) Token: 0x06000140 RID: 320 RVA: 0x00006B30 File Offset: 0x00004D30
// (set) Token: 0x06000141 RID: 321 RVA: 0x00006B4B File Offset: 0x00004D4B
public ActivationTrack.PostPlaybackState postPlaybackState
{
get
{
return this.m_PostPlaybackState;
}
set
{
this.m_PostPlaybackState = value;
}
}
// Token: 0x06000142 RID: 322 RVA: 0x00006B55 File Offset: 0x00004D55
public override void OnGraphStart(Playable playable)
{
if (this.boundGameObject != null)
{
this.m_BoundGameObjectInitialStateIsActive = this.boundGameObject.activeInHierarchy;
}
}
// Token: 0x06000143 RID: 323 RVA: 0x00006B7C File Offset: 0x00004D7C
public override void OnGraphStop(Playable playable)
{
if (!(this.boundGameObject == null))
{
if (!Application.isPlaying)
{
this.boundGameObject.SetActive(this.m_BoundGameObjectInitialStateIsActive);
}
else
{
switch (this.m_PostPlaybackState)
{
case ActivationTrack.PostPlaybackState.Active:
this.boundGameObject.SetActive(true);
break;
case ActivationTrack.PostPlaybackState.Inactive:
this.boundGameObject.SetActive(false);
break;
case ActivationTrack.PostPlaybackState.Revert:
this.boundGameObject.SetActive(this.m_BoundGameObjectInitialStateIsActive);
break;
}
}
}
}
// Token: 0x06000144 RID: 324 RVA: 0x00006C20 File Offset: 0x00004E20
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
{
GameObject gameObject = playerData as GameObject;
if (!(gameObject == null) && !(gameObject != this.boundGameObject))
{
int inputCount = playable.GetInputCount<Playable>();
bool flag = false;
for (int i = 0; i < inputCount; i++)
{
if (playable.GetInputWeight(i) > 0f)
{
flag = true;
break;
}
}
gameObject.SetActive(flag);
}
}
// Token: 0x0400008C RID: 140
private ActivationTrack.PostPlaybackState m_PostPlaybackState;
// Token: 0x0400008D RID: 141
private bool m_BoundGameObjectInitialStateIsActive;
}
}
@@ -0,0 +1,25 @@
using System;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x02000021 RID: 33
internal class ActivationPlayableAsset : PlayableAsset, ITimelineClipAsset
{
// Token: 0x17000066 RID: 102
// (get) Token: 0x06000146 RID: 326 RVA: 0x00006C9C File Offset: 0x00004E9C
public ClipCaps clipCaps
{
get
{
return ClipCaps.None;
}
}
// Token: 0x06000147 RID: 327 RVA: 0x00006CB4 File Offset: 0x00004EB4
public override Playable CreatePlayable(PlayableGraph graph, GameObject go)
{
return Playable.Create(graph, 0);
}
}
}
@@ -0,0 +1,102 @@
using System;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x02000022 RID: 34
[TrackClipType(typeof(ActivationPlayableAsset))]
[TrackMediaType(TimelineAsset.MediaType.Script)]
[TrackBindingType(typeof(GameObject))]
[Serializable]
public class ActivationTrack : TrackAsset
{
// Token: 0x17000067 RID: 103
// (get) Token: 0x06000149 RID: 329 RVA: 0x00006CD8 File Offset: 0x00004ED8
internal override bool compilable
{
get
{
return base.isEmpty || base.compilable;
}
}
// Token: 0x17000068 RID: 104
// (get) Token: 0x0600014A RID: 330 RVA: 0x00006D04 File Offset: 0x00004F04
// (set) Token: 0x0600014B RID: 331 RVA: 0x00006D1F File Offset: 0x00004F1F
public ActivationTrack.PostPlaybackState postPlaybackState
{
get
{
return this.m_PostPlaybackState;
}
set
{
this.m_PostPlaybackState = value;
this.UpdateTrackMode();
}
}
// Token: 0x0600014C RID: 332 RVA: 0x00006D30 File Offset: 0x00004F30
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
{
ScriptPlayable<ActivationMixerPlayable> scriptPlayable = ActivationMixerPlayable.Create(graph, inputCount);
this.m_ActivationMixer = scriptPlayable.GetBehaviour();
PlayableDirector component = go.GetComponent<PlayableDirector>();
this.UpdateBoundGameObject(component);
this.UpdateTrackMode();
return scriptPlayable;
}
// Token: 0x0600014D RID: 333 RVA: 0x00006D74 File Offset: 0x00004F74
private void UpdateBoundGameObject(PlayableDirector director)
{
if (director != null)
{
GameObject gameObject = director.GetGenericBinding(this) as GameObject;
if (gameObject != null && this.m_ActivationMixer != null)
{
this.m_ActivationMixer.boundGameObject = gameObject;
}
}
}
// Token: 0x0600014E RID: 334 RVA: 0x00006DC2 File Offset: 0x00004FC2
internal void UpdateTrackMode()
{
if (this.m_ActivationMixer != null)
{
this.m_ActivationMixer.postPlaybackState = this.m_PostPlaybackState;
}
}
// Token: 0x0600014F RID: 335 RVA: 0x00006DE4 File Offset: 0x00004FE4
public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
{
GameObject gameObjectBinding = base.GetGameObjectBinding(director);
if (gameObjectBinding != null)
{
driver.AddFromName(gameObjectBinding, "m_IsActive");
}
}
// Token: 0x0400008F RID: 143
[SerializeField]
private ActivationTrack.PostPlaybackState m_PostPlaybackState;
// Token: 0x04000090 RID: 144
private ActivationMixerPlayable m_ActivationMixer;
// Token: 0x02000023 RID: 35
public enum PostPlaybackState
{
// Token: 0x04000092 RID: 146
Active,
// Token: 0x04000093 RID: 147
Inactive,
// Token: 0x04000094 RID: 148
Revert,
// Token: 0x04000095 RID: 149
LeaveAsIs
}
}
}
@@ -0,0 +1,110 @@
using System;
using System.Collections.Generic;
using UnityEngine.Animations;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x02000024 RID: 36
internal class AnimationOutputWeightProcessor : ITimelineEvaluateCallback
{
// Token: 0x06000150 RID: 336 RVA: 0x00006E12 File Offset: 0x00005012
public AnimationOutputWeightProcessor(AnimationPlayableOutput output)
{
this.m_Output = output;
this.FindMixers();
}
// Token: 0x06000151 RID: 337 RVA: 0x00006E34 File Offset: 0x00005034
private void FindMixers()
{
this.m_Mixers.Clear();
this.m_LayerMixer = AnimationLayerMixerPlayable.Null;
Playable sourcePlayable = this.m_Output.GetSourcePlayable<AnimationPlayableOutput>();
int sourceInputPort = this.m_Output.GetSourceInputPort<AnimationPlayableOutput>();
if (sourcePlayable.IsValid<Playable>() && sourceInputPort >= 0 && sourceInputPort < sourcePlayable.GetInputCount<Playable>())
{
Playable input = sourcePlayable.GetInput(sourceInputPort).GetInput(0);
if (input.IsValid<Playable>() && input.IsPlayableOfType<AnimationLayerMixerPlayable>())
{
this.m_LayerMixer = (AnimationLayerMixerPlayable)input;
int inputCount = this.m_LayerMixer.GetInputCount<AnimationLayerMixerPlayable>();
for (int i = 0; i < inputCount; i++)
{
this.FindMixers(this.m_LayerMixer, i, this.m_LayerMixer.GetInput(i));
}
}
}
}
// Token: 0x06000152 RID: 338 RVA: 0x00006F10 File Offset: 0x00005110
private void FindMixers(Playable parent, int port, Playable node)
{
if (node.IsValid<Playable>())
{
Type playableType = node.GetPlayableType();
if (playableType == typeof(AnimationMixerPlayable) || playableType == typeof(AnimationLayerMixerPlayable))
{
int inputCount = node.GetInputCount<Playable>();
for (int i = 0; i < inputCount; i++)
{
this.FindMixers(node, i, node.GetInput(i));
}
AnimationOutputWeightProcessor.WeightInfo weightInfo = new AnimationOutputWeightProcessor.WeightInfo
{
parentMixer = parent,
mixer = node,
port = port,
modulate = (playableType == typeof(AnimationLayerMixerPlayable))
};
this.m_Mixers.Add(weightInfo);
}
else
{
int inputCount2 = node.GetInputCount<Playable>();
for (int j = 0; j < inputCount2; j++)
{
this.FindMixers(parent, port, node.GetInput(j));
}
}
}
}
// Token: 0x06000153 RID: 339 RVA: 0x00007000 File Offset: 0x00005200
public void Evaluate()
{
for (int i = 0; i < this.m_Mixers.Count; i++)
{
AnimationOutputWeightProcessor.WeightInfo weightInfo = this.m_Mixers[i];
float num = ((!weightInfo.modulate) ? 1f : weightInfo.parentMixer.GetInputWeight(weightInfo.port));
weightInfo.parentMixer.SetInputWeight(weightInfo.port, num * WeightUtility.NormalizeMixer(weightInfo.mixer));
}
this.m_Output.SetWeight(WeightUtility.NormalizeMixer(this.m_LayerMixer));
}
// Token: 0x04000096 RID: 150
private AnimationPlayableOutput m_Output;
// Token: 0x04000097 RID: 151
private AnimationLayerMixerPlayable m_LayerMixer;
// Token: 0x04000098 RID: 152
private readonly List<AnimationOutputWeightProcessor.WeightInfo> m_Mixers = new List<AnimationOutputWeightProcessor.WeightInfo>();
// Token: 0x02000025 RID: 37
private struct WeightInfo
{
// Token: 0x04000099 RID: 153
public Playable mixer;
// Token: 0x0400009A RID: 154
public Playable parentMixer;
// Token: 0x0400009B RID: 155
public int port;
// Token: 0x0400009C RID: 156
public bool modulate;
}
}
}
@@ -0,0 +1,234 @@
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;
}
}
@@ -0,0 +1,493 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine.Animations;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x02000029 RID: 41
[TrackClipType(typeof(AnimationPlayableAsset))]
[TrackClipType(typeof(AnimationClip))]
[TrackMediaType(TimelineAsset.MediaType.Animation)]
[SupportsChildTracks(typeof(AnimationTrack), 1)]
[Serializable]
public class AnimationTrack : TrackAsset
{
// Token: 0x17000073 RID: 115
// (get) Token: 0x0600016D RID: 365 RVA: 0x00007590 File Offset: 0x00005790
// (set) Token: 0x0600016E RID: 366 RVA: 0x000075AB File Offset: 0x000057AB
public Vector3 position
{
get
{
return this.m_Position;
}
set
{
this.m_Position = value;
}
}
// Token: 0x17000074 RID: 116
// (get) Token: 0x0600016F RID: 367 RVA: 0x000075B8 File Offset: 0x000057B8
// (set) Token: 0x06000170 RID: 368 RVA: 0x000075D3 File Offset: 0x000057D3
public Quaternion rotation
{
get
{
return this.m_Rotation;
}
set
{
this.m_Rotation = value;
}
}
// Token: 0x17000075 RID: 117
// (get) Token: 0x06000171 RID: 369 RVA: 0x000075E0 File Offset: 0x000057E0
// (set) Token: 0x06000172 RID: 370 RVA: 0x000075FB File Offset: 0x000057FB
public bool applyOffsets
{
get
{
return this.m_ApplyOffsets;
}
set
{
this.m_ApplyOffsets = value;
}
}
// Token: 0x17000076 RID: 118
// (get) Token: 0x06000173 RID: 371 RVA: 0x00007608 File Offset: 0x00005808
// (set) Token: 0x06000174 RID: 372 RVA: 0x00007623 File Offset: 0x00005823
public MatchTargetFields matchTargetFields
{
get
{
return this.m_MatchTargetFields;
}
set
{
this.m_MatchTargetFields = value & MatchTargetFieldConstants.All;
}
}
// Token: 0x17000077 RID: 119
// (get) Token: 0x06000175 RID: 373 RVA: 0x00007634 File Offset: 0x00005834
private bool compilableIsolated
{
get
{
return !base.muted && (this.m_Clips.Count > 0 || (base.animClip != null && !base.animClip.empty));
}
}
// Token: 0x17000078 RID: 120
// (get) Token: 0x06000176 RID: 374 RVA: 0x00007690 File Offset: 0x00005890
internal override bool compilable
{
get
{
bool flag;
if (!this.compilableIsolated)
{
flag = base.subTracks.Any((TrackAsset x) => x.compilable);
}
else
{
flag = true;
}
return flag;
}
}
// Token: 0x17000079 RID: 121
// (get) Token: 0x06000177 RID: 375 RVA: 0x000076DC File Offset: 0x000058DC
public override IEnumerable<PlayableBinding> outputs
{
get
{
return new PlayableBinding[]
{
new PlayableBinding
{
sourceObject = this,
streamName = base.name,
streamType = DataStreamType.Animation
}
};
}
}
// Token: 0x1700007A RID: 122
// (get) Token: 0x06000178 RID: 376 RVA: 0x0000772C File Offset: 0x0000592C
public bool inClipMode
{
get
{
return base.clips != null && base.clips.Length != 0;
}
}
// Token: 0x1700007B RID: 123
// (get) Token: 0x06000179 RID: 377 RVA: 0x00007760 File Offset: 0x00005960
// (set) Token: 0x0600017A RID: 378 RVA: 0x0000777B File Offset: 0x0000597B
public Vector3 openClipOffsetPosition
{
get
{
return this.m_OpenClipOffsetPosition;
}
set
{
this.m_OpenClipOffsetPosition = value;
}
}
// Token: 0x1700007C RID: 124
// (get) Token: 0x0600017B RID: 379 RVA: 0x00007788 File Offset: 0x00005988
// (set) Token: 0x0600017C RID: 380 RVA: 0x000077A3 File Offset: 0x000059A3
public Quaternion openClipOffsetRotation
{
get
{
return this.m_OpenClipOffsetRotation;
}
set
{
this.m_OpenClipOffsetRotation = value;
}
}
// Token: 0x1700007D RID: 125
// (get) Token: 0x0600017D RID: 381 RVA: 0x000077B0 File Offset: 0x000059B0
// (set) Token: 0x0600017E RID: 382 RVA: 0x000077CB File Offset: 0x000059CB
internal double openClipTimeOffset
{
get
{
return this.m_OpenClipTimeOffset;
}
set
{
this.m_OpenClipTimeOffset = value;
}
}
// Token: 0x1700007E RID: 126
// (get) Token: 0x0600017F RID: 383 RVA: 0x000077D8 File Offset: 0x000059D8
// (set) Token: 0x06000180 RID: 384 RVA: 0x000077F3 File Offset: 0x000059F3
public TimelineClip.ClipExtrapolation openClipPreExtrapolation
{
get
{
return this.m_OpenClipPreExtrapolation;
}
set
{
this.m_OpenClipPreExtrapolation = value;
}
}
// Token: 0x1700007F RID: 127
// (get) Token: 0x06000181 RID: 385 RVA: 0x00007800 File Offset: 0x00005A00
// (set) Token: 0x06000182 RID: 386 RVA: 0x0000781B File Offset: 0x00005A1B
public TimelineClip.ClipExtrapolation openClipPostExtrapolation
{
get
{
return this.m_OpenClipPostExtrapolation;
}
set
{
this.m_OpenClipPostExtrapolation = value;
}
}
// Token: 0x06000183 RID: 387 RVA: 0x00007825 File Offset: 0x00005A25
[ContextMenu("Reset Offsets")]
private void ResetOffsets()
{
this.m_Position = Vector3.zero;
this.m_Rotation = Quaternion.identity;
this.UpdateClipOffsets();
}
// Token: 0x06000184 RID: 388 RVA: 0x00007844 File Offset: 0x00005A44
public TimelineClip CreateClip(AnimationClip clip)
{
TimelineClip timelineClip;
if (clip == null)
{
timelineClip = null;
}
else
{
TimelineClip timelineClip2 = base.CreateDefaultClip();
this.AssignAnimationClip(timelineClip2, clip);
timelineClip = timelineClip2;
}
return timelineClip;
}
// Token: 0x06000185 RID: 389 RVA: 0x0000787C File Offset: 0x00005A7C
internal void UpdateClipOffsets()
{
}
// Token: 0x06000186 RID: 390 RVA: 0x00007880 File Offset: 0x00005A80
internal override void OnCreateClipFromAsset(Object asset, TimelineClip clip)
{
AnimationClip animationClip = asset as AnimationClip;
if (animationClip != null)
{
if (animationClip.legacy)
{
throw new InvalidOperationException("Legacy Animation Clips are not supported");
}
AnimationPlayableAsset animationPlayableAsset = ScriptableObject.CreateInstance<AnimationPlayableAsset>();
TimelineCreateUtilities.SaveAssetIntoObject(animationPlayableAsset, this);
animationPlayableAsset.clip = animationClip;
clip.asset = animationPlayableAsset;
this.AssignAnimationClip(clip, animationClip);
}
}
// Token: 0x06000187 RID: 391 RVA: 0x000078DC File Offset: 0x00005ADC
internal Playable CompileTrackPlayable(PlayableGraph graph, TrackAsset track, GameObject go, IntervalTree tree)
{
AnimationMixerPlayable animationMixerPlayable = AnimationMixerPlayable.Create(graph, track.clips.Length, false);
for (int i = 0; i < track.clips.Length; i++)
{
TimelineClip timelineClip = track.clips[i];
PlayableAsset playableAsset = timelineClip.asset as PlayableAsset;
if (!(playableAsset == null))
{
if (timelineClip.recordable)
{
AnimationPlayableAsset animationPlayableAsset = playableAsset as AnimationPlayableAsset;
if (animationPlayableAsset != null)
{
animationPlayableAsset.removeStartOffset = !timelineClip.recordable;
}
}
Playable playable = playableAsset.CreatePlayable(graph, go);
RuntimeClip runtimeClip = new RuntimeClip(timelineClip, playable, animationMixerPlayable);
tree.Add(runtimeClip);
graph.Connect<Playable, AnimationMixerPlayable>(playable, 0, animationMixerPlayable, i);
animationMixerPlayable.SetInputWeight(i, 0f);
}
}
return this.ApplyTrackOffset(graph, animationMixerPlayable);
}
// Token: 0x06000188 RID: 392 RVA: 0x000079C0 File Offset: 0x00005BC0
internal override Playable OnCreatePlayableGraph(PlayableGraph graph, GameObject go, IntervalTree tree)
{
if (base.isSubTrack)
{
throw new InvalidOperationException("Nested animation tracks should never be asked to create a graph directly");
}
List<AnimationTrack> list = new List<AnimationTrack>();
if (this.compilableIsolated)
{
list.Add(this);
}
for (int i = 0; i < base.subTracks.Count; i++)
{
AnimationTrack animationTrack = base.subTracks[i] as AnimationTrack;
if (animationTrack != null && animationTrack.compilable)
{
list.Add(animationTrack);
}
}
Playable playable = new Playable(graph.CreateAnimationMotionXToDeltaPlayable());
Playable playable2 = this.CreateGroupMixer(graph, go, list.Count);
graph.Connect<Playable, Playable>(playable2, 0, playable, 0);
playable.SetInputWeight(0, 1f);
for (int j = 0; j < list.Count; j++)
{
Playable playable3 = ((!list[j].inClipMode) ? list[j].CreateInfiniteTrackPlayable(graph, go, tree) : this.CompileTrackPlayable(graph, list[j], go, tree));
tree.Add(list[j]);
graph.Connect<Playable, Playable>(playable3, 0, playable2, j);
playable2.SetInputWeight(j, (float)((!list[j].inClipMode) ? 1 : 0));
}
return playable;
}
// Token: 0x06000189 RID: 393 RVA: 0x00007B24 File Offset: 0x00005D24
private Playable CreateGroupMixer(PlayableGraph graph, GameObject go, int inputCount)
{
return AnimationLayerMixerPlayable.Create(graph, inputCount);
}
// Token: 0x0600018A RID: 394 RVA: 0x00007B48 File Offset: 0x00005D48
private Playable CreateInfiniteTrackPlayable(PlayableGraph graph, GameObject go, IntervalTree tree)
{
Playable playable;
if (base.animClip == null)
{
playable = Playable.Null;
}
else
{
if (this.m_FakeAnimClip == null || this.m_AnimationPlayableAsset == null)
{
this.m_AnimationPlayableAsset = ScriptableObject.CreateInstance<AnimationPlayableAsset>();
this.m_FakeAnimClip = new TimelineClip(null)
{
asset = this.m_AnimationPlayableAsset,
displayName = "Animation Clip",
timeScale = 1.0,
start = 0.0,
postExtrapolationMode = TimelineClip.ClipExtrapolation.Hold,
preExtrapolationMode = TimelineClip.ClipExtrapolation.Hold
};
this.m_FakeAnimClip.SetPostExtrapolationTime(TimelineClip.kMaxTimeValue);
}
this.m_AnimationPlayableAsset.clip = base.animClip;
this.m_AnimationPlayableAsset.position = this.m_OpenClipOffsetPosition;
this.m_AnimationPlayableAsset.rotation = this.m_OpenClipOffsetRotation;
this.m_AnimationPlayableAsset.removeStartOffset = false;
this.m_FakeAnimClip.start = 0.0;
this.m_FakeAnimClip.SetPreExtrapolationTime(0.0);
this.m_FakeAnimClip.duration = (double)base.animClip.length;
AnimationMixerPlayable animationMixerPlayable = AnimationMixerPlayable.Create(graph, 1, false);
Playable playable2 = this.m_AnimationPlayableAsset.CreatePlayable(graph, go);
tree.Add(new RuntimeClip(this.m_FakeAnimClip, playable2, animationMixerPlayable));
graph.Connect<Playable, AnimationMixerPlayable>(playable2, 0, animationMixerPlayable, 0);
animationMixerPlayable.SetInputWeight(0, 1f);
playable = this.ApplyTrackOffset(graph, animationMixerPlayable);
}
return playable;
}
// Token: 0x0600018B RID: 395 RVA: 0x00007CD8 File Offset: 0x00005ED8
private Playable ApplyTrackOffset(PlayableGraph graph, Playable root)
{
Playable playable;
if (!this.m_ApplyOffsets)
{
playable = root;
}
else
{
AnimationOffsetPlayable animationOffsetPlayable = AnimationOffsetPlayable.Create(graph, this.m_Position, this.m_Rotation, 1);
graph.Connect<Playable, AnimationOffsetPlayable>(root, 0, animationOffsetPlayable, 0);
animationOffsetPlayable.SetInputWeight(0, 1f);
playable = animationOffsetPlayable;
}
return playable;
}
// Token: 0x0600018C RID: 396 RVA: 0x00007D31 File Offset: 0x00005F31
internal override void GetEvaluationTime(out double outStart, out double outDuration)
{
if (this.inClipMode)
{
base.GetEvaluationTime(out outStart, out outDuration);
}
else
{
outStart = 0.0;
outDuration = TimelineClip.kMaxTimeValue;
}
}
// Token: 0x0600018D RID: 397 RVA: 0x00007D64 File Offset: 0x00005F64
internal override void GetSequenceTime(out double outStart, out double outDuration)
{
if (this.inClipMode)
{
base.GetSequenceTime(out outStart, out outDuration);
}
else
{
outStart = 0.0;
outDuration = 0.0;
if (base.animClip != null)
{
outDuration = (double)base.animClip.length;
}
}
}
// Token: 0x0600018E RID: 398 RVA: 0x00007DC4 File Offset: 0x00005FC4
private void AssignAnimationClip(TimelineClip clip, AnimationClip animClip)
{
if (clip != null && !(animClip == null))
{
if (animClip.legacy)
{
throw new InvalidOperationException("Legacy Animation Clips are not supported");
}
if (animClip.frameRate > 0f)
{
double num = (double)Mathf.Round(animClip.length * animClip.frameRate);
clip.duration = num / (double)animClip.frameRate;
}
else
{
clip.duration = (double)animClip.length;
}
TimelineClip.ClipExtrapolation clipExtrapolation = TimelineClip.ClipExtrapolation.None;
if (!base.isSubTrack)
{
clipExtrapolation = TimelineClip.ClipExtrapolation.Hold;
}
AnimationPlayableAsset animationPlayableAsset = clip.asset as AnimationPlayableAsset;
if (animationPlayableAsset != null)
{
animationPlayableAsset.clip = animClip;
}
clip.underlyingAsset = animClip;
clip.preExtrapolationMode = clipExtrapolation;
clip.postExtrapolationMode = clipExtrapolation;
}
}
// Token: 0x040000AF RID: 175
protected AnimationPlayableAsset m_AnimationPlayableAsset;
// Token: 0x040000B0 RID: 176
protected TimelineClip m_FakeAnimClip;
// Token: 0x040000B1 RID: 177
[SerializeField]
private TimelineClip.ClipExtrapolation m_OpenClipPreExtrapolation = TimelineClip.ClipExtrapolation.None;
// Token: 0x040000B2 RID: 178
[SerializeField]
private TimelineClip.ClipExtrapolation m_OpenClipPostExtrapolation = TimelineClip.ClipExtrapolation.None;
// Token: 0x040000B3 RID: 179
[SerializeField]
private Vector3 m_OpenClipOffsetPosition = Vector3.zero;
// Token: 0x040000B4 RID: 180
[SerializeField]
private Quaternion m_OpenClipOffsetRotation = Quaternion.identity;
// Token: 0x040000B5 RID: 181
[SerializeField]
private double m_OpenClipTimeOffset;
// Token: 0x040000B6 RID: 182
[SerializeField]
private MatchTargetFields m_MatchTargetFields = MatchTargetFieldConstants.All;
// Token: 0x040000B7 RID: 183
[SerializeField]
private Vector3 m_Position = Vector3.zero;
// Token: 0x040000B8 RID: 184
[SerializeField]
private Quaternion m_Rotation = Quaternion.identity;
// Token: 0x040000B9 RID: 185
[SerializeField]
private bool m_ApplyOffsets;
}
}
@@ -0,0 +1,114 @@
using System;
using System.Collections.Generic;
using UnityEngine.Audio;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x0200002B RID: 43
[Serializable]
public class AudioPlayableAsset : PlayableAsset, ITimelineClipAsset
{
// Token: 0x17000081 RID: 129
// (get) Token: 0x06000193 RID: 403 RVA: 0x00007EF0 File Offset: 0x000060F0
// (set) Token: 0x06000194 RID: 404 RVA: 0x00007F0B File Offset: 0x0000610B
internal float bufferingTime
{
get
{
return this.m_bufferingTime;
}
set
{
this.m_bufferingTime = value;
}
}
// Token: 0x17000082 RID: 130
// (get) Token: 0x06000195 RID: 405 RVA: 0x00007F18 File Offset: 0x00006118
// (set) Token: 0x06000196 RID: 406 RVA: 0x00007F33 File Offset: 0x00006133
public AudioClip clip
{
get
{
return this.m_Clip;
}
set
{
this.m_Clip = value;
}
}
// Token: 0x17000083 RID: 131
// (get) Token: 0x06000197 RID: 407 RVA: 0x00007F40 File Offset: 0x00006140
public override double duration
{
get
{
double num;
if (this.m_Clip == null)
{
num = base.duration;
}
else
{
num = (double)this.m_Clip.samples / (double)this.m_Clip.frequency;
}
return num;
}
}
// Token: 0x17000084 RID: 132
// (get) Token: 0x06000198 RID: 408 RVA: 0x00007F8C File Offset: 0x0000618C
public override IEnumerable<PlayableBinding> outputs
{
get
{
yield return new PlayableBinding
{
streamName = "audio",
streamType = DataStreamType.Audio
};
yield break;
}
}
// Token: 0x06000199 RID: 409 RVA: 0x00007FB0 File Offset: 0x000061B0
public override Playable CreatePlayable(PlayableGraph graph, GameObject go)
{
Playable playable;
if (this.m_Clip == null)
{
playable = Playable.Null;
}
else
{
playable = AudioClipPlayable.Create(graph, this.m_Clip, this.m_Loop);
}
return playable;
}
// Token: 0x17000085 RID: 133
// (get) Token: 0x0600019A RID: 410 RVA: 0x00007FF8 File Offset: 0x000061F8
public ClipCaps clipCaps
{
get
{
return ClipCaps.ClipIn | ClipCaps.SpeedMultiplier | ClipCaps.Blending | ((!this.m_Loop) ? ClipCaps.None : ClipCaps.Looping);
}
}
// Token: 0x040000BC RID: 188
[SerializeField]
private AudioClip m_Clip;
// Token: 0x040000BD RID: 189
[SerializeField]
private bool m_Loop;
// Token: 0x040000BE RID: 190
[SerializeField]
[HideInInspector]
private float m_bufferingTime = 0.1f;
}
}
@@ -0,0 +1,97 @@
using System;
using System.Collections.Generic;
using UnityEngine.Audio;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x0200002C RID: 44
[TrackClipType(typeof(AudioPlayableAsset))]
[TrackClipType(typeof(AudioClip))]
[TrackMediaType(TimelineAsset.MediaType.Audio)]
[Serializable]
public class AudioTrack : TrackAsset
{
// Token: 0x0600019C RID: 412 RVA: 0x00008130 File Offset: 0x00006330
public TimelineClip CreateClip(AudioClip clip)
{
TimelineClip timelineClip;
if (clip == null)
{
timelineClip = null;
}
else
{
TimelineClip timelineClip2 = base.CreateDefaultClip();
AudioPlayableAsset audioPlayableAsset = timelineClip2.asset as AudioPlayableAsset;
if (audioPlayableAsset != null)
{
audioPlayableAsset.clip = clip;
}
timelineClip2.underlyingAsset = clip;
timelineClip2.duration = (double)clip.length;
timelineClip2.displayName = clip.name;
timelineClip = timelineClip2;
}
return timelineClip;
}
// Token: 0x0600019D RID: 413 RVA: 0x000081A0 File Offset: 0x000063A0
internal override Playable OnCreatePlayableGraph(PlayableGraph graph, GameObject go, IntervalTree tree)
{
AudioMixerPlayable audioMixerPlayable = AudioMixerPlayable.Create(graph, base.clips.Length, false);
for (int i = 0; i < base.clips.Length; i++)
{
TimelineClip timelineClip = base.clips[i];
PlayableAsset playableAsset = timelineClip.asset as PlayableAsset;
if (!(playableAsset == null))
{
float num = 0.1f;
AudioPlayableAsset audioPlayableAsset = timelineClip.asset as AudioPlayableAsset;
if (audioPlayableAsset != null)
{
num = audioPlayableAsset.bufferingTime;
}
Playable playable = playableAsset.CreatePlayable(graph, go);
tree.Add(new ScheduleRuntimeClip(timelineClip, playable, audioMixerPlayable, (double)num, 0.1));
graph.Connect<Playable, AudioMixerPlayable>(playable, 0, audioMixerPlayable, i);
playable.SetSpeed(timelineClip.timeScale);
playable.SetDuration(timelineClip.extrapolatedDuration);
audioMixerPlayable.SetInputWeight(playable, 1f);
}
}
return audioMixerPlayable;
}
// Token: 0x0600019E RID: 414 RVA: 0x00008298 File Offset: 0x00006498
internal override void OnCreateClipFromAsset(Object asset, TimelineClip newClip)
{
if (asset is AudioClip)
{
AudioPlayableAsset audioPlayableAsset = ScriptableObject.CreateInstance<AudioPlayableAsset>();
audioPlayableAsset.clip = asset as AudioClip;
newClip.asset = audioPlayableAsset;
newClip.underlyingAsset = asset;
newClip.duration = audioPlayableAsset.duration;
newClip.displayName = (asset as AudioClip).name;
}
}
// Token: 0x17000086 RID: 134
// (get) Token: 0x0600019F RID: 415 RVA: 0x000082F4 File Offset: 0x000064F4
public override IEnumerable<PlayableBinding> outputs
{
get
{
yield return new PlayableBinding
{
sourceObject = this,
streamName = base.name,
streamType = DataStreamType.Audio,
sourceBindingType = typeof(AudioSource)
};
yield break;
}
}
}
}
@@ -0,0 +1,78 @@
using System;
using System.Collections.Generic;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x02000033 RID: 51
[Obsolete("For best performance use PlayableAsset and PlayableBehaviour.")]
[Serializable]
public class BasicPlayableBehaviour : ScriptableObject, IPlayableAsset, IPlayableBehaviour
{
// Token: 0x17000089 RID: 137
// (get) Token: 0x060001BC RID: 444 RVA: 0x000094A4 File Offset: 0x000076A4
public virtual double duration
{
get
{
return PlayableBinding.DefaultDuration;
}
}
// Token: 0x1700008A RID: 138
// (get) Token: 0x060001BD RID: 445 RVA: 0x000094C0 File Offset: 0x000076C0
public virtual IEnumerable<PlayableBinding> outputs
{
get
{
return PlayableBinding.None;
}
}
// Token: 0x060001BE RID: 446 RVA: 0x000094DA File Offset: 0x000076DA
public virtual void OnGraphStart(Playable playable)
{
}
// Token: 0x060001BF RID: 447 RVA: 0x000094DD File Offset: 0x000076DD
public virtual void OnGraphStop(Playable playable)
{
}
// Token: 0x060001C0 RID: 448 RVA: 0x000094E0 File Offset: 0x000076E0
public virtual void OnPlayableCreate(Playable playable)
{
}
// Token: 0x060001C1 RID: 449 RVA: 0x000094E3 File Offset: 0x000076E3
public virtual void OnPlayableDestroy(Playable playable)
{
}
// Token: 0x060001C2 RID: 450 RVA: 0x000094E6 File Offset: 0x000076E6
public virtual void OnBehaviourPlay(Playable playable, FrameData info)
{
}
// Token: 0x060001C3 RID: 451 RVA: 0x000094E9 File Offset: 0x000076E9
public virtual void OnBehaviourPause(Playable playable, FrameData info)
{
}
// Token: 0x060001C4 RID: 452 RVA: 0x000094EC File Offset: 0x000076EC
public virtual void PrepareFrame(Playable playable, FrameData info)
{
}
// Token: 0x060001C5 RID: 453 RVA: 0x000094EF File Offset: 0x000076EF
public virtual void ProcessFrame(Playable playable, FrameData info, object playerData)
{
}
// Token: 0x060001C6 RID: 454 RVA: 0x000094F4 File Offset: 0x000076F4
public virtual Playable CreatePlayable(PlayableGraph graph, GameObject owner)
{
return ScriptPlayable<BasicPlayableBehaviour>.Create(graph, this, 0);
}
}
}
+24
View File
@@ -0,0 +1,24 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x02000002 RID: 2
[Flags]
public enum ClipCaps
{
// Token: 0x04000002 RID: 2
None = 0,
// Token: 0x04000003 RID: 3
Looping = 1,
// Token: 0x04000004 RID: 4
Extrapolation = 2,
// Token: 0x04000005 RID: 5
ClipIn = 4,
// Token: 0x04000006 RID: 6
SpeedMultiplier = 8,
// Token: 0x04000007 RID: 7
Blending = 16,
// Token: 0x04000008 RID: 8
All = -1
}
}
@@ -0,0 +1,355 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x0200002D RID: 45
[NotKeyable]
[Serializable]
public class ControlPlayableAsset : PlayableAsset, IPropertyPreview, ITimelineClipAsset
{
// Token: 0x060001A1 RID: 417 RVA: 0x0000849D File Offset: 0x0000669D
public void OnEnable()
{
if (this.particleRandomSeed == 0U)
{
this.particleRandomSeed = (uint)Random.Range(1, ControlPlayableAsset.k_MaxRandInt);
}
}
// Token: 0x17000087 RID: 135
// (get) Token: 0x060001A2 RID: 418 RVA: 0x000084BC File Offset: 0x000066BC
public override double duration
{
get
{
return this.m_Duration;
}
}
// Token: 0x17000088 RID: 136
// (get) Token: 0x060001A3 RID: 419 RVA: 0x000084D8 File Offset: 0x000066D8
public ClipCaps clipCaps
{
get
{
return ClipCaps.ClipIn | ClipCaps.SpeedMultiplier | ((!this.m_SupportLoop) ? ClipCaps.None : ClipCaps.Looping);
}
}
// Token: 0x060001A4 RID: 420 RVA: 0x00008504 File Offset: 0x00006704
public override Playable CreatePlayable(PlayableGraph graph, GameObject go)
{
List<Playable> list = new List<Playable>();
GameObject gameObject = this.sourceGameObject.Resolve(graph.GetResolver());
if (this.prefabGameObject != null)
{
Transform transform = ((!(gameObject != null)) ? null : gameObject.transform);
ScriptPlayable<PrefabControlPlayable> scriptPlayable = PrefabControlPlayable.Create(graph, this.prefabGameObject, transform);
gameObject = scriptPlayable.GetBehaviour().prefabInstance;
list.Add(scriptPlayable);
}
this.UpdateDurationAndLoopFlag(gameObject);
Playable playable;
if (gameObject == null)
{
playable = Playable.Create(graph, 0);
}
else
{
PlayableDirector component = go.GetComponent<PlayableDirector>();
if (component != null)
{
this.m_ControlDirectorAsset = component.playableAsset;
}
if (go == gameObject && this.prefabGameObject == null)
{
Debug.LogWarning("Control Playable (" + base.name + ") is referencing the same PlayableDirector component than the one in which it is playing.");
this.active = false;
if (!this.searchHierarchy)
{
this.updateDirector = false;
}
}
if (this.active)
{
this.CreateActivationPlayable(gameObject, graph, list);
}
if (this.updateDirector)
{
this.SearchHierarchyAndConnectDirector(gameObject, graph, list);
}
if (this.updateParticle)
{
this.SearchHiearchyAndConnectParticleSystem(gameObject, graph, list);
}
if (this.updateITimeControl)
{
this.SearchHierarchyAndConnectControlableScripts(gameObject, graph, list);
}
Playable playable2 = this.ConnectPlayablesToMixer(graph, list);
playable = playable2;
}
return playable;
}
// Token: 0x060001A5 RID: 421 RVA: 0x0000867C File Offset: 0x0000687C
private Playable ConnectPlayablesToMixer(PlayableGraph graph, List<Playable> playables)
{
Playable playable = Playable.Create(graph, playables.Count);
for (int num = 0; num != playables.Count; num++)
{
this.ConnectMixerAndPlayable(graph, playable, playables[num], num);
}
playable.SetPropagateSetTime(true);
return playable;
}
// Token: 0x060001A6 RID: 422 RVA: 0x000086D0 File Offset: 0x000068D0
private void CreateActivationPlayable(GameObject root, PlayableGraph graph, List<Playable> outplayables)
{
ScriptPlayable<ActivationControlPlayable> scriptPlayable = ActivationControlPlayable.Create(graph, root, this.postPlayback);
if (scriptPlayable.IsValid<ScriptPlayable<ActivationControlPlayable>>())
{
outplayables.Add(scriptPlayable);
}
}
// Token: 0x060001A7 RID: 423 RVA: 0x00008704 File Offset: 0x00006904
private bool SearchHiearchyAndConnectParticleSystem(GameObject root, PlayableGraph graph, List<Playable> outplayables)
{
bool flag;
if (root == null)
{
flag = false;
}
else
{
bool flag2 = false;
foreach (ParticleSystem particleSystem in this.GetParticleSystems(root))
{
if (particleSystem != null)
{
flag2 = true;
outplayables.Add(ParticleControlPlayable.Create(graph, particleSystem, this.particleRandomSeed));
}
}
flag = flag2;
}
return flag;
}
// Token: 0x060001A8 RID: 424 RVA: 0x000087A0 File Offset: 0x000069A0
private void SearchHierarchyAndConnectDirector(GameObject root, PlayableGraph graph, List<Playable> outplayables)
{
if (!(root == null))
{
foreach (PlayableDirector playableDirector in this.GetDirectors(root))
{
if (playableDirector != null)
{
if (playableDirector.playableAsset != this.m_ControlDirectorAsset)
{
outplayables.Add(DirectorControlPlayable.Create(graph, playableDirector));
}
}
}
}
}
// Token: 0x060001A9 RID: 425 RVA: 0x00008840 File Offset: 0x00006A40
private void SearchHierarchyAndConnectControlableScripts(GameObject root, PlayableGraph graph, List<Playable> outplayables)
{
if (!(root == null))
{
foreach (MonoBehaviour monoBehaviour in this.GetControlableScripts(root))
{
outplayables.Add(TimeControlPlayable.Create(graph, (ITimeControl)monoBehaviour));
}
}
}
// Token: 0x060001AA RID: 426 RVA: 0x000088C0 File Offset: 0x00006AC0
private void ConnectMixerAndPlayable(PlayableGraph graph, Playable mixer, Playable playable, int portIndex)
{
graph.Connect<Playable, Playable>(playable, 0, mixer, portIndex);
mixer.SetInputWeight(playable, 1f);
}
// Token: 0x060001AB RID: 427 RVA: 0x000088DC File Offset: 0x00006ADC
private IEnumerable<ParticleSystem> GetParticleSystems(GameObject gameObject)
{
if (gameObject != null)
{
ParticleSystem particleSystem = gameObject.GetComponent<ParticleSystem>();
if (particleSystem != null)
{
yield return particleSystem;
}
else if (this.searchHierarchy)
{
int count = gameObject.transform.childCount;
for (int i = 0; i < count; i++)
{
IEnumerable<ParticleSystem> childPS = this.GetParticleSystems(gameObject.transform.GetChild(i).gameObject);
foreach (ParticleSystem ps in childPS)
{
yield return ps;
}
}
}
}
yield break;
}
// Token: 0x060001AC RID: 428 RVA: 0x00008910 File Offset: 0x00006B10
private IEnumerable<PlayableDirector> GetDirectors(GameObject gameObject)
{
if (gameObject != null)
{
if (this.searchHierarchy)
{
PlayableDirector[] directors = gameObject.GetComponentsInChildren<PlayableDirector>(true);
foreach (PlayableDirector d in directors)
{
yield return d;
}
}
else
{
PlayableDirector director = gameObject.GetComponent<PlayableDirector>();
if (director != null)
{
yield return director;
}
}
}
yield break;
}
// Token: 0x060001AD RID: 429 RVA: 0x00008944 File Offset: 0x00006B44
private IEnumerable<MonoBehaviour> GetControlableScripts(GameObject root)
{
if (root == null)
{
yield break;
}
foreach (MonoBehaviour script in root.GetComponentsInChildren<MonoBehaviour>())
{
if (script is ITimeControl)
{
yield return script;
}
}
yield break;
}
// Token: 0x060001AE RID: 430 RVA: 0x00008970 File Offset: 0x00006B70
private void UpdateDurationAndLoopFlag(GameObject gameObject)
{
this.m_Duration = PlayableBinding.DefaultDuration;
this.m_SupportLoop = false;
if (!(gameObject == null))
{
List<PlayableDirector> list = this.GetDirectors(gameObject).ToList<PlayableDirector>();
List<ParticleSystem> list2 = this.GetParticleSystems(gameObject).ToList<ParticleSystem>();
if (list.Count == 1 && list2.Count == 0 && list[0].playableAsset != null)
{
this.m_Duration = list[0].playableAsset.duration;
this.m_SupportLoop = list[0].extrapolationMode == DirectorWrapMode.Loop;
}
else if (list.Count == 0 && list2.Count == 1)
{
this.m_Duration = (double)list2[0].main.duration;
this.m_SupportLoop = list2[0].main.loop;
}
}
}
// Token: 0x060001AF RID: 431 RVA: 0x00008A6C File Offset: 0x00006C6C
public void GatherProperties(PlayableDirector director, IPropertyCollector driver)
{
GameObject gameObject = this.sourceGameObject.Resolve(director);
if (gameObject != null)
{
if (this.updateParticle)
{
foreach (ParticleSystem particleSystem in this.GetParticleSystems(gameObject))
{
driver.AddFromName<ParticleSystem>(particleSystem.gameObject, "randomSeed");
driver.AddFromName<ParticleSystem>(particleSystem.gameObject, "autoRandomSeed");
}
}
if (this.active)
{
driver.AddFromName(gameObject, "m_IsActive");
}
if (this.updateITimeControl)
{
foreach (MonoBehaviour monoBehaviour in this.GetControlableScripts(gameObject))
{
IPropertyPreview propertyPreview = monoBehaviour as IPropertyPreview;
if (propertyPreview != null)
{
propertyPreview.GatherProperties(director, driver);
}
else
{
driver.AddFromComponent(monoBehaviour.gameObject, monoBehaviour);
}
}
}
}
}
// Token: 0x040000BF RID: 191
private static readonly int k_MaxRandInt = 10000;
// Token: 0x040000C0 RID: 192
[SerializeField]
public ExposedReference<GameObject> sourceGameObject;
// Token: 0x040000C1 RID: 193
[SerializeField]
public GameObject prefabGameObject;
// Token: 0x040000C2 RID: 194
[SerializeField]
public bool updateParticle = true;
// Token: 0x040000C3 RID: 195
[SerializeField]
public uint particleRandomSeed;
// Token: 0x040000C4 RID: 196
[SerializeField]
public bool updateDirector = true;
// Token: 0x040000C5 RID: 197
[SerializeField]
public bool updateITimeControl = true;
// Token: 0x040000C6 RID: 198
[SerializeField]
public bool searchHierarchy = true;
// Token: 0x040000C7 RID: 199
[SerializeField]
public bool active = true;
// Token: 0x040000C8 RID: 200
[SerializeField]
public ActivationControlPlayable.PostPlaybackState postPlayback = ActivationControlPlayable.PostPlaybackState.Revert;
// Token: 0x040000C9 RID: 201
private PlayableAsset m_ControlDirectorAsset;
// Token: 0x040000CA RID: 202
private double m_Duration = PlayableBinding.DefaultDuration;
// Token: 0x040000CB RID: 203
private bool m_SupportLoop;
}
}
@@ -0,0 +1,12 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x0200002E RID: 46
[TrackColor(0.2313f, 0.6353f, 0.5843f)]
[TrackClipType(typeof(ControlPlayableAsset))]
[TrackMediaType(TimelineAsset.MediaType.Script)]
public class ControlTrack : TrackAsset
{
}
}
@@ -0,0 +1,111 @@
using System;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x02000034 RID: 52
public class DirectorControlPlayable : PlayableBehaviour
{
// Token: 0x060001C8 RID: 456 RVA: 0x00009520 File Offset: 0x00007720
public static ScriptPlayable<DirectorControlPlayable> Create(PlayableGraph graph, PlayableDirector director)
{
ScriptPlayable<DirectorControlPlayable> scriptPlayable;
if (director == null)
{
scriptPlayable = ScriptPlayable<DirectorControlPlayable>.Null;
}
else
{
ScriptPlayable<DirectorControlPlayable> scriptPlayable2 = ScriptPlayable<DirectorControlPlayable>.Create(graph, 0);
scriptPlayable2.GetBehaviour().director = director;
scriptPlayable = scriptPlayable2;
}
return scriptPlayable;
}
// Token: 0x060001C9 RID: 457 RVA: 0x00009564 File Offset: 0x00007764
public override void PrepareFrame(Playable playable, FrameData info)
{
if (!(this.director == null) && this.director.isActiveAndEnabled && !(this.director.playableAsset == null))
{
if (this.director.playableGraph.IsValid())
{
int rootPlayableCount = this.director.playableGraph.GetRootPlayableCount();
for (int i = 0; i < rootPlayableCount; i++)
{
Playable rootPlayable = this.director.playableGraph.GetRootPlayable(i);
if (rootPlayable.IsValid<Playable>())
{
rootPlayable.SetSpeed((double)info.effectiveSpeed);
}
}
}
if (info.evaluationType == FrameData.EvaluationType.Evaluate)
{
if (Application.isPlaying)
{
this.director.Pause();
}
this.UpdateTime(playable);
this.director.Evaluate();
}
else if (Application.isPlaying)
{
if (playable.GetTime<Playable>() < this.director.time)
{
this.UpdateTime(playable);
}
this.director.Play();
}
}
}
// Token: 0x060001CA RID: 458 RVA: 0x00009694 File Offset: 0x00007894
public override void OnBehaviourPlay(Playable playable, FrameData info)
{
if (this.director != null && this.director.playableAsset != null)
{
this.UpdateTime(playable);
this.director.Evaluate();
this.director.Play();
}
}
// Token: 0x060001CB RID: 459 RVA: 0x000096E8 File Offset: 0x000078E8
public override void OnBehaviourPause(Playable playable, FrameData info)
{
if (this.director != null && this.director.playableAsset != null)
{
this.director.Stop();
}
}
// Token: 0x060001CC RID: 460 RVA: 0x00009720 File Offset: 0x00007920
private void UpdateTime(Playable playable)
{
double num = Math.Max(0.1, this.director.playableAsset.duration);
DirectorWrapMode extrapolationMode = this.director.extrapolationMode;
if (extrapolationMode != DirectorWrapMode.Hold)
{
if (extrapolationMode != DirectorWrapMode.Loop)
{
if (extrapolationMode == DirectorWrapMode.None)
{
this.director.time = playable.GetTime<Playable>();
}
}
else
{
this.director.time = Math.Max(0.0, playable.GetTime<Playable>() % num);
}
}
else
{
this.director.time = Math.Min(num, Math.Max(0.0, playable.GetTime<Playable>()));
}
}
// Token: 0x040000D7 RID: 215
public PlayableDirector director;
}
}
@@ -0,0 +1,279 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x02000004 RID: 4
internal struct DiscreteTime : IComparable
{
// Token: 0x06000008 RID: 8 RVA: 0x0000216A File Offset: 0x0000036A
public DiscreteTime(DiscreteTime time)
{
this.m_DiscreteTime = time.m_DiscreteTime;
}
// Token: 0x06000009 RID: 9 RVA: 0x0000217A File Offset: 0x0000037A
private DiscreteTime(long time)
{
this.m_DiscreteTime = time;
}
// Token: 0x0600000A RID: 10 RVA: 0x00002184 File Offset: 0x00000384
public DiscreteTime(double time)
{
this.m_DiscreteTime = DiscreteTime.DoubleToDiscreteTime(time);
}
// Token: 0x0600000B RID: 11 RVA: 0x00002193 File Offset: 0x00000393
public DiscreteTime(float time)
{
this.m_DiscreteTime = DiscreteTime.FloatToDiscreteTime(time);
}
// Token: 0x0600000C RID: 12 RVA: 0x000021A2 File Offset: 0x000003A2
public DiscreteTime(int time)
{
this.m_DiscreteTime = DiscreteTime.IntToDiscreteTime(time);
}
// Token: 0x0600000D RID: 13 RVA: 0x000021B1 File Offset: 0x000003B1
public DiscreteTime(int frame, double fps)
{
this.m_DiscreteTime = DiscreteTime.DoubleToDiscreteTime((double)frame * fps);
}
// Token: 0x17000001 RID: 1
// (get) Token: 0x0600000E RID: 14 RVA: 0x000021C4 File Offset: 0x000003C4
public static double tickValue
{
get
{
return 1E-12;
}
}
// Token: 0x0600000F RID: 15 RVA: 0x000021E4 File Offset: 0x000003E4
public DiscreteTime OneTickBefore()
{
return new DiscreteTime(this.m_DiscreteTime - 1L);
}
// Token: 0x06000010 RID: 16 RVA: 0x00002208 File Offset: 0x00000408
public DiscreteTime OneTickAfter()
{
return new DiscreteTime(this.m_DiscreteTime + 1L);
}
// Token: 0x06000011 RID: 17 RVA: 0x0000222C File Offset: 0x0000042C
public long GetTick()
{
return this.m_DiscreteTime;
}
// Token: 0x06000012 RID: 18 RVA: 0x00002248 File Offset: 0x00000448
public int CompareTo(object obj)
{
int num;
if (obj is DiscreteTime)
{
num = this.m_DiscreteTime.CompareTo(((DiscreteTime)obj).m_DiscreteTime);
}
else
{
num = 1;
}
return num;
}
// Token: 0x06000013 RID: 19 RVA: 0x00002288 File Offset: 0x00000488
public bool Equals(DiscreteTime other)
{
return this.m_DiscreteTime == other.m_DiscreteTime;
}
// Token: 0x06000014 RID: 20 RVA: 0x000022AC File Offset: 0x000004AC
public override bool Equals(object obj)
{
return obj is DiscreteTime && this.Equals((DiscreteTime)obj);
}
// Token: 0x06000015 RID: 21 RVA: 0x000022E0 File Offset: 0x000004E0
private static long DoubleToDiscreteTime(double time)
{
double num = time / 1E-12 + 0.5;
if (num < 9.223372036854776E+18 && num > -9.223372036854776E+18)
{
return (long)num;
}
throw new ArgumentOutOfRangeException("Time is over the discrete range.");
}
// Token: 0x06000016 RID: 22 RVA: 0x00002338 File Offset: 0x00000538
private static long FloatToDiscreteTime(float time)
{
float num = time / 1E-12f + 0.5f;
if (num < 9.223372E+18f && num > -9.223372E+18f)
{
return (long)num;
}
throw new ArgumentOutOfRangeException("Time is over the discrete range.");
}
// Token: 0x06000017 RID: 23 RVA: 0x00002380 File Offset: 0x00000580
private static long IntToDiscreteTime(int time)
{
return DiscreteTime.DoubleToDiscreteTime((double)time);
}
// Token: 0x06000018 RID: 24 RVA: 0x0000239C File Offset: 0x0000059C
private static double ToDouble(long time)
{
return (double)time * 1E-12;
}
// Token: 0x06000019 RID: 25 RVA: 0x000023C0 File Offset: 0x000005C0
private static float ToFloat(long time)
{
return (float)DiscreteTime.ToDouble(time);
}
// Token: 0x0600001A RID: 26 RVA: 0x000023DC File Offset: 0x000005DC
public static explicit operator double(DiscreteTime b)
{
return DiscreteTime.ToDouble(b.m_DiscreteTime);
}
// Token: 0x0600001B RID: 27 RVA: 0x00002400 File Offset: 0x00000600
public static explicit operator float(DiscreteTime b)
{
return DiscreteTime.ToFloat(b.m_DiscreteTime);
}
// Token: 0x0600001C RID: 28 RVA: 0x00002424 File Offset: 0x00000624
public static explicit operator long(DiscreteTime b)
{
return b.m_DiscreteTime;
}
// Token: 0x0600001D RID: 29 RVA: 0x00002440 File Offset: 0x00000640
public static explicit operator DiscreteTime(double time)
{
return new DiscreteTime(time);
}
// Token: 0x0600001E RID: 30 RVA: 0x0000245C File Offset: 0x0000065C
public static explicit operator DiscreteTime(float time)
{
return new DiscreteTime(time);
}
// Token: 0x0600001F RID: 31 RVA: 0x00002478 File Offset: 0x00000678
public static implicit operator DiscreteTime(int time)
{
return new DiscreteTime(time);
}
// Token: 0x06000020 RID: 32 RVA: 0x00002494 File Offset: 0x00000694
public static bool operator ==(DiscreteTime lhs, DiscreteTime rhs)
{
return lhs.m_DiscreteTime == rhs.m_DiscreteTime;
}
// Token: 0x06000021 RID: 33 RVA: 0x000024BC File Offset: 0x000006BC
public static bool operator !=(DiscreteTime lhs, DiscreteTime rhs)
{
return !(lhs == rhs);
}
// Token: 0x06000022 RID: 34 RVA: 0x000024DC File Offset: 0x000006DC
public static bool operator >(DiscreteTime lhs, DiscreteTime rhs)
{
return lhs.m_DiscreteTime > rhs.m_DiscreteTime;
}
// Token: 0x06000023 RID: 35 RVA: 0x00002504 File Offset: 0x00000704
public static bool operator <(DiscreteTime lhs, DiscreteTime rhs)
{
return lhs.m_DiscreteTime < rhs.m_DiscreteTime;
}
// Token: 0x06000024 RID: 36 RVA: 0x0000252C File Offset: 0x0000072C
public static bool operator <=(DiscreteTime lhs, DiscreteTime rhs)
{
return lhs.m_DiscreteTime <= rhs.m_DiscreteTime;
}
// Token: 0x06000025 RID: 37 RVA: 0x00002554 File Offset: 0x00000754
public static bool operator >=(DiscreteTime lhs, DiscreteTime rhs)
{
return lhs.m_DiscreteTime >= rhs.m_DiscreteTime;
}
// Token: 0x06000026 RID: 38 RVA: 0x0000257C File Offset: 0x0000077C
public static DiscreteTime operator +(DiscreteTime lhs, DiscreteTime rhs)
{
return new DiscreteTime(lhs.m_DiscreteTime + rhs.m_DiscreteTime);
}
// Token: 0x06000027 RID: 39 RVA: 0x000025A8 File Offset: 0x000007A8
public static DiscreteTime operator -(DiscreteTime lhs, DiscreteTime rhs)
{
return new DiscreteTime(lhs.m_DiscreteTime - rhs.m_DiscreteTime);
}
// Token: 0x06000028 RID: 40 RVA: 0x000025D4 File Offset: 0x000007D4
public override string ToString()
{
return this.m_DiscreteTime.ToString();
}
// Token: 0x06000029 RID: 41 RVA: 0x000025FC File Offset: 0x000007FC
public override int GetHashCode()
{
return this.m_DiscreteTime.GetHashCode();
}
// Token: 0x0600002A RID: 42 RVA: 0x00002624 File Offset: 0x00000824
public static DiscreteTime Min(DiscreteTime lhs, DiscreteTime rhs)
{
return new DiscreteTime(Math.Min(lhs.m_DiscreteTime, rhs.m_DiscreteTime));
}
// Token: 0x0600002B RID: 43 RVA: 0x00002654 File Offset: 0x00000854
public static DiscreteTime Max(DiscreteTime lhs, DiscreteTime rhs)
{
return new DiscreteTime(Math.Max(lhs.m_DiscreteTime, rhs.m_DiscreteTime));
}
// Token: 0x0600002C RID: 44 RVA: 0x00002684 File Offset: 0x00000884
public static double SnapToNearestTick(double time)
{
long num = DiscreteTime.DoubleToDiscreteTime(time);
return DiscreteTime.ToDouble(num);
}
// Token: 0x0600002D RID: 45 RVA: 0x000026A8 File Offset: 0x000008A8
public static float SnapToNearestTick(float time)
{
long num = DiscreteTime.FloatToDiscreteTime(time);
return DiscreteTime.ToFloat(num);
}
// Token: 0x0600002E RID: 46 RVA: 0x000026CC File Offset: 0x000008CC
public static long GetNearestTick(double time)
{
return DiscreteTime.DoubleToDiscreteTime(time);
}
// Token: 0x04000009 RID: 9
private const double k_Tick = 1E-12;
// Token: 0x0400000A RID: 10
public static readonly DiscreteTime MaxTime = new DiscreteTime
{
m_DiscreteTime = long.MaxValue
};
// Token: 0x0400000B RID: 11
private long m_DiscreteTime;
}
}
@@ -0,0 +1,79 @@
using System;
using System.Linq;
namespace UnityEngine.Timeline
{
// Token: 0x0200003A RID: 58
public static class Extrapolation
{
// Token: 0x060001E8 RID: 488 RVA: 0x00009DC4 File Offset: 0x00007FC4
internal static void CalculateExtrapolationTimes(this TrackAsset asset)
{
TimelineClip[] clips = asset.clips;
if (clips != null && clips.Length != 0)
{
if (clips[0].SupportsExtrapolation())
{
TimelineClip[] array = clips.OrderBy((TimelineClip x) => x.start).ToArray<TimelineClip>();
if (array.Length > 0)
{
for (int i = 0; i < array.Length; i++)
{
double num = double.PositiveInfinity;
for (int j = 0; j < array.Length; j++)
{
if (i != j)
{
double num2 = array[j].start - array[i].end;
if (num2 >= -TimeUtility.kTimeEpsilon && num2 < num)
{
num = Math.Min(num, num2);
}
if (array[j].start <= array[i].end && array[j].end > array[i].end)
{
num = 0.0;
}
}
}
num = ((num > Extrapolation.kMinExtrapolationTime) ? num : 0.0);
array[i].SetPostExtrapolationTime(num);
}
array[0].SetPreExtrapolationTime(Math.Max(0.0, array[0].start));
for (int k = 1; k < array.Length; k++)
{
double num3 = 0.0;
int num4 = -1;
for (int l = 0; l < k; l++)
{
if (array[l].end > array[k].start)
{
num4 = -1;
num3 = 0.0;
break;
}
double num5 = array[k].start - array[l].end;
if (num4 == -1 || num5 < num3)
{
num3 = num5;
num4 = l;
}
}
if (num4 >= 0)
{
if (array[num4].postExtrapolationMode != TimelineClip.ClipExtrapolation.None)
{
num3 = 0.0;
}
}
num3 = ((num3 > Extrapolation.kMinExtrapolationTime) ? num3 : 0.0);
array[k].SetPreExtrapolationTime(num3);
}
}
}
}
}
// Token: 0x040000E0 RID: 224
public static readonly double kMinExtrapolationTime = TimeUtility.kTimeEpsilon * 1000.0;
}
}
@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x02000005 RID: 5
[TrackClipType(typeof(TrackAsset))]
[TrackMediaType(TimelineAsset.MediaType.Group)]
[SupportsChildTracks(null, 2147483647)]
[Serializable]
public class GroupTrack : TrackAsset
{
// Token: 0x17000002 RID: 2
// (get) Token: 0x06000031 RID: 49 RVA: 0x00003A30 File Offset: 0x00001C30
internal override bool compilable
{
get
{
return false;
}
}
// Token: 0x17000003 RID: 3
// (get) Token: 0x06000032 RID: 50 RVA: 0x00003A48 File Offset: 0x00001C48
public override IEnumerable<PlayableBinding> outputs
{
get
{
return PlayableBinding.None;
}
}
}
}
@@ -0,0 +1,64 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x0200003B RID: 59
internal static class HashUtility
{
// Token: 0x060001EB RID: 491 RVA: 0x0000A040 File Offset: 0x00008240
public static int CombineHash(this int h1, int h2)
{
return h1 ^ (int)((long)h2 + (long)((ulong)(-1640531527)) + (long)((long)h1 << 6) + (long)(h1 >> 2));
}
// Token: 0x060001EC RID: 492 RVA: 0x0000A06C File Offset: 0x0000826C
public static int CombineHash(int h1, int h2, int h3)
{
return h1.CombineHash(h2).CombineHash(h3);
}
// Token: 0x060001ED RID: 493 RVA: 0x0000A090 File Offset: 0x00008290
public static int CombineHash(int h1, int h2, int h3, int h4)
{
return HashUtility.CombineHash(h1, h2, h3).CombineHash(h4);
}
// Token: 0x060001EE RID: 494 RVA: 0x0000A0B4 File Offset: 0x000082B4
public static int CombineHash(int h1, int h2, int h3, int h4, int h5)
{
return HashUtility.CombineHash(h1, h2, h3, h4).CombineHash(h5);
}
// Token: 0x060001EF RID: 495 RVA: 0x0000A0DC File Offset: 0x000082DC
public static int CombineHash(int h1, int h2, int h3, int h4, int h5, int h6)
{
return HashUtility.CombineHash(h1, h2, h3, h4, h5).CombineHash(h6);
}
// Token: 0x060001F0 RID: 496 RVA: 0x0000A104 File Offset: 0x00008304
public static int CombineHash(int h1, int h2, int h3, int h4, int h5, int h6, int h7)
{
return HashUtility.CombineHash(h1, h2, h3, h4, h5, h6).CombineHash(h7);
}
// Token: 0x060001F1 RID: 497 RVA: 0x0000A130 File Offset: 0x00008330
public static int CombineHash(int[] hashes)
{
int num;
if (hashes == null || hashes.Length == 0)
{
num = 0;
}
else
{
int num2 = hashes[0];
for (int i = 1; i < hashes.Length; i++)
{
num2 = num2.CombineHash(hashes[i]);
}
num = num2;
}
return num;
}
}
}
@@ -0,0 +1,38 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x0200003C RID: 60
public interface IPropertyCollector
{
// Token: 0x060001F2 RID: 498
void PushActiveGameObject(GameObject gameObject);
// Token: 0x060001F3 RID: 499
void PopActiveGameObject();
// Token: 0x060001F4 RID: 500
void AddFromClip(AnimationClip clip);
// Token: 0x060001F5 RID: 501
void AddFromName<T>(string name) where T : Component;
// Token: 0x060001F6 RID: 502
void AddFromName(string name);
// Token: 0x060001F7 RID: 503
void AddFromClip(GameObject obj, AnimationClip clip);
// Token: 0x060001F8 RID: 504
void AddFromName<T>(GameObject obj, string name) where T : Component;
// Token: 0x060001F9 RID: 505
void AddFromName(GameObject obj, string name);
// Token: 0x060001FA RID: 506
void AddFromComponent(GameObject obj, Component component);
// Token: 0x060001FB RID: 507
void AddObjectProperties(Object obj, AnimationClip clip);
}
}
@@ -0,0 +1,12 @@
using System;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x0200003D RID: 61
public interface IPropertyPreview
{
// Token: 0x060001FC RID: 508
void GatherProperties(PlayableDirector director, IPropertyCollector driver);
}
}
@@ -0,0 +1,17 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x02000035 RID: 53
public interface ITimeControl
{
// Token: 0x060001CD RID: 461
void SetTime(double time);
// Token: 0x060001CE RID: 462
void OnControlTimeStart();
// Token: 0x060001CF RID: 463
void OnControlTimeStop();
}
}
@@ -0,0 +1,12 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x02000016 RID: 22
public interface ITimelineClipAsset
{
// Token: 0x1700001F RID: 31
// (get) Token: 0x06000090 RID: 144
ClipCaps clipCaps { get; }
}
}
@@ -0,0 +1,11 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x02000017 RID: 23
public interface ITimelineClipLink
{
// Token: 0x06000091 RID: 145
void LiveLink();
}
}
@@ -0,0 +1,11 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x0200001C RID: 28
internal interface ITimelineEvaluateCallback
{
// Token: 0x060000EB RID: 235
void Evaluate();
}
}
@@ -0,0 +1,32 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x02000028 RID: 40
internal static class MatchTargetFieldConstants
{
// Token: 0x06000169 RID: 361 RVA: 0x000074E0 File Offset: 0x000056E0
public static bool HasAny(this MatchTargetFields me, MatchTargetFields fields)
{
return (me & fields) != MatchTargetFieldConstants.None;
}
// Token: 0x0600016A RID: 362 RVA: 0x00007504 File Offset: 0x00005704
public static MatchTargetFields Toggle(this MatchTargetFields me, MatchTargetFields flag)
{
return me ^ flag;
}
// Token: 0x040000AB RID: 171
public static MatchTargetFields All = MatchTargetFields.PositionX | MatchTargetFields.PositionY | MatchTargetFields.PositionZ | MatchTargetFields.RotationX | MatchTargetFields.RotationY | MatchTargetFields.RotationZ;
// Token: 0x040000AC RID: 172
public static MatchTargetFields None = (MatchTargetFields)0;
// Token: 0x040000AD RID: 173
public static MatchTargetFields Position = MatchTargetFields.PositionX | MatchTargetFields.PositionY | MatchTargetFields.PositionZ;
// Token: 0x040000AE RID: 174
public static MatchTargetFields Rotation = MatchTargetFields.RotationX | MatchTargetFields.RotationY | MatchTargetFields.RotationZ;
}
}
@@ -0,0 +1,22 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x02000027 RID: 39
[Flags]
public enum MatchTargetFields
{
// Token: 0x040000A5 RID: 165
PositionX = 1,
// Token: 0x040000A6 RID: 166
PositionY = 2,
// Token: 0x040000A7 RID: 167
PositionZ = 4,
// Token: 0x040000A8 RID: 168
RotationX = 8,
// Token: 0x040000A9 RID: 169
RotationY = 16,
// Token: 0x040000AA RID: 170
RotationZ = 32
}
}
@@ -0,0 +1,10 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x02000013 RID: 19
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Field)]
public class NotKeyableAttribute : Attribute
{
}
}
@@ -0,0 +1,110 @@
using System;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x02000036 RID: 54
public class ParticleControlPlayable : PlayableBehaviour
{
// Token: 0x060001D1 RID: 465 RVA: 0x00009800 File Offset: 0x00007A00
public static ScriptPlayable<ParticleControlPlayable> Create(PlayableGraph graph, ParticleSystem component, uint randomSeed)
{
ScriptPlayable<ParticleControlPlayable> scriptPlayable;
if (component == null)
{
scriptPlayable = ScriptPlayable<ParticleControlPlayable>.Null;
}
else
{
ScriptPlayable<ParticleControlPlayable> scriptPlayable2 = ScriptPlayable<ParticleControlPlayable>.Create(graph, 0);
scriptPlayable2.GetBehaviour().Initialize(component, randomSeed);
scriptPlayable = scriptPlayable2;
}
return scriptPlayable;
}
// Token: 0x1700008B RID: 139
// (get) Token: 0x060001D2 RID: 466 RVA: 0x00009844 File Offset: 0x00007A44
public ParticleSystem particleSystem
{
get
{
return this.m_ParticleSystem;
}
}
// Token: 0x060001D3 RID: 467 RVA: 0x0000985F File Offset: 0x00007A5F
public void Initialize(ParticleSystem particleSystem, uint randomSeed)
{
this.m_RandomSeed = Math.Max(1U, randomSeed);
this.m_ParticleSystem = particleSystem;
}
// Token: 0x060001D4 RID: 468 RVA: 0x00009878 File Offset: 0x00007A78
public override void PrepareFrame(Playable playable, FrameData data)
{
if (!(this.particleSystem == null) && this.particleSystem.gameObject.activeInHierarchy)
{
if (this.particleSystem.randomSeed != this.m_RandomSeed)
{
this.particleSystem.Stop();
this.particleSystem.useAutoRandomSeed = false;
this.particleSystem.randomSeed = this.m_RandomSeed;
}
float num = (float)playable.GetTime<Playable>();
bool flag = Mathf.Approximately(this.m_LastTime, -1f) || !Mathf.Approximately(this.m_LastTime, num);
if (flag)
{
float num2 = Time.fixedDeltaTime * 0.5f;
float num3 = num;
float num4 = num3 - this.m_LastTime;
bool flag2 = num3 < this.m_LastTime || num3 < num2 || Mathf.Approximately(this.m_LastTime, -1f) || num4 > this.particleSystem.main.duration || !Mathf.Approximately(this.m_LastPsTime, this.particleSystem.time);
if (flag2)
{
this.particleSystem.Simulate(0f, true, true);
this.particleSystem.Simulate(num3, true, false);
}
else
{
float num5 = num3 % this.particleSystem.main.duration;
float num6 = num5 - this.particleSystem.time;
if (num6 < -num2)
{
num6 = num5 + this.particleSystem.main.duration - this.particleSystem.time;
}
this.particleSystem.Simulate(num6, true, false);
}
this.m_LastPsTime = this.particleSystem.time;
this.m_LastTime = num;
}
}
}
// Token: 0x060001D5 RID: 469 RVA: 0x00009A4F File Offset: 0x00007C4F
public override void OnBehaviourPlay(Playable playable, FrameData info)
{
this.m_LastTime = -1f;
}
// Token: 0x060001D6 RID: 470 RVA: 0x00009A5D File Offset: 0x00007C5D
public override void OnBehaviourPause(Playable playable, FrameData info)
{
this.m_LastTime = -1f;
}
// Token: 0x040000D8 RID: 216
private const float kUnsetTime = -1f;
// Token: 0x040000D9 RID: 217
private float m_LastTime = -1f;
// Token: 0x040000DA RID: 218
private float m_LastPsTime = -1f;
// Token: 0x040000DB RID: 219
private uint m_RandomSeed = 1U;
// Token: 0x040000DC RID: 220
private ParticleSystem m_ParticleSystem;
}
}
@@ -0,0 +1,9 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x02000009 RID: 9
internal class Placeholder
{
}
}
@@ -0,0 +1,28 @@
using System;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x02000039 RID: 57
[TrackClipType(typeof(IPlayableAsset))]
[TrackMediaType(TimelineAsset.MediaType.Script)]
[Serializable]
public class PlayableTrack : TrackAsset
{
// Token: 0x060001E6 RID: 486 RVA: 0x00009D78 File Offset: 0x00007F78
public TimelineClip CreateClip<T>() where T : ScriptableObject, IPlayableAsset
{
return base.CreateClipOfType(typeof(T));
}
// Token: 0x060001E7 RID: 487 RVA: 0x00009D9D File Offset: 0x00007F9D
internal override void OnCreateClipFromAsset(Object asset, TimelineClip newClip)
{
base.OnCreateClipFromAsset(asset, newClip);
if (newClip != null)
{
newClip.displayName = asset.GetType().Name;
}
}
}
}
@@ -0,0 +1,127 @@
using System;
using System.Collections;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x02000037 RID: 55
public class PrefabControlPlayable : PlayableBehaviour
{
// Token: 0x060001D8 RID: 472 RVA: 0x00009A74 File Offset: 0x00007C74
public static ScriptPlayable<PrefabControlPlayable> Create(PlayableGraph graph, GameObject prefabGameObject, Transform parentTransform)
{
ScriptPlayable<PrefabControlPlayable> scriptPlayable;
if (prefabGameObject == null)
{
scriptPlayable = ScriptPlayable<PrefabControlPlayable>.Null;
}
else
{
ScriptPlayable<PrefabControlPlayable> scriptPlayable2 = ScriptPlayable<PrefabControlPlayable>.Create(graph, 0);
scriptPlayable2.GetBehaviour().Initialize(prefabGameObject, parentTransform);
scriptPlayable = scriptPlayable2;
}
return scriptPlayable;
}
// Token: 0x1700008C RID: 140
// (get) Token: 0x060001D9 RID: 473 RVA: 0x00009AB8 File Offset: 0x00007CB8
public GameObject prefabInstance
{
get
{
return this.m_Instance;
}
}
// Token: 0x060001DA RID: 474 RVA: 0x00009AD4 File Offset: 0x00007CD4
public GameObject Initialize(GameObject prefabGameObject, Transform parentTransform)
{
if (prefabGameObject == null)
{
throw new ArgumentNullException("Prefab cannot be null");
}
if (this.m_Instance != null)
{
Debug.LogWarningFormat("Prefab Control Playable ({0}) has already been initialized with a Prefab ({1}).", new object[]
{
prefabGameObject.name,
this.m_Instance.name
});
}
else
{
this.m_Instance = Object.Instantiate<GameObject>(prefabGameObject, parentTransform, false);
this.m_Instance.name = prefabGameObject.name + " [Timeline]";
this.m_Instance.SetActive(false);
PrefabControlPlayable.SetHideFlagsRecursive(this.m_Instance);
}
return this.m_Instance;
}
// Token: 0x060001DB RID: 475 RVA: 0x00009B87 File Offset: 0x00007D87
public override void OnPlayableDestroy(Playable playable)
{
if (this.m_Instance)
{
if (Application.isPlaying)
{
Object.Destroy(this.m_Instance);
}
else
{
Object.DestroyImmediate(this.m_Instance);
}
}
}
// Token: 0x060001DC RID: 476 RVA: 0x00009BC1 File Offset: 0x00007DC1
public override void OnBehaviourPlay(Playable playable, FrameData info)
{
if (!(this.m_Instance == null))
{
this.m_Instance.SetActive(true);
}
}
// Token: 0x060001DD RID: 477 RVA: 0x00009BE6 File Offset: 0x00007DE6
public override void OnBehaviourPause(Playable playable, FrameData info)
{
if (!(this.m_Instance == null))
{
this.m_Instance.SetActive(false);
}
}
// Token: 0x060001DE RID: 478 RVA: 0x00009C0C File Offset: 0x00007E0C
private static void SetHideFlagsRecursive(GameObject gameObject)
{
gameObject.hideFlags = HideFlags.DontSaveInEditor | HideFlags.DontSaveInBuild;
if (!Application.isPlaying)
{
gameObject.hideFlags |= HideFlags.HideInHierarchy;
}
IEnumerator enumerator = gameObject.transform.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
object obj = enumerator.Current;
Transform transform = (Transform)obj;
PrefabControlPlayable.SetHideFlagsRecursive(transform.gameObject);
}
}
finally
{
IDisposable disposable;
if ((disposable = enumerator as IDisposable) != null)
{
disposable.Dispose();
}
}
}
// Token: 0x040000DD RID: 221
private GameObject m_Instance;
}
}
@@ -0,0 +1,143 @@
using System;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x0200000A RID: 10
internal class RuntimeClip : RuntimeClipBase
{
// Token: 0x06000048 RID: 72 RVA: 0x000040D3 File Offset: 0x000022D3
public RuntimeClip(TimelineClip clip, Playable clipPlayable, Playable parentMixer)
{
this.Create(clip, clipPlayable, parentMixer);
}
// Token: 0x17000008 RID: 8
// (get) Token: 0x06000049 RID: 73 RVA: 0x000040E8 File Offset: 0x000022E8
public override double start
{
get
{
return this.m_Clip.extrapolatedStart;
}
}
// Token: 0x17000009 RID: 9
// (get) Token: 0x0600004A RID: 74 RVA: 0x00004108 File Offset: 0x00002308
public override double duration
{
get
{
return this.m_Clip.extrapolatedDuration;
}
}
// Token: 0x0600004B RID: 75 RVA: 0x00004128 File Offset: 0x00002328
private void Create(TimelineClip clip, Playable clipPlayable, Playable parentMixer)
{
this.m_Clip = clip;
this.m_Playable = clipPlayable;
this.m_ParentMixer = parentMixer;
clipPlayable.SetPlayState(PlayState.Paused);
}
// Token: 0x1700000A RID: 10
// (get) Token: 0x0600004C RID: 76 RVA: 0x00004148 File Offset: 0x00002348
public TimelineClip clip
{
get
{
return this.m_Clip;
}
}
// Token: 0x1700000B RID: 11
// (get) Token: 0x0600004D RID: 77 RVA: 0x00004164 File Offset: 0x00002364
public Playable mixer
{
get
{
return this.m_ParentMixer;
}
}
// Token: 0x1700000C RID: 12
// (get) Token: 0x0600004E RID: 78 RVA: 0x00004180 File Offset: 0x00002380
public Playable playable
{
get
{
return this.m_Playable;
}
}
// Token: 0x1700000D RID: 13
// (set) Token: 0x0600004F RID: 79 RVA: 0x0000419C File Offset: 0x0000239C
public override bool enable
{
set
{
PlayState playState = ((!value) ? PlayState.Paused : PlayState.Playing);
PlayState playState2 = this.m_Playable.GetPlayState<Playable>();
if (playState != playState2)
{
this.m_Playable.SetPlayState(playState);
}
if (playState == PlayState.Paused && this.m_ParentMixer.IsValid<Playable>())
{
this.m_ParentMixer.SetInputWeight(this.m_Playable, 0f);
}
}
}
// Token: 0x06000050 RID: 80 RVA: 0x00004207 File Offset: 0x00002407
public void SetTime(double time)
{
this.m_Playable.SetTime(time);
}
// Token: 0x06000051 RID: 81 RVA: 0x00004216 File Offset: 0x00002416
public void SetDuration(double duration)
{
this.m_Playable.SetDuration(duration);
}
// Token: 0x06000052 RID: 82 RVA: 0x00004228 File Offset: 0x00002428
public override void EvaluateAt(double localTime, FrameData frameData)
{
this.enable = true;
float num;
if (this.clip.IsPreExtrapolatedTime(localTime))
{
num = this.clip.EvaluateMixIn((double)((float)this.clip.start));
}
else if (this.clip.IsPostExtrapolatedTime(localTime))
{
num = this.clip.EvaluateMixOut((double)((float)this.clip.end));
}
else
{
num = this.clip.EvaluateMixIn(localTime) * this.clip.EvaluateMixOut(localTime);
}
if (this.mixer.IsValid<Playable>())
{
this.mixer.SetInputWeight(this.playable, num);
}
double num2 = this.clip.ToLocalTime(localTime);
if (num2.CompareTo(0.0) >= 0)
{
this.SetTime(num2);
}
this.SetDuration(this.clip.extrapolatedDuration);
}
// Token: 0x04000014 RID: 20
private TimelineClip m_Clip;
// Token: 0x04000015 RID: 21
private Playable m_Playable;
// Token: 0x04000016 RID: 22
private Playable m_ParentMixer;
}
}
@@ -0,0 +1,49 @@
using System;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x0200001B RID: 27
internal abstract class RuntimeClipBase : IInterval
{
// Token: 0x17000048 RID: 72
// (get) Token: 0x060000E3 RID: 227
public abstract double start { get; }
// Token: 0x17000049 RID: 73
// (get) Token: 0x060000E4 RID: 228
public abstract double duration { get; }
// Token: 0x1700004A RID: 74
// (get) Token: 0x060000E5 RID: 229 RVA: 0x00004068 File Offset: 0x00002268
// (set) Token: 0x060000E6 RID: 230 RVA: 0x00004082 File Offset: 0x00002282
public int intervalBit { get; set; }
// Token: 0x1700004B RID: 75
// (set) Token: 0x060000E7 RID: 231
public abstract bool enable { set; }
// Token: 0x060000E8 RID: 232
public abstract void EvaluateAt(double localTime, FrameData frameData);
// Token: 0x1700004C RID: 76
// (get) Token: 0x060000E9 RID: 233 RVA: 0x0000408C File Offset: 0x0000228C
public long intervalStart
{
get
{
return DiscreteTime.GetNearestTick(this.start);
}
}
// Token: 0x1700004D RID: 77
// (get) Token: 0x060000EA RID: 234 RVA: 0x000040AC File Offset: 0x000022AC
public long intervalEnd
{
get
{
return DiscreteTime.GetNearestTick(this.start + this.duration);
}
}
}
}
@@ -0,0 +1,154 @@
using System;
using UnityEngine.Audio;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x0200000B RID: 11
internal class ScheduleRuntimeClip : RuntimeClipBase
{
// Token: 0x06000053 RID: 83 RVA: 0x0000431A File Offset: 0x0000251A
public ScheduleRuntimeClip(TimelineClip clip, Playable clipPlayable, Playable parentMixer, double startDelay = 0.2, double finishTail = 0.1)
{
this.Create(clip, clipPlayable, parentMixer, startDelay, finishTail);
}
// Token: 0x1700000E RID: 14
// (get) Token: 0x06000054 RID: 84 RVA: 0x00004338 File Offset: 0x00002538
public override double start
{
get
{
return Math.Max(0.0, this.m_Clip.start - this.m_StartDelay);
}
}
// Token: 0x1700000F RID: 15
// (get) Token: 0x06000055 RID: 85 RVA: 0x00004370 File Offset: 0x00002570
public override double duration
{
get
{
return this.m_Clip.duration + this.m_FinishTail + this.m_Clip.start - this.start;
}
}
// Token: 0x06000056 RID: 86 RVA: 0x000043AA File Offset: 0x000025AA
public void SetTime(double time)
{
this.m_Playable.SetTime(time);
}
// Token: 0x17000010 RID: 16
// (get) Token: 0x06000057 RID: 87 RVA: 0x000043BC File Offset: 0x000025BC
public TimelineClip clip
{
get
{
return this.m_Clip;
}
}
// Token: 0x17000011 RID: 17
// (get) Token: 0x06000058 RID: 88 RVA: 0x000043D8 File Offset: 0x000025D8
public Playable mixer
{
get
{
return this.m_ParentMixer;
}
}
// Token: 0x17000012 RID: 18
// (get) Token: 0x06000059 RID: 89 RVA: 0x000043F4 File Offset: 0x000025F4
public Playable playable
{
get
{
return this.m_Playable;
}
}
// Token: 0x0600005A RID: 90 RVA: 0x0000440F File Offset: 0x0000260F
private void Create(TimelineClip clip, Playable clipPlayable, Playable parentMixer, double startDelay, double finishTail)
{
this.m_Clip = clip;
this.m_Playable = clipPlayable;
this.m_AudioClipPlayable = (AudioClipPlayable)clipPlayable;
this.m_ParentMixer = parentMixer;
this.m_StartDelay = startDelay;
this.m_FinishTail = finishTail;
clipPlayable.SetPlayState(PlayState.Paused);
}
// Token: 0x17000013 RID: 19
// (set) Token: 0x0600005B RID: 91 RVA: 0x0000444C File Offset: 0x0000264C
public override bool enable
{
set
{
PlayState playState = ((!value) ? PlayState.Paused : PlayState.Playing);
PlayState playState2 = this.m_Playable.GetPlayState<Playable>();
if (playState != playState2)
{
this.m_Playable.SetPlayState(playState);
if (playState == PlayState.Paused && this.m_ParentMixer.IsValid<Playable>())
{
this.m_ParentMixer.SetInputWeight(this.m_Playable, 0f);
}
}
this.m_Started = this.m_Started && value;
}
}
// Token: 0x0600005C RID: 92 RVA: 0x000044C4 File Offset: 0x000026C4
public override void EvaluateAt(double localTime, FrameData frameData)
{
if (frameData.timeHeld)
{
this.enable = false;
}
else
{
bool flag = frameData.seekOccurred || frameData.timeLooped || frameData.evaluationType == FrameData.EvaluationType.Evaluate;
if (localTime <= this.start + this.duration - this.m_FinishTail)
{
float num = this.clip.EvaluateMixIn(localTime) * this.clip.EvaluateMixOut(localTime);
if (this.mixer.IsValid<Playable>())
{
this.mixer.SetInputWeight(this.playable, num);
}
if (!this.m_Started || flag)
{
double num2 = this.clip.ToLocalTime(Math.Max(localTime, this.clip.start));
double num3 = Math.Max(this.clip.start - localTime, 0.0) * this.clip.timeScale;
double num4 = this.m_Clip.duration * this.clip.timeScale;
this.m_AudioClipPlayable.Seek(num2, num3, num4);
this.m_Started = true;
}
}
}
}
// Token: 0x04000017 RID: 23
private TimelineClip m_Clip;
// Token: 0x04000018 RID: 24
private Playable m_Playable;
// Token: 0x04000019 RID: 25
private AudioClipPlayable m_AudioClipPlayable;
// Token: 0x0400001A RID: 26
private Playable m_ParentMixer;
// Token: 0x0400001B RID: 27
private double m_StartDelay;
// Token: 0x0400001C RID: 28
private double m_FinishTail;
// Token: 0x0400001D RID: 29
private bool m_Started = false;
}
}
@@ -0,0 +1,22 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x02000015 RID: 21
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
internal class SupportsChildTracksAttribute : Attribute
{
// Token: 0x0600008F RID: 143 RVA: 0x00005365 File Offset: 0x00003565
public SupportsChildTracksAttribute(Type childType = null, int levels = 2147483647)
{
this.childType = childType;
this.levels = levels;
}
// Token: 0x0400003F RID: 63
public readonly Type childType;
// Token: 0x04000040 RID: 64
public readonly int levels;
}
}
@@ -0,0 +1,73 @@
using System;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x02000038 RID: 56
public class TimeControlPlayable : PlayableBehaviour
{
// Token: 0x060001E0 RID: 480 RVA: 0x00009CA4 File Offset: 0x00007EA4
public static ScriptPlayable<TimeControlPlayable> Create(PlayableGraph graph, ITimeControl timeControl)
{
ScriptPlayable<TimeControlPlayable> scriptPlayable;
if (timeControl == null)
{
scriptPlayable = ScriptPlayable<TimeControlPlayable>.Null;
}
else
{
ScriptPlayable<TimeControlPlayable> scriptPlayable2 = ScriptPlayable<TimeControlPlayable>.Create(graph, 0);
scriptPlayable2.GetBehaviour().Initialize(timeControl);
scriptPlayable = scriptPlayable2;
}
return scriptPlayable;
}
// Token: 0x060001E1 RID: 481 RVA: 0x00009CE0 File Offset: 0x00007EE0
public void Initialize(ITimeControl timeControl)
{
this.m_timeControl = timeControl;
}
// Token: 0x060001E2 RID: 482 RVA: 0x00009CEA File Offset: 0x00007EEA
public override void PrepareFrame(Playable playable, FrameData info)
{
if (this.m_timeControl != null)
{
this.m_timeControl.SetTime(playable.GetTime<Playable>());
}
}
// Token: 0x060001E3 RID: 483 RVA: 0x00009D09 File Offset: 0x00007F09
public override void OnBehaviourPlay(Playable playable, FrameData info)
{
if (this.m_timeControl != null)
{
if (!this.m_started)
{
this.m_timeControl.OnControlTimeStart();
this.m_started = true;
}
}
}
// Token: 0x060001E4 RID: 484 RVA: 0x00009D3B File Offset: 0x00007F3B
public override void OnBehaviourPause(Playable playable, FrameData info)
{
if (this.m_timeControl != null)
{
if (this.m_started)
{
this.m_timeControl.OnControlTimeStop();
this.m_started = false;
}
}
}
// Token: 0x040000DE RID: 222
private ITimeControl m_timeControl;
// Token: 0x040000DF RID: 223
private bool m_started;
}
}
@@ -0,0 +1,207 @@
using System;
using System.Linq;
using System.Text.RegularExpressions;
namespace UnityEngine.Timeline
{
// Token: 0x02000040 RID: 64
internal static class TimeUtility
{
// Token: 0x06000202 RID: 514 RVA: 0x0000A3A1 File Offset: 0x000085A1
private static void ValidateFrameRate(double frameRate)
{
if (frameRate <= TimeUtility.kTimeEpsilon)
{
throw new ArgumentException("frame rate cannot be 0 or negative");
}
}
// Token: 0x06000203 RID: 515 RVA: 0x0000A3BC File Offset: 0x000085BC
public static int ToFrames(double time, double frameRate)
{
TimeUtility.ValidateFrameRate(frameRate);
double num = TimeUtility.kTimeEpsilon * time;
int num2;
if (time < 0.0)
{
num2 = (int)Math.Ceiling(time * frameRate + num);
}
else
{
num2 = (int)Math.Floor(time * frameRate + num);
}
return num2;
}
// Token: 0x06000204 RID: 516 RVA: 0x0000A40C File Offset: 0x0000860C
public static double ToExactFrames(double time, double frameRate)
{
TimeUtility.ValidateFrameRate(frameRate);
return time * frameRate;
}
// Token: 0x06000205 RID: 517 RVA: 0x0000A42C File Offset: 0x0000862C
public static double FromFrames(int frames, double frameRate)
{
TimeUtility.ValidateFrameRate(frameRate);
return (double)frames / frameRate;
}
// Token: 0x06000206 RID: 518 RVA: 0x0000A44C File Offset: 0x0000864C
public static double FromFrames(double frames, double frameRate)
{
TimeUtility.ValidateFrameRate(frameRate);
return frames / frameRate;
}
// Token: 0x06000207 RID: 519 RVA: 0x0000A46C File Offset: 0x0000866C
public static bool OnFrameBoundary(double time, double frameRate)
{
return TimeUtility.OnFrameBoundary(time, frameRate, Math.Max(time, 1.0) * frameRate * TimeUtility.kTimeEpsilon);
}
// Token: 0x06000208 RID: 520 RVA: 0x0000A4A0 File Offset: 0x000086A0
public static bool OnFrameBoundary(double time, double frameRate, double epsilon)
{
TimeUtility.ValidateFrameRate(frameRate);
double num = TimeUtility.ToExactFrames(time, frameRate);
double num2 = Math.Round(num);
return Math.Abs(num - num2) < epsilon;
}
// Token: 0x06000209 RID: 521 RVA: 0x0000A4D8 File Offset: 0x000086D8
public static string TimeAsFrames(double timeValue, double frameRate, string format = "F2")
{
string text;
if (TimeUtility.OnFrameBoundary(timeValue, frameRate))
{
text = TimeUtility.ToFrames(timeValue, frameRate).ToString();
}
else
{
text = TimeUtility.ToExactFrames(timeValue, frameRate).ToString(format);
}
return text;
}
// Token: 0x0600020A RID: 522 RVA: 0x0000A524 File Offset: 0x00008724
public static string TimeAsTimeCode(double timeValue, double frameRate, string format = "F2")
{
TimeUtility.ValidateFrameRate(frameRate);
int num = (int)Math.Abs(timeValue);
int num2 = num / 3600;
int num3 = num % 3600 / 60;
int num4 = num % 60;
string text = ((timeValue >= 0.0) ? string.Empty : "-");
string text2;
if (num2 > 0)
{
text2 = string.Concat(new object[]
{
num2,
":",
num3.ToString("D2"),
":",
num4.ToString("D2")
});
}
else if (num3 > 0)
{
text2 = num3 + ":" + num4.ToString("D2");
}
else
{
text2 = num4.ToString();
}
int num5 = (int)Math.Floor(Math.Log10(frameRate) + 1.0);
string text3 = (TimeUtility.ToFrames(timeValue, frameRate) - TimeUtility.ToFrames((double)num, frameRate)).ToString().PadLeft(num5, '0');
if (!TimeUtility.OnFrameBoundary(timeValue, frameRate))
{
string text4 = TimeUtility.ToExactFrames(timeValue, frameRate).ToString(format);
int num6 = text4.IndexOf('.');
if (num6 >= 0)
{
text3 = text3 + " [" + text4.Substring(num6) + "]";
}
}
return text + text2 + ":" + text3;
}
// Token: 0x0600020B RID: 523 RVA: 0x0000A6AC File Offset: 0x000088AC
public static double ParseTimeCode(string timeCode, double frameRate, double defaultValue)
{
timeCode = new string(timeCode.Where((char c) => !char.IsWhiteSpace(c)).ToArray<char>());
string[] array = timeCode.Split(new char[] { ':' });
double num;
if (array.Length == 0 || array.Length > 4)
{
num = defaultValue;
}
else
{
int num2 = 0;
int num3 = 0;
double num4 = 0.0;
double num5 = 0.0;
try
{
if (Regex.Match(array.Last<string>(), "^\\d+\\.\\d+$").Success)
{
num4 = double.Parse(array.Last<string>());
if (array.Length > 3)
{
return defaultValue;
}
if (array.Length > 1)
{
num3 = int.Parse(array[array.Length - 2]);
}
if (array.Length > 2)
{
num2 = int.Parse(array[array.Length - 3]);
}
}
else
{
if (Regex.Match(array.Last<string>(), "^\\d+\\[\\.\\d+\\]$").Success)
{
string text = new string((from c in array.Last<string>()
where c != '[' && c != ']'
select c).ToArray<char>());
num5 = double.Parse(text);
}
else
{
if (!Regex.Match(array.Last<string>(), "^\\d*$").Success)
{
return defaultValue;
}
num5 = (double)int.Parse(array.Last<string>());
}
if (array.Length > 1)
{
num4 = (double)int.Parse(array[array.Length - 2]);
}
if (array.Length > 2)
{
num3 = int.Parse(array[array.Length - 3]);
}
if (array.Length > 3)
{
num2 = int.Parse(array[array.Length - 4]);
}
}
}
catch (FormatException)
{
return defaultValue;
}
num = num5 / frameRate + num4 + (double)(num3 * 60) + (double)(num2 * 3600);
}
return num;
}
// Token: 0x040000E2 RID: 226
public static readonly double kTimeEpsilon = 1E-14;
}
}
@@ -0,0 +1,622 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x0200000C RID: 12
[Serializable]
public class TimelineAsset : PlayableAsset, ISerializationCallbackReceiver, ITimelineClipAsset, IPropertyPreview
{
// Token: 0x17000014 RID: 20
// (get) Token: 0x0600005E RID: 94 RVA: 0x00004618 File Offset: 0x00002818
public TimelineAsset.EditorSettings editorSettings
{
get
{
return this.m_EditorSettings;
}
}
// Token: 0x17000015 RID: 21
// (get) Token: 0x0600005F RID: 95 RVA: 0x00004634 File Offset: 0x00002834
public override double duration
{
get
{
double num;
if (this.m_DurationMode == TimelineAsset.DurationMode.BasedOnClips)
{
num = this.CalculateDuration();
}
else
{
num = this.m_FixedDuration;
}
return num;
}
}
// Token: 0x17000016 RID: 22
// (get) Token: 0x06000060 RID: 96 RVA: 0x00004668 File Offset: 0x00002868
// (set) Token: 0x06000061 RID: 97 RVA: 0x000046B5 File Offset: 0x000028B5
public double fixedDuration
{
get
{
DiscreteTime discreteTime = (DiscreteTime)this.m_FixedDuration;
double num;
if (discreteTime <= 0)
{
num = 0.0;
}
else
{
num = (double)discreteTime.OneTickBefore();
}
return num;
}
set
{
this.m_FixedDuration = Math.Max(0.0, value);
}
}
// Token: 0x17000017 RID: 23
// (get) Token: 0x06000062 RID: 98 RVA: 0x000046D0 File Offset: 0x000028D0
// (set) Token: 0x06000063 RID: 99 RVA: 0x000046EB File Offset: 0x000028EB
public TimelineAsset.DurationMode durationMode
{
get
{
return this.m_DurationMode;
}
set
{
this.m_DurationMode = value;
}
}
// Token: 0x17000018 RID: 24
// (get) Token: 0x06000064 RID: 100 RVA: 0x000046F8 File Offset: 0x000028F8
public override IEnumerable<PlayableBinding> outputs
{
get
{
return this.GetOutputTracks().SelectMany((TrackAsset x) => x.outputs).ToArray<PlayableBinding>();
}
}
// Token: 0x17000019 RID: 25
// (get) Token: 0x06000065 RID: 101 RVA: 0x0000473C File Offset: 0x0000293C
public ClipCaps clipCaps
{
get
{
ClipCaps clipCaps = ClipCaps.All;
foreach (TrackAsset trackAsset in this.m_Tracks)
{
foreach (TimelineClip timelineClip in trackAsset.clips)
{
clipCaps &= timelineClip.clipCaps;
}
}
return clipCaps;
}
}
// Token: 0x1700001A RID: 26
// (get) Token: 0x06000066 RID: 102 RVA: 0x000047D4 File Offset: 0x000029D4
public int outputTrackCount
{
get
{
this.GetOutputTracks();
return this.m_CacheOutputTracks.Length;
}
}
// Token: 0x1700001B RID: 27
// (get) Token: 0x06000067 RID: 103 RVA: 0x000047F8 File Offset: 0x000029F8
public int rootTrackCount
{
get
{
return this.m_Tracks.Count;
}
}
// Token: 0x06000068 RID: 104 RVA: 0x00004818 File Offset: 0x00002A18
public TrackAsset GetRootTrack(int index)
{
return this.m_Tracks[index];
}
// Token: 0x06000069 RID: 105 RVA: 0x0000483C File Offset: 0x00002A3C
public IEnumerable<TrackAsset> GetRootTracks()
{
return this.m_Tracks;
}
// Token: 0x0600006A RID: 106 RVA: 0x00004858 File Offset: 0x00002A58
public TrackAsset GetOutputTrack(int index)
{
this.GetOutputTracks();
return this.m_CacheOutputTracks[index];
}
// Token: 0x0600006B RID: 107 RVA: 0x0000487C File Offset: 0x00002A7C
public IEnumerable<TrackAsset> GetOutputTracks()
{
if (this.m_CacheOutputTracks == null)
{
this.m_CacheOutputTracks = this.flattenedTracks.Where((TrackAsset t) => t != null && t.mediaType != TimelineAsset.MediaType.Group && !t.isSubTrack).ToArray<TrackAsset>();
}
return this.m_CacheOutputTracks;
}
// Token: 0x0600006C RID: 108 RVA: 0x000048D8 File Offset: 0x00002AD8
public void OnEnable()
{
if (this.m_Tracks == null)
{
this.m_Tracks = new List<TrackAsset>();
}
this.m_Tracks.RemoveAll((TrackAsset t) => t == null);
}
// Token: 0x1700001C RID: 28
// (get) Token: 0x0600006D RID: 109 RVA: 0x00004928 File Offset: 0x00002B28
// (set) Token: 0x0600006E RID: 110 RVA: 0x00004943 File Offset: 0x00002B43
internal int id
{
get
{
return this.m_Id;
}
set
{
this.m_Id = value;
}
}
// Token: 0x1700001D RID: 29
// (get) Token: 0x0600006F RID: 111 RVA: 0x00004950 File Offset: 0x00002B50
internal IEnumerable<TrackAsset> flattenedTracks
{
get
{
if (this.m_CacheFlattenedTracks == null)
{
this.m_CacheFlattenedTracks = this.m_Tracks.ToList<TrackAsset>();
foreach (TrackAsset trackAsset in this.m_Tracks)
{
TimelineAsset.AddSubTracksRecursive(trackAsset, ref this.m_CacheFlattenedTracks);
}
}
return this.m_CacheFlattenedTracks;
}
}
// Token: 0x1700001E RID: 30
// (get) Token: 0x06000070 RID: 112 RVA: 0x000049E0 File Offset: 0x00002BE0
internal List<TrackAsset> tracks
{
get
{
return this.m_Tracks;
}
}
// Token: 0x06000071 RID: 113 RVA: 0x000049FB File Offset: 0x00002BFB
internal void AddTrackInternal(TrackAsset track)
{
this.m_Tracks.Add(track);
track.parent = this;
this.Invalidate();
}
// Token: 0x06000072 RID: 114 RVA: 0x00004A18 File Offset: 0x00002C18
internal void AddTrackBefore(TrackAsset track, TrackAsset before)
{
this.AddTrackInternal(track);
this.MoveTracks(new List<TrackAsset> { track }, before, true);
}
// Token: 0x06000073 RID: 115 RVA: 0x00004A44 File Offset: 0x00002C44
internal void AddTrackAfter(TrackAsset track, TrackAsset after)
{
this.AddTrackInternal(track);
this.MoveTracks(new List<TrackAsset> { track }, after, false);
}
// Token: 0x06000074 RID: 116 RVA: 0x00004A70 File Offset: 0x00002C70
internal void MoveTracks(List<TrackAsset> tracks, TrackAsset insertAfterAsset, bool up)
{
List<TrackAsset> list = new List<TrackAsset>(this.m_Tracks);
for (int i = 0; i < tracks.Count; i++)
{
list.Remove(tracks[i]);
}
int num = list.IndexOf(insertAfterAsset);
num = ((!up) ? (num + 1) : Math.Max(num - 1, 0));
if (num < 0)
{
Debug.LogError("target track not found");
}
else
{
for (int j = 0; j < tracks.Count; j++)
{
num = ((!up) ? Math.Min(num, list.Count) : Math.Max(num, 0));
list.Insert(num, tracks[j]);
}
this.m_Tracks = list;
}
}
// Token: 0x06000075 RID: 117 RVA: 0x00004B38 File Offset: 0x00002D38
internal void RemoveTrack(TrackAsset track)
{
this.m_Tracks.Remove(track);
this.Invalidate();
TrackAsset trackAsset = track.parent as TrackAsset;
if (trackAsset != null)
{
trackAsset.RemoveSubTrack(track);
}
}
// Token: 0x06000076 RID: 118 RVA: 0x00004B7C File Offset: 0x00002D7C
internal int GenerateNewId()
{
this.m_NextId++;
return base.GetInstanceID().GetHashCode().CombineHash(this.m_NextId.GetHashCode());
}
// Token: 0x06000077 RID: 119 RVA: 0x00004BCC File Offset: 0x00002DCC
public override Playable CreatePlayable(PlayableGraph graph, GameObject go)
{
bool flag = false;
bool flag2 = graph.GetPlayableCount() == 0;
ScriptPlayable<TimelinePlayable> scriptPlayable = TimelinePlayable.Create(graph, this.flattenedTracks.ToList<TrackAsset>(), go, flag, flag2);
return (!scriptPlayable.IsValid<ScriptPlayable<TimelinePlayable>>()) ? Playable.Null : scriptPlayable;
}
// Token: 0x06000078 RID: 120 RVA: 0x00004C1E File Offset: 0x00002E1E
void ISerializationCallbackReceiver.OnAfterDeserialize()
{
this.Invalidate();
}
// Token: 0x06000079 RID: 121 RVA: 0x00004C27 File Offset: 0x00002E27
void ISerializationCallbackReceiver.OnBeforeSerialize()
{
}
// Token: 0x0600007A RID: 122 RVA: 0x00004C2C File Offset: 0x00002E2C
public void GatherProperties(PlayableDirector director, IPropertyCollector driver)
{
IEnumerable<TrackAsset> outputTracks = this.GetOutputTracks();
foreach (TrackAsset trackAsset in outputTracks)
{
trackAsset.GatherProperties(director, driver);
}
}
// Token: 0x0600007B RID: 123 RVA: 0x00004C8C File Offset: 0x00002E8C
internal void Invalidate()
{
this.m_CacheOutputTracks = null;
this.m_CacheFlattenedTracks = null;
}
// Token: 0x0600007C RID: 124 RVA: 0x00004CA0 File Offset: 0x00002EA0
private double CalculateDuration()
{
IEnumerable<TrackAsset> flattenedTracks = this.flattenedTracks;
double num;
if (!flattenedTracks.Any<TrackAsset>())
{
num = 0.0;
}
else
{
DiscreteTime discreteTime = (DiscreteTime)flattenedTracks.Max((TrackAsset t) => t.end);
if (discreteTime <= 0)
{
num = 0.0;
}
else
{
num = (double)discreteTime.OneTickBefore();
}
}
return num;
}
// Token: 0x0600007D RID: 125 RVA: 0x00004D2C File Offset: 0x00002F2C
private static void AddSubTracksRecursive(TrackAsset track, ref List<TrackAsset> allTracks)
{
if (!(track == null))
{
if (track.subTracks != null && track.subTracks.Count != 0)
{
allTracks.AddRange(track.subTracks);
foreach (TrackAsset trackAsset in track.subTracks)
{
TimelineAsset.AddSubTracksRecursive(trackAsset, ref allTracks);
}
}
}
}
// Token: 0x0600007E RID: 126 RVA: 0x00004DCC File Offset: 0x00002FCC
public TrackAsset CreateTrack(Type type, TrackAsset parent, string name)
{
if (parent != null && parent.timelineAsset != this)
{
throw new InvalidOperationException("Addtrack cannot parent to a track not in the Timeline");
}
if (!typeof(TrackAsset).IsAssignableFrom(type))
{
throw new InvalidOperationException("Supplied type must be a track asset");
}
if (parent != null)
{
if (!TimelineCreateUtilities.ValidateParentTrack(parent, type))
{
throw new InvalidOperationException("Cannot assign a child of type " + type.Name + "to a parent of type " + parent.GetType().Name);
}
}
PlayableAsset playableAsset = ((!(parent != null)) ? this : parent);
string text = name;
if (string.IsNullOrEmpty(text))
{
text = type.Name;
}
string text2 = TimelineCreateUtilities.GenerateUniqueActorName(this, text);
TrackAsset trackAsset = this.AllocateTrack(parent, text2, type);
if (trackAsset != null)
{
trackAsset.name = text2;
TimelineCreateUtilities.SaveAssetIntoObject(trackAsset, playableAsset);
}
return trackAsset;
}
// Token: 0x0600007F RID: 127 RVA: 0x00004EC4 File Offset: 0x000030C4
public T CreateTrack<T>(TrackAsset parent, string name) where T : TrackAsset, new()
{
return (T)((object)this.CreateTrack(typeof(T), parent, name));
}
// Token: 0x06000080 RID: 128 RVA: 0x00004EF0 File Offset: 0x000030F0
public bool DeleteClip(TimelineClip clip)
{
bool flag;
if (clip == null || clip.parentTrack == null)
{
flag = false;
}
else if (this != clip.parentTrack.timelineAsset)
{
Debug.LogError("Cannot delete a clip from this timeline");
flag = false;
}
else
{
if (clip.curves != null)
{
TimelineUndo.PushDestroyUndo(this, clip.parentTrack, clip.curves, "Delete Curves");
}
if (clip.asset != null)
{
this.DeleteRecordedAnimation(clip);
TimelineUndo.PushDestroyUndo(this, clip.parentTrack, clip.asset, "Delete Clip Asset");
}
TrackAsset parentTrack = clip.parentTrack;
parentTrack.RemoveClip(clip);
parentTrack.CalculateExtrapolationTimes();
flag = true;
}
return flag;
}
// Token: 0x06000081 RID: 129 RVA: 0x00004FC0 File Offset: 0x000031C0
public bool DeleteTrack(TrackAsset track)
{
bool flag;
if (track.timelineAsset != this)
{
flag = false;
}
else
{
TrackAsset trackAsset = track.parent as TrackAsset;
if (trackAsset != null)
{
}
if (track.subTracks != null)
{
IEnumerable<TrackAsset> childTracks = track.GetChildTracks();
foreach (TrackAsset trackAsset2 in childTracks)
{
this.DeleteTrack(trackAsset2);
}
}
this.DeleteRecordingClip(track);
List<TimelineClip> list = new List<TimelineClip>(track.clips);
foreach (TimelineClip timelineClip in list)
{
this.DeleteClip(timelineClip);
}
this.RemoveTrack(track);
TimelineUndo.PushDestroyUndo(this, this, track, "Delete Track");
flag = true;
}
return flag;
}
// Token: 0x06000082 RID: 130 RVA: 0x000050E0 File Offset: 0x000032E0
internal TrackAsset AllocateTrack(TrackAsset parent, string name, Type trackType)
{
if (parent != null && parent.timelineAsset != this)
{
throw new InvalidOperationException("Addtrack cannot parent to a track not in the Timeline");
}
if (!typeof(TrackAsset).IsAssignableFrom(trackType))
{
throw new InvalidOperationException("Supplied type must be a track asset");
}
TrackAsset trackAsset = ScriptableObject.CreateInstance(trackType) as TrackAsset;
if (parent != null)
{
trackAsset.parent = parent;
}
else
{
trackAsset.parent = this;
}
trackAsset.name = name;
if (parent != null)
{
parent.subTracks.Add(trackAsset);
}
else
{
this.AddTrackInternal(trackAsset);
}
this.Invalidate();
return trackAsset;
}
// Token: 0x06000083 RID: 131 RVA: 0x000051A4 File Offset: 0x000033A4
private void DeleteRecordingClip(TrackAsset track)
{
AnimationTrack animationTrack = track as AnimationTrack;
if (!(animationTrack == null) && !(animationTrack.animClip == null))
{
TimelineUndo.PushDestroyUndo(this, track, animationTrack.animClip, "Delete Track");
}
}
// Token: 0x06000084 RID: 132 RVA: 0x000051F0 File Offset: 0x000033F0
private void DeleteRecordedAnimation(TimelineClip clip)
{
if (clip != null)
{
if (clip.curves != null)
{
TimelineUndo.PushDestroyUndo(this, clip.parentTrack, clip.curves, "Delete Parameters");
}
if (clip.recordable)
{
AnimationPlayableAsset animationPlayableAsset = clip.asset as AnimationPlayableAsset;
if (!(animationPlayableAsset == null) && !(animationPlayableAsset.clip == null))
{
TimelineUndo.PushDestroyUndo(this, animationPlayableAsset, animationPlayableAsset.clip, "Delete Recording");
}
}
}
}
// Token: 0x0400001E RID: 30
[HideInInspector]
[SerializeField]
private int m_Id;
// Token: 0x0400001F RID: 31
[HideInInspector]
[SerializeField]
private int m_NextId;
// Token: 0x04000020 RID: 32
[HideInInspector]
[SerializeField]
private List<TrackAsset> m_Tracks;
// Token: 0x04000021 RID: 33
[HideInInspector]
[SerializeField]
private double m_FixedDuration;
// Token: 0x04000022 RID: 34
[HideInInspector]
[NonSerialized]
private TrackAsset[] m_CacheOutputTracks;
// Token: 0x04000023 RID: 35
[HideInInspector]
[NonSerialized]
private List<TrackAsset> m_CacheFlattenedTracks;
// Token: 0x04000024 RID: 36
[HideInInspector]
[SerializeField]
private TimelineAsset.EditorSettings m_EditorSettings = new TimelineAsset.EditorSettings();
// Token: 0x04000025 RID: 37
[SerializeField]
public TimelineAsset.SequenceUpdateMode m_UpdateMode = TimelineAsset.SequenceUpdateMode.TimeBased;
// Token: 0x04000026 RID: 38
[SerializeField]
public string m_ParameterName = "";
// Token: 0x04000027 RID: 39
[SerializeField]
public TimelineAsset.DurationMode m_DurationMode;
// Token: 0x0200000D RID: 13
public enum SequenceUpdateMode
{
// Token: 0x0400002D RID: 45
TimeBased,
// Token: 0x0400002E RID: 46
ParameterBased,
// Token: 0x0400002F RID: 47
ParentSequence
}
// Token: 0x0200000E RID: 14
public enum MediaType
{
// Token: 0x04000031 RID: 49
Animation,
// Token: 0x04000032 RID: 50
Audio,
// Token: 0x04000033 RID: 51
Video,
// Token: 0x04000034 RID: 52
Script,
// Token: 0x04000035 RID: 53
Hybrid,
// Token: 0x04000036 RID: 54
Group
}
// Token: 0x0200000F RID: 15
public enum DurationMode
{
// Token: 0x04000038 RID: 56
BasedOnClips,
// Token: 0x04000039 RID: 57
FixedLength
}
// Token: 0x02000010 RID: 16
[Serializable]
public class EditorSettings
{
// Token: 0x0400003A RID: 58
internal static readonly float kDefaultFPS = 60f;
// Token: 0x0400003B RID: 59
[HideInInspector]
[SerializeField]
public float fps = TimelineAsset.EditorSettings.kDefaultFPS;
}
}
}
@@ -0,0 +1,917 @@
using System;
using System.Collections.Generic;
using UnityEngine.Playables;
using UnityEngine.Serialization;
namespace UnityEngine.Timeline
{
// Token: 0x02000018 RID: 24
[Serializable]
public class TimelineClip
{
// Token: 0x06000092 RID: 146 RVA: 0x0000537C File Offset: 0x0000357C
internal TimelineClip(TrackAsset parent)
{
this.parentTrack = parent;
}
// Token: 0x17000020 RID: 32
// (get) Token: 0x06000093 RID: 147 RVA: 0x0000540C File Offset: 0x0000360C
// (set) Token: 0x06000094 RID: 148 RVA: 0x00005426 File Offset: 0x00003626
internal int dirtyHash { get; set; }
// Token: 0x17000021 RID: 33
// (get) Token: 0x06000095 RID: 149 RVA: 0x00005430 File Offset: 0x00003630
public bool hasPreExtrapolation
{
get
{
return this.m_PreExtrapolationMode != TimelineClip.ClipExtrapolation.None && this.m_PreExtrapolationTime > 0.0;
}
}
// Token: 0x17000022 RID: 34
// (get) Token: 0x06000096 RID: 150 RVA: 0x00005464 File Offset: 0x00003664
public bool hasPostExtrapolation
{
get
{
return this.m_PostExtrapolationMode != TimelineClip.ClipExtrapolation.None && this.m_PostExtrapolationTime > 0.0;
}
}
// Token: 0x17000023 RID: 35
// (get) Token: 0x06000097 RID: 151 RVA: 0x00005498 File Offset: 0x00003698
// (set) Token: 0x06000098 RID: 152 RVA: 0x000054E6 File Offset: 0x000036E6
public double timeScale
{
get
{
return (!this.clipCaps.HasAny(ClipCaps.SpeedMultiplier)) ? 1.0 : Math.Max(TimelineClip.kTimeScaleMin, Math.Min(this.m_TimeScale, TimelineClip.kTimeScaleMax));
}
set
{
this.m_TimeScale = ((!this.clipCaps.HasAny(ClipCaps.SpeedMultiplier)) ? 1.0 : Math.Max(TimelineClip.kTimeScaleMin, Math.Min(value, TimelineClip.kTimeScaleMax)));
}
}
// Token: 0x17000024 RID: 36
// (get) Token: 0x06000099 RID: 153 RVA: 0x00005524 File Offset: 0x00003724
// (set) Token: 0x0600009A RID: 154 RVA: 0x0000553F File Offset: 0x0000373F
public double start
{
get
{
return this.m_Start;
}
set
{
this.m_Start = Math.Max(TimelineClip.SanitizeTimeValue(value, this.m_Start), 0.0);
}
}
// Token: 0x17000025 RID: 37
// (get) Token: 0x0600009B RID: 155 RVA: 0x00005564 File Offset: 0x00003764
// (set) Token: 0x0600009C RID: 156 RVA: 0x0000557F File Offset: 0x0000377F
public double duration
{
get
{
return this.m_Duration;
}
set
{
this.m_Duration = Math.Max(TimelineClip.SanitizeTimeValue(value, this.m_Duration), double.Epsilon);
}
}
// Token: 0x17000026 RID: 38
// (get) Token: 0x0600009D RID: 157 RVA: 0x000055A4 File Offset: 0x000037A4
public double end
{
get
{
return this.m_Start + this.m_Duration;
}
}
// Token: 0x17000027 RID: 39
// (get) Token: 0x0600009E RID: 158 RVA: 0x000055C8 File Offset: 0x000037C8
// (set) Token: 0x0600009F RID: 159 RVA: 0x00005604 File Offset: 0x00003804
public double clipIn
{
get
{
return (!this.clipCaps.HasAny(ClipCaps.ClipIn)) ? 0.0 : this.m_ClipIn;
}
set
{
this.m_ClipIn = ((!this.clipCaps.HasAny(ClipCaps.ClipIn)) ? 0.0 : Math.Max(Math.Min(TimelineClip.SanitizeTimeValue(value, this.m_ClipIn), this.clipAssetDuration), 0.0));
}
}
// Token: 0x17000028 RID: 40
// (get) Token: 0x060000A0 RID: 160 RVA: 0x0000565C File Offset: 0x0000385C
// (set) Token: 0x060000A1 RID: 161 RVA: 0x00005677 File Offset: 0x00003877
public string displayName
{
get
{
return this.m_DisplayName;
}
set
{
this.m_DisplayName = value;
}
}
// Token: 0x17000029 RID: 41
// (get) Token: 0x060000A2 RID: 162 RVA: 0x00005684 File Offset: 0x00003884
public double clipAssetDuration
{
get
{
IPlayableAsset playableAsset = this.m_Asset as IPlayableAsset;
return (playableAsset == null) ? double.MaxValue : playableAsset.duration;
}
}
// Token: 0x1700002A RID: 42
// (get) Token: 0x060000A3 RID: 163 RVA: 0x000056C0 File Offset: 0x000038C0
public AnimationClip curves
{
get
{
return this.m_AnimationCurves;
}
}
// Token: 0x1700002B RID: 43
// (get) Token: 0x060000A4 RID: 164 RVA: 0x000056DC File Offset: 0x000038DC
// (set) Token: 0x060000A5 RID: 165 RVA: 0x000056F7 File Offset: 0x000038F7
public Object asset
{
get
{
return this.m_Asset;
}
set
{
this.m_Asset = value;
}
}
// Token: 0x1700002C RID: 44
// (get) Token: 0x060000A6 RID: 166 RVA: 0x00005704 File Offset: 0x00003904
// (set) Token: 0x060000A7 RID: 167 RVA: 0x0000573B File Offset: 0x0000393B
public Object underlyingAsset
{
get
{
return (!(this.m_UnderlyingAsset != null)) ? this.m_Asset : this.m_UnderlyingAsset;
}
set
{
this.m_UnderlyingAsset = value;
}
}
// Token: 0x1700002D RID: 45
// (get) Token: 0x060000A8 RID: 168 RVA: 0x00005748 File Offset: 0x00003948
// (set) Token: 0x060000A9 RID: 169 RVA: 0x00005764 File Offset: 0x00003964
internal TrackAsset parentTrack
{
get
{
return this.m_ParentTrack;
}
set
{
if (!(value == null))
{
if (!(this.m_ParentTrack == value))
{
if (this.m_ParentTrack != null)
{
this.m_ParentTrack.RemoveClip(this);
}
this.m_ParentTrack = value;
this.m_ParentTrack.AddClip(this);
}
}
}
}
// Token: 0x1700002E RID: 46
// (get) Token: 0x060000AA RID: 170 RVA: 0x000057CC File Offset: 0x000039CC
// (set) Token: 0x060000AB RID: 171 RVA: 0x0000582A File Offset: 0x00003A2A
public double easeInDuration
{
get
{
return (!this.clipCaps.HasAny(ClipCaps.Blending)) ? 0.0 : Math.Min(Math.Max(this.m_EaseInDuration, 0.0), this.duration * 0.49);
}
set
{
this.m_EaseInDuration = ((!this.clipCaps.HasAny(ClipCaps.Blending)) ? 0.0 : TimelineClip.SanitizeTimeValue(value, this.m_EaseInDuration));
}
}
// Token: 0x1700002F RID: 47
// (get) Token: 0x060000AC RID: 172 RVA: 0x00005860 File Offset: 0x00003A60
// (set) Token: 0x060000AD RID: 173 RVA: 0x000058BE File Offset: 0x00003ABE
public double easeOutDuration
{
get
{
return (!this.clipCaps.HasAny(ClipCaps.Blending)) ? 0.0 : Math.Min(Math.Max(this.m_EaseOutDuration, 0.0), this.duration * 0.49);
}
set
{
this.m_EaseOutDuration = ((!this.clipCaps.HasAny(ClipCaps.Blending)) ? 0.0 : TimelineClip.SanitizeTimeValue(value, this.m_EaseOutDuration));
}
}
// Token: 0x17000030 RID: 48
// (get) Token: 0x060000AE RID: 174 RVA: 0x000058F4 File Offset: 0x00003AF4
public double eastOutTime
{
get
{
return this.duration - this.easeOutDuration + this.m_Start;
}
}
// Token: 0x17000031 RID: 49
// (get) Token: 0x060000AF RID: 175 RVA: 0x00005920 File Offset: 0x00003B20
// (set) Token: 0x060000B0 RID: 176 RVA: 0x0000595B File Offset: 0x00003B5B
public double blendInDuration
{
get
{
return (!this.clipCaps.HasAny(ClipCaps.Blending)) ? 0.0 : this.m_BlendInDuration;
}
set
{
this.m_BlendInDuration = ((!this.clipCaps.HasAny(ClipCaps.Blending)) ? 0.0 : TimelineClip.SanitizeTimeValue(value, this.m_BlendInDuration));
}
}
// Token: 0x17000032 RID: 50
// (get) Token: 0x060000B1 RID: 177 RVA: 0x00005990 File Offset: 0x00003B90
// (set) Token: 0x060000B2 RID: 178 RVA: 0x000059CB File Offset: 0x00003BCB
public double blendOutDuration
{
get
{
return (!this.clipCaps.HasAny(ClipCaps.Blending)) ? 0.0 : this.m_BlendOutDuration;
}
set
{
this.m_BlendOutDuration = ((!this.clipCaps.HasAny(ClipCaps.Blending)) ? 0.0 : TimelineClip.SanitizeTimeValue(value, this.m_BlendOutDuration));
}
}
// Token: 0x17000033 RID: 51
// (get) Token: 0x060000B3 RID: 179 RVA: 0x00005A00 File Offset: 0x00003C00
// (set) Token: 0x060000B4 RID: 180 RVA: 0x00005A1B File Offset: 0x00003C1B
public TimelineClip.BlendCurveMode blendInCurveMode
{
get
{
return this.m_BlendInCurveMode;
}
set
{
this.m_BlendInCurveMode = value;
}
}
// Token: 0x17000034 RID: 52
// (get) Token: 0x060000B5 RID: 181 RVA: 0x00005A28 File Offset: 0x00003C28
// (set) Token: 0x060000B6 RID: 182 RVA: 0x00005A43 File Offset: 0x00003C43
public TimelineClip.BlendCurveMode blendOutCurveMode
{
get
{
return this.m_BlendOutCurveMode;
}
set
{
this.m_BlendOutCurveMode = value;
}
}
// Token: 0x17000035 RID: 53
// (get) Token: 0x060000B7 RID: 183 RVA: 0x00005A50 File Offset: 0x00003C50
public bool hasBlendIn
{
get
{
return this.clipCaps.HasAny(ClipCaps.Blending) && this.m_BlendInDuration > 0.0;
}
}
// Token: 0x17000036 RID: 54
// (get) Token: 0x060000B8 RID: 184 RVA: 0x00005A8C File Offset: 0x00003C8C
public bool hasBlendOut
{
get
{
return this.clipCaps.HasAny(ClipCaps.Blending) && this.m_BlendOutDuration > 0.0;
}
}
// Token: 0x17000037 RID: 55
// (get) Token: 0x060000B9 RID: 185 RVA: 0x00005AC8 File Offset: 0x00003CC8
// (set) Token: 0x060000BA RID: 186 RVA: 0x00005B0B File Offset: 0x00003D0B
public AnimationCurve mixInCurve
{
get
{
if (this.m_MixInCurve == null || this.m_MixInCurve.length < 2)
{
this.m_MixInCurve = this.GetDefaultMixInCurve();
}
return this.m_MixInCurve;
}
set
{
this.m_MixInCurve = value;
}
}
// Token: 0x17000038 RID: 56
// (get) Token: 0x060000BB RID: 187 RVA: 0x00005B18 File Offset: 0x00003D18
public float mixInPercentage
{
get
{
return (float)(this.mixInDuration / this.duration);
}
}
// Token: 0x17000039 RID: 57
// (get) Token: 0x060000BC RID: 188 RVA: 0x00005B3C File Offset: 0x00003D3C
public double mixInDuration
{
get
{
return (!this.hasBlendIn) ? this.easeInDuration : this.blendInDuration;
}
}
// Token: 0x1700003A RID: 58
// (get) Token: 0x060000BD RID: 189 RVA: 0x00005B70 File Offset: 0x00003D70
// (set) Token: 0x060000BE RID: 190 RVA: 0x00005BB3 File Offset: 0x00003DB3
public AnimationCurve mixOutCurve
{
get
{
if (this.m_MixOutCurve == null || this.m_MixOutCurve.length < 2)
{
this.m_MixOutCurve = this.GetDefaultMixOutCurve();
}
return this.m_MixOutCurve;
}
set
{
this.m_MixOutCurve = value;
}
}
// Token: 0x1700003B RID: 59
// (get) Token: 0x060000BF RID: 191 RVA: 0x00005BC0 File Offset: 0x00003DC0
public double mixOutTime
{
get
{
return this.duration - this.mixOutDuration + this.m_Start;
}
}
// Token: 0x1700003C RID: 60
// (get) Token: 0x060000C0 RID: 192 RVA: 0x00005BEC File Offset: 0x00003DEC
public double mixOutDuration
{
get
{
return (!this.hasBlendOut) ? this.easeOutDuration : this.blendOutDuration;
}
}
// Token: 0x1700003D RID: 61
// (get) Token: 0x060000C1 RID: 193 RVA: 0x00005C20 File Offset: 0x00003E20
public float mixOutPercentage
{
get
{
return (float)(this.mixOutDuration / this.duration);
}
}
// Token: 0x1700003E RID: 62
// (get) Token: 0x060000C2 RID: 194 RVA: 0x00005C44 File Offset: 0x00003E44
// (set) Token: 0x060000C3 RID: 195 RVA: 0x00005C5F File Offset: 0x00003E5F
public bool recordable
{
get
{
return this.m_Recordable;
}
internal set
{
this.m_Recordable = value;
}
}
// Token: 0x1700003F RID: 63
// (get) Token: 0x060000C4 RID: 196 RVA: 0x00005C6C File Offset: 0x00003E6C
public bool locked
{
get
{
return this.parentTrack != null && this.parentTrack.locked;
}
}
// Token: 0x17000040 RID: 64
// (get) Token: 0x060000C5 RID: 197 RVA: 0x00005CA0 File Offset: 0x00003EA0
// (set) Token: 0x060000C6 RID: 198 RVA: 0x00005CBA File Offset: 0x00003EBA
public bool recordingSelected { get; set; }
// Token: 0x17000041 RID: 65
// (get) Token: 0x060000C7 RID: 199 RVA: 0x00005CC4 File Offset: 0x00003EC4
public List<string> exposedParameters
{
get
{
List<string> list;
if ((list = this.m_ExposedParameterNames) == null)
{
list = (this.m_ExposedParameterNames = new List<string>());
}
return list;
}
}
// Token: 0x17000042 RID: 66
// (get) Token: 0x060000C8 RID: 200 RVA: 0x00005CF4 File Offset: 0x00003EF4
public ClipCaps clipCaps
{
get
{
ITimelineClipAsset timelineClipAsset = this.asset as ITimelineClipAsset;
return (timelineClipAsset == null) ? TimelineClip.kDefaultClipCaps : timelineClipAsset.clipCaps;
}
}
// Token: 0x060000C9 RID: 201 RVA: 0x00005D2C File Offset: 0x00003F2C
internal int Hash()
{
return HashUtility.CombineHash(this.m_ID.GetHashCode(), this.m_Start.GetHashCode(), this.m_Duration.GetHashCode(), this.m_TimeScale.GetHashCode(), this.m_ClipIn.GetHashCode(), this.m_PreExtrapolationMode.GetHashCode(), this.m_PostExtrapolationMode.GetHashCode());
}
// Token: 0x060000CA RID: 202 RVA: 0x00005DC0 File Offset: 0x00003FC0
public float EvaluateMixOut(double localTime)
{
float num;
if (!this.clipCaps.HasAny(ClipCaps.Blending))
{
num = 1f;
}
else if (this.mixOutDuration > (double)Mathf.Epsilon)
{
float num2 = (float)(localTime - this.mixOutTime) / (float)this.mixOutDuration;
num2 = Mathf.Clamp01(this.mixOutCurve.Evaluate(num2));
num = num2;
}
else
{
num = 1f;
}
return num;
}
// Token: 0x060000CB RID: 203 RVA: 0x00005E34 File Offset: 0x00004034
public float EvaluateMixIn(double localTime)
{
float num;
if (!this.clipCaps.HasAny(ClipCaps.Blending))
{
num = 1f;
}
else if (this.mixInDuration > (double)Mathf.Epsilon)
{
float num2 = (float)(localTime - this.m_Start) / (float)this.mixInDuration;
num2 = Mathf.Clamp01(this.mixInCurve.Evaluate(num2));
num = num2;
}
else
{
num = 1f;
}
return num;
}
// Token: 0x060000CC RID: 204 RVA: 0x00005EA8 File Offset: 0x000040A8
private AnimationCurve GetDefaultMixInCurve()
{
return AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
}
// Token: 0x060000CD RID: 205 RVA: 0x00005ED8 File Offset: 0x000040D8
private AnimationCurve GetDefaultMixOutCurve()
{
return AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
}
// Token: 0x060000CE RID: 206 RVA: 0x00005F08 File Offset: 0x00004108
public double ToLocalTime(double time)
{
double num;
if (time < 0.0)
{
num = time;
}
else
{
if (this.IsPreExtrapolatedTime(time))
{
time = TimelineClip.GetExtrapolatedTime(time - this.m_Start, this.m_PreExtrapolationMode, this.m_Duration);
}
else if (this.IsPostExtrapolatedTime(time))
{
time = TimelineClip.GetExtrapolatedTime(time - this.m_Start, this.m_PostExtrapolationMode, this.m_Duration);
}
else
{
time -= this.m_Start;
}
time += this.clipIn;
time *= this.timeScale;
num = time;
}
return num;
}
// Token: 0x060000CF RID: 207 RVA: 0x00005FAC File Offset: 0x000041AC
public double ToLocalTimeUnbound(double time)
{
return (time - this.m_Start + this.clipIn) * this.timeScale;
}
// Token: 0x060000D0 RID: 208 RVA: 0x00005FD8 File Offset: 0x000041D8
internal double FromLocalTimeUnbound(double time)
{
return time / this.timeScale + this.m_Start - this.clipIn;
}
// Token: 0x17000043 RID: 67
// (get) Token: 0x060000D1 RID: 209 RVA: 0x00006004 File Offset: 0x00004204
public AnimationClip animationClip
{
get
{
AnimationClip animationClip;
if (this.m_Asset == null)
{
animationClip = null;
}
else
{
AnimationPlayableAsset animationPlayableAsset = this.m_Asset as AnimationPlayableAsset;
animationClip = ((!(animationPlayableAsset != null)) ? null : animationPlayableAsset.clip);
}
return animationClip;
}
}
// Token: 0x060000D2 RID: 210 RVA: 0x00006058 File Offset: 0x00004258
private static double SanitizeTimeValue(double value, double defaultValue)
{
double num;
if (double.IsInfinity(value) || double.IsNaN(value))
{
Debug.LogError("Invalid time value assigned");
num = defaultValue;
}
else
{
num = Math.Max(-TimelineClip.kMaxTimeValue, Math.Min(TimelineClip.kMaxTimeValue, value));
}
return num;
}
// Token: 0x17000044 RID: 68
// (get) Token: 0x060000D3 RID: 211 RVA: 0x000060AC File Offset: 0x000042AC
// (set) Token: 0x060000D4 RID: 212 RVA: 0x000060DE File Offset: 0x000042DE
public TimelineClip.ClipExtrapolation postExtrapolationMode
{
get
{
return (!this.clipCaps.HasAny(ClipCaps.Extrapolation)) ? TimelineClip.ClipExtrapolation.None : this.m_PostExtrapolationMode;
}
internal set
{
this.m_PostExtrapolationMode = ((!this.clipCaps.HasAny(ClipCaps.Extrapolation)) ? TimelineClip.ClipExtrapolation.None : value);
}
}
// Token: 0x17000045 RID: 69
// (get) Token: 0x060000D5 RID: 213 RVA: 0x00006100 File Offset: 0x00004300
// (set) Token: 0x060000D6 RID: 214 RVA: 0x00006132 File Offset: 0x00004332
public TimelineClip.ClipExtrapolation preExtrapolationMode
{
get
{
return (!this.clipCaps.HasAny(ClipCaps.Extrapolation)) ? TimelineClip.ClipExtrapolation.None : this.m_PreExtrapolationMode;
}
internal set
{
this.m_PreExtrapolationMode = ((!this.clipCaps.HasAny(ClipCaps.Extrapolation)) ? TimelineClip.ClipExtrapolation.None : value);
}
}
// Token: 0x060000D7 RID: 215 RVA: 0x00006153 File Offset: 0x00004353
internal void SetPostExtrapolationTime(double time)
{
this.m_PostExtrapolationTime = time;
}
// Token: 0x060000D8 RID: 216 RVA: 0x0000615D File Offset: 0x0000435D
internal void SetPreExtrapolationTime(double time)
{
this.m_PreExtrapolationTime = time;
}
// Token: 0x060000D9 RID: 217 RVA: 0x00006168 File Offset: 0x00004368
public bool IsExtrapolatedTime(double sequenceTime)
{
return this.IsPreExtrapolatedTime(sequenceTime) || this.IsPostExtrapolatedTime(sequenceTime);
}
// Token: 0x060000DA RID: 218 RVA: 0x00006194 File Offset: 0x00004394
public bool IsPreExtrapolatedTime(double sequenceTime)
{
return this.preExtrapolationMode != TimelineClip.ClipExtrapolation.None && sequenceTime < this.m_Start && sequenceTime >= this.m_Start - this.m_PreExtrapolationTime;
}
// Token: 0x060000DB RID: 219 RVA: 0x000061DC File Offset: 0x000043DC
public bool IsPostExtrapolatedTime(double sequenceTime)
{
return this.postExtrapolationMode != TimelineClip.ClipExtrapolation.None && sequenceTime > this.end && sequenceTime - this.end < this.m_PostExtrapolationTime;
}
// Token: 0x17000046 RID: 70
// (get) Token: 0x060000DC RID: 220 RVA: 0x0000621C File Offset: 0x0000441C
public double extrapolatedStart
{
get
{
double num;
if (this.m_PreExtrapolationMode != TimelineClip.ClipExtrapolation.None)
{
num = this.m_Start - this.m_PreExtrapolationTime;
}
else
{
num = this.m_Start;
}
return num;
}
}
// Token: 0x17000047 RID: 71
// (get) Token: 0x060000DD RID: 221 RVA: 0x00006258 File Offset: 0x00004458
public double extrapolatedDuration
{
get
{
double num = this.m_Duration;
if (this.m_PostExtrapolationMode != TimelineClip.ClipExtrapolation.None)
{
num += Math.Min(this.m_PostExtrapolationTime, TimelineClip.kMaxTimeValue);
}
if (this.m_PreExtrapolationMode != TimelineClip.ClipExtrapolation.None)
{
num += this.m_PreExtrapolationTime;
}
return num;
}
}
// Token: 0x060000DE RID: 222 RVA: 0x000062A8 File Offset: 0x000044A8
private static double GetExtrapolatedTime(double time, TimelineClip.ClipExtrapolation mode, double duration)
{
double num;
if (duration == 0.0)
{
num = 0.0;
}
else
{
switch (mode)
{
case TimelineClip.ClipExtrapolation.Hold:
if (time < 0.0)
{
return 0.0;
}
if (time > duration)
{
return duration;
}
break;
case TimelineClip.ClipExtrapolation.Loop:
if (time < 0.0)
{
time = duration - -time % duration;
}
else if (time > duration)
{
time %= duration;
}
break;
case TimelineClip.ClipExtrapolation.PingPong:
if (time < 0.0)
{
time = duration * 2.0 - -time % (duration * 2.0);
time = duration - Math.Abs(time - duration);
}
else
{
time %= duration * 2.0;
time = duration - Math.Abs(time - duration);
}
break;
}
num = time;
}
return num;
}
// Token: 0x060000DF RID: 223 RVA: 0x000063C3 File Offset: 0x000045C3
internal void AllocateAnimatedParameterCurves()
{
if (this.m_AnimationCurves == null)
{
this.m_AnimationCurves = new AnimationClip();
this.m_AnimationCurves.legacy = true;
}
}
// Token: 0x060000E0 RID: 224 RVA: 0x000063F0 File Offset: 0x000045F0
internal void ClearAnimatedParameterCurves()
{
this.m_AnimationCurves = null;
}
// Token: 0x04000041 RID: 65
public static readonly ClipCaps kDefaultClipCaps = ClipCaps.Blending;
// Token: 0x04000042 RID: 66
public static readonly float kDefaultClipDurationInSeconds = 5f;
// Token: 0x04000043 RID: 67
public static readonly double kTimeScaleMin = 0.001;
// Token: 0x04000044 RID: 68
public static readonly double kTimeScaleMax = 1000.0;
// Token: 0x04000045 RID: 69
internal static readonly double kMinDuration = 0.016666666666666666;
// Token: 0x04000046 RID: 70
internal static readonly double kMaxTimeValue = 1000000.0;
// Token: 0x04000047 RID: 71
[SerializeField]
private double m_Start;
// Token: 0x04000048 RID: 72
[SerializeField]
private double m_ClipIn;
// Token: 0x04000049 RID: 73
[SerializeField]
private Object m_Asset;
// Token: 0x0400004A RID: 74
[SerializeField]
private Object m_UnderlyingAsset;
// Token: 0x0400004B RID: 75
[SerializeField]
[FormerlySerializedAs("m_HackDuration")]
private double m_Duration;
// Token: 0x0400004C RID: 76
[SerializeField]
private int m_ParentID;
// Token: 0x0400004D RID: 77
[SerializeField]
private double m_TimeScale = 1.0;
// Token: 0x0400004E RID: 78
[SerializeField]
private AnimationCurve m_BlendCurve;
// Token: 0x0400004F RID: 79
[SerializeField]
private TrackAsset m_ParentTrack;
// Token: 0x04000050 RID: 80
[SerializeField]
private double m_EaseInDuration = 0.0;
// Token: 0x04000051 RID: 81
[SerializeField]
private double m_EaseOutDuration = 0.0;
// Token: 0x04000052 RID: 82
[SerializeField]
private double m_BlendInDuration = -1.0;
// Token: 0x04000053 RID: 83
[SerializeField]
private double m_BlendOutDuration = -1.0;
// Token: 0x04000054 RID: 84
[SerializeField]
private AnimationCurve m_MixInCurve = null;
// Token: 0x04000055 RID: 85
[SerializeField]
private AnimationCurve m_MixOutCurve = null;
// Token: 0x04000056 RID: 86
[SerializeField]
private TimelineClip.BlendCurveMode m_BlendInCurveMode = TimelineClip.BlendCurveMode.Auto;
// Token: 0x04000057 RID: 87
[SerializeField]
private TimelineClip.BlendCurveMode m_BlendOutCurveMode = TimelineClip.BlendCurveMode.Auto;
// Token: 0x04000058 RID: 88
[SerializeField]
private List<string> m_ExposedParameterNames;
// Token: 0x04000059 RID: 89
[SerializeField]
private AnimationClip m_AnimationCurves;
// Token: 0x0400005A RID: 90
[SerializeField]
public int m_ID = -1;
// Token: 0x0400005B RID: 91
[SerializeField]
private bool m_Recordable = false;
// Token: 0x0400005C RID: 92
[SerializeField]
private TimelineClip.ClipExtrapolation m_PostExtrapolationMode;
// Token: 0x0400005D RID: 93
[SerializeField]
private TimelineClip.ClipExtrapolation m_PreExtrapolationMode;
// Token: 0x0400005E RID: 94
[SerializeField]
private double m_PostExtrapolationTime;
// Token: 0x0400005F RID: 95
[SerializeField]
private double m_PreExtrapolationTime;
// Token: 0x04000060 RID: 96
[SerializeField]
private string m_DisplayName;
// Token: 0x02000019 RID: 25
public enum ClipExtrapolation
{
// Token: 0x04000064 RID: 100
None,
// Token: 0x04000065 RID: 101
Hold,
// Token: 0x04000066 RID: 102
Loop,
// Token: 0x04000067 RID: 103
PingPong,
// Token: 0x04000068 RID: 104
Continue
}
// Token: 0x0200001A RID: 26
public enum BlendCurveMode
{
// Token: 0x0400006A RID: 106
Auto,
// Token: 0x0400006B RID: 107
Manual
}
}
}
@@ -0,0 +1,50 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x02000003 RID: 3
internal static class TimelineClipCapsExtensions
{
// Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000250
public static bool SupportsLooping(this TimelineClip clip)
{
return clip != null && (clip.clipCaps & ClipCaps.Looping) != ClipCaps.None;
}
// Token: 0x06000002 RID: 2 RVA: 0x0000207C File Offset: 0x0000027C
public static bool SupportsExtrapolation(this TimelineClip clip)
{
return clip != null && (clip.clipCaps & ClipCaps.Extrapolation) != ClipCaps.None;
}
// Token: 0x06000003 RID: 3 RVA: 0x000020A8 File Offset: 0x000002A8
public static bool SupportsClipIn(this TimelineClip clip)
{
return clip != null && (clip.clipCaps & ClipCaps.ClipIn) != ClipCaps.None;
}
// Token: 0x06000004 RID: 4 RVA: 0x000020D4 File Offset: 0x000002D4
public static bool SupportsSpeedMultiplier(this TimelineClip clip)
{
return clip != null && (clip.clipCaps & ClipCaps.SpeedMultiplier) != ClipCaps.None;
}
// Token: 0x06000005 RID: 5 RVA: 0x00002100 File Offset: 0x00000300
public static bool SupportsBlending(this TimelineClip clip)
{
return clip != null && (clip.clipCaps & ClipCaps.Blending) != ClipCaps.None;
}
// Token: 0x06000006 RID: 6 RVA: 0x00002130 File Offset: 0x00000330
public static bool HasAll(this ClipCaps caps, ClipCaps flags)
{
return (caps & flags) == flags;
}
// Token: 0x06000007 RID: 7 RVA: 0x0000214C File Offset: 0x0000034C
public static bool HasAny(this ClipCaps caps, ClipCaps flags)
{
return (caps & flags) != ClipCaps.None;
}
}
}
@@ -0,0 +1,85 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x0200003E RID: 62
internal static class TimelineCreateUtilities
{
// Token: 0x060001FD RID: 509 RVA: 0x0000A180 File Offset: 0x00008380
public static string GenerateUniqueActorName(TimelineAsset timeline, string prefix)
{
string text;
if (!timeline.tracks.Exists((TrackAsset x) => x.name == prefix))
{
text = prefix;
}
else
{
int num = 1;
string newName = prefix + num;
while (timeline.tracks.Exists((TrackAsset x) => x.name == newName))
{
num++;
newName = prefix + num;
}
text = newName;
}
return text;
}
// Token: 0x060001FE RID: 510 RVA: 0x0000A227 File Offset: 0x00008427
public static void SaveAssetIntoObject(Object childAsset, Object masterAsset)
{
if ((masterAsset.hideFlags & HideFlags.DontSave) != HideFlags.None)
{
childAsset.hideFlags |= HideFlags.DontSave;
}
else
{
childAsset.hideFlags |= HideFlags.HideInHierarchy;
}
}
// Token: 0x060001FF RID: 511 RVA: 0x0000A260 File Offset: 0x00008460
internal static bool ValidateParentTrack(TrackAsset parent, Type childType)
{
bool flag;
if (childType == null || !typeof(TrackAsset).IsAssignableFrom(childType))
{
flag = false;
}
else if (parent == null)
{
flag = true;
}
else
{
SupportsChildTracksAttribute supportsChildTracksAttribute = Attribute.GetCustomAttribute(parent.GetType(), typeof(SupportsChildTracksAttribute)) as SupportsChildTracksAttribute;
if (supportsChildTracksAttribute == null)
{
flag = false;
}
else if (supportsChildTracksAttribute.childType == null)
{
flag = true;
}
else if (childType == supportsChildTracksAttribute.childType)
{
int num = 0;
TrackAsset trackAsset = parent;
while (trackAsset != null && trackAsset.isSubTrack)
{
num++;
trackAsset = trackAsset.parent as TrackAsset;
}
flag = num < supportsChildTracksAttribute.levels;
}
else
{
flag = false;
}
}
return flag;
}
}
}
@@ -0,0 +1,248 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine.Animations;
using UnityEngine.Audio;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x0200001D RID: 29
public class TimelinePlayable : PlayableBehaviour
{
// Token: 0x060000ED RID: 237 RVA: 0x00006490 File Offset: 0x00004690
public static ScriptPlayable<TimelinePlayable> Create(PlayableGraph graph, IList<TrackAsset> tracks, GameObject go, bool autoRebalance, bool createOutputs)
{
if (tracks == null)
{
throw new ArgumentNullException("Tracks list is null", "tracks");
}
if (go == null)
{
throw new ArgumentNullException("GameObject parameter is null", "go");
}
ScriptPlayable<TimelinePlayable> scriptPlayable = ScriptPlayable<TimelinePlayable>.Create(graph, 0);
TimelinePlayable behaviour = scriptPlayable.GetBehaviour();
behaviour.Compile(graph, scriptPlayable, tracks, go, autoRebalance, createOutputs);
return scriptPlayable;
}
// Token: 0x060000EE RID: 238 RVA: 0x000064FC File Offset: 0x000046FC
public void Compile(PlayableGraph graph, Playable timelinePlayable, IList<TrackAsset> tracks, GameObject go, bool autoRebalance, bool createOutputs)
{
if (tracks == null)
{
throw new ArgumentNullException("Tracks list is null", "tracks");
}
if (go == null)
{
throw new ArgumentNullException("GameObject parameter is null", "go");
}
int num = tracks.Count * 2 + tracks.Count;
this.m_CurrentListOfActiveClips = this.m_IntervalTree.AllocateCache<RuntimeClipBase>(num);
this.m_ActiveClips = this.m_IntervalTree.AllocateCache<RuntimeClipBase>(num);
IList<TrackAsset> list = tracks.Where((TrackAsset t) => t.soloed).ToList<TrackAsset>();
if (list.Count == 0)
{
list = tracks;
}
this.m_EvaluateCallbacks.Clear();
this.m_PlayableCache.Clear();
this.CompileTrackList(graph, timelinePlayable, list, go, createOutputs);
}
// Token: 0x060000EF RID: 239 RVA: 0x000065CC File Offset: 0x000047CC
private void CompileTrackList(PlayableGraph graph, Playable timelinePlayable, IEnumerable<TrackAsset> tracks, GameObject go, bool createOutputs)
{
foreach (TrackAsset trackAsset in tracks)
{
if (trackAsset.compilable)
{
if (!this.m_IntervalTree.Contains(trackAsset))
{
trackAsset.SortClips();
this.m_IntervalTree.Add(trackAsset);
this.CreateTrackPlayable(graph, timelinePlayable, trackAsset, go, createOutputs);
}
}
}
}
// Token: 0x060000F0 RID: 240 RVA: 0x00006660 File Offset: 0x00004860
private void CreateTrackOutput(PlayableGraph graph, GameObject go, TrackAsset track, Playable playable, int port)
{
if (!track.isSubTrack)
{
IEnumerable<PlayableBinding> outputs = track.outputs;
foreach (PlayableBinding playableBinding in outputs)
{
if (playableBinding.streamType == DataStreamType.Animation)
{
AnimationPlayableOutput animationPlayableOutput = AnimationPlayableOutput.Create(graph, playableBinding.streamName, null);
animationPlayableOutput.SetReferenceObject(playableBinding.sourceObject);
animationPlayableOutput.SetSourcePlayable(playable);
animationPlayableOutput.SetSourceInputPort(port);
this.m_EvaluateCallbacks.Add(new AnimationOutputWeightProcessor(animationPlayableOutput));
}
else if (playableBinding.streamType == DataStreamType.Audio)
{
AudioPlayableOutput audioPlayableOutput = AudioPlayableOutput.Create(graph, playableBinding.streamName, null);
audioPlayableOutput.SetReferenceObject(playableBinding.sourceObject);
audioPlayableOutput.SetSourcePlayable(playable);
audioPlayableOutput.SetSourceInputPort(port);
}
else
{
if (playableBinding.streamType != DataStreamType.None)
{
throw new NotImplementedException("Unsupported stream type");
}
ScriptPlayableOutput scriptPlayableOutput = ScriptPlayableOutput.Create(graph, playableBinding.streamName);
scriptPlayableOutput.SetReferenceObject(playableBinding.sourceObject);
scriptPlayableOutput.SetSourcePlayable(playable);
scriptPlayableOutput.SetSourceInputPort(port);
}
}
}
}
// Token: 0x060000F1 RID: 241 RVA: 0x000067B8 File Offset: 0x000049B8
private static Playable CreatePlayableGraph(PlayableGraph graph, TrackAsset asset, GameObject go, IntervalTree tree)
{
return asset.CreatePlayableGraph(graph, go, tree);
}
// Token: 0x060000F2 RID: 242 RVA: 0x000067D8 File Offset: 0x000049D8
private Playable CreateTrackPlayable(PlayableGraph graph, Playable timelinePlayable, TrackAsset track, GameObject go, bool createOutputs)
{
Playable playable;
TimelinePlayable.ConnectionCache connectionCache;
if (!track.compilable)
{
playable = timelinePlayable;
}
else if (this.m_PlayableCache.TryGetValue(track, out connectionCache))
{
playable = connectionCache.playable;
}
else if (track.name == "root")
{
playable = timelinePlayable;
}
else
{
TrackAsset trackAsset = track.parent as TrackAsset;
Playable playable2 = ((!(trackAsset != null)) ? timelinePlayable : this.CreateTrackPlayable(graph, timelinePlayable, trackAsset, go, createOutputs));
Playable playable3 = TimelinePlayable.CreatePlayableGraph(graph, track, go, this.m_IntervalTree);
bool flag = false;
if (!playable3.IsValid<Playable>())
{
throw new InvalidOperationException(string.Concat(new object[]
{
track.name,
"(",
track.GetType(),
") did not produce a valid playable. Use the compilable property to indicate whether the track is valid for processing"
}));
}
if (playable2.IsValid<Playable>() && playable3.IsValid<Playable>())
{
int inputCount = playable2.GetInputCount<Playable>();
playable2.SetInputCount(inputCount + 1);
flag = graph.Connect<Playable, Playable>(playable3, 0, playable2, inputCount);
playable2.SetInputWeight(inputCount, 1f);
}
if (createOutputs && flag)
{
this.CreateTrackOutput(graph, go, track, playable2, playable2.GetInputCount<Playable>() - 1);
}
this.CacheTrack(track, playable3, (!flag) ? (-1) : (playable2.GetInputCount<Playable>() - 1), playable2);
playable = playable3;
}
return playable;
}
// Token: 0x060000F3 RID: 243 RVA: 0x00006946 File Offset: 0x00004B46
public override void PrepareFrame(Playable playable, FrameData info)
{
this.Evaluate(playable, info);
}
// Token: 0x060000F4 RID: 244 RVA: 0x00006954 File Offset: 0x00004B54
private void Evaluate(Playable playable, FrameData frameData)
{
if (this.m_IntervalTree != null)
{
double time = playable.GetTime<Playable>();
this.m_ActiveBit = ((this.m_ActiveBit != 0) ? 0 : 1);
this.m_CurrentListOfActiveClips.Clear();
this.m_IntervalTree.IntersectsWith<RuntimeClipBase>(DiscreteTime.GetNearestTick(time), this.m_ActiveBit, ref this.m_CurrentListOfActiveClips);
for (int i = 0; i < this.m_ActiveClips.Count; i++)
{
RuntimeClipBase runtimeClipBase = this.m_ActiveClips[i];
if (runtimeClipBase.intervalBit != this.m_ActiveBit)
{
runtimeClipBase.enable = false;
}
}
for (int j = 0; j < this.m_CurrentListOfActiveClips.Count; j++)
{
this.m_CurrentListOfActiveClips[j].EvaluateAt(time, frameData);
}
this.m_ActiveClips.Clear();
this.m_ActiveClips.AddRange(this.m_CurrentListOfActiveClips);
int count = this.m_EvaluateCallbacks.Count;
for (int k = 0; k < count; k++)
{
this.m_EvaluateCallbacks[k].Evaluate();
}
}
}
// Token: 0x060000F5 RID: 245 RVA: 0x00006A84 File Offset: 0x00004C84
private void CacheTrack(TrackAsset track, Playable playable, int port, Playable parent)
{
this.m_PlayableCache[track] = new TimelinePlayable.ConnectionCache
{
playable = playable,
port = port,
parent = parent,
evalWeight = 0f
};
}
// Token: 0x0400006D RID: 109
private IntervalTree m_IntervalTree = new IntervalTree();
// Token: 0x0400006E RID: 110
private List<RuntimeClipBase> m_ActiveClips = new List<RuntimeClipBase>();
// Token: 0x0400006F RID: 111
private List<RuntimeClipBase> m_CurrentListOfActiveClips;
// Token: 0x04000070 RID: 112
private int m_ActiveBit = 0;
// Token: 0x04000071 RID: 113
private List<ITimelineEvaluateCallback> m_EvaluateCallbacks = new List<ITimelineEvaluateCallback>();
// Token: 0x04000072 RID: 114
private Dictionary<TrackAsset, TimelinePlayable.ConnectionCache> m_PlayableCache = new Dictionary<TrackAsset, TimelinePlayable.ConnectionCache>();
// Token: 0x0200001E RID: 30
private struct ConnectionCache
{
// Token: 0x04000074 RID: 116
public Playable playable;
// Token: 0x04000075 RID: 117
public int port;
// Token: 0x04000076 RID: 118
public Playable parent;
// Token: 0x04000077 RID: 119
public float evalWeight;
}
}
}
@@ -0,0 +1,24 @@
using System;
using System.Diagnostics;
namespace UnityEngine.Timeline
{
// Token: 0x0200003F RID: 63
internal static class TimelineUndo
{
// Token: 0x06000200 RID: 512 RVA: 0x0000A389 File Offset: 0x00008589
public static void PushDestroyUndo(TimelineAsset timeline, Object thingToDirty, Object objectToDestroy, string operation)
{
if (objectToDestroy != null)
{
Object.Destroy(objectToDestroy);
}
}
// Token: 0x06000201 RID: 513 RVA: 0x0000A39E File Offset: 0x0000859E
[Conditional("UNITY_EDITOR")]
public static void PushUndo(Object thingToDirty, string operation)
{
}
}
}
+893
View File
@@ -0,0 +1,893 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine.Animations;
using UnityEngine.Playables;
using UnityEngine.Serialization;
namespace UnityEngine.Timeline
{
// Token: 0x0200001F RID: 31
[Serializable]
public abstract class TrackAsset : PlayableAsset, IInterval, ISerializationCallbackReceiver, IPropertyPreview
{
// Token: 0x060000F7 RID: 247 RVA: 0x00002713 File Offset: 0x00000913
protected TrackAsset()
{
this.m_MediaType = TrackAsset.GetMediaType(base.GetType());
}
// Token: 0x1700004E RID: 78
// (get) Token: 0x060000F8 RID: 248 RVA: 0x00002744 File Offset: 0x00000944
// (set) Token: 0x060000F9 RID: 249 RVA: 0x0000275E File Offset: 0x0000095E
public int intervalBit { get; set; }
// Token: 0x1700004F RID: 79
// (get) Token: 0x060000FA RID: 250 RVA: 0x00002768 File Offset: 0x00000968
public double start
{
get
{
this.UpdateDuration();
return (double)this.m_Start;
}
}
// Token: 0x17000050 RID: 80
// (get) Token: 0x060000FB RID: 251 RVA: 0x00002790 File Offset: 0x00000990
public double end
{
get
{
this.UpdateDuration();
return (double)this.m_End;
}
}
// Token: 0x17000051 RID: 81
// (get) Token: 0x060000FC RID: 252 RVA: 0x000027B8 File Offset: 0x000009B8
public long intervalStart
{
get
{
return this.m_Start.GetTick();
}
}
// Token: 0x17000052 RID: 82
// (get) Token: 0x060000FD RID: 253 RVA: 0x000027D8 File Offset: 0x000009D8
public long intervalEnd
{
get
{
return this.m_End.GetTick();
}
}
// Token: 0x17000053 RID: 83
// (get) Token: 0x060000FE RID: 254 RVA: 0x000027F8 File Offset: 0x000009F8
public sealed override double duration
{
get
{
this.UpdateDuration();
return (double)(this.m_End - this.m_Start);
}
}
// Token: 0x17000054 RID: 84
// (get) Token: 0x060000FF RID: 255 RVA: 0x0000282C File Offset: 0x00000A2C
// (set) Token: 0x06000100 RID: 256 RVA: 0x00002847 File Offset: 0x00000A47
public bool muted
{
get
{
return this.m_Muted;
}
set
{
this.m_Muted = value;
}
}
// Token: 0x17000055 RID: 85
// (get) Token: 0x06000101 RID: 257 RVA: 0x00002854 File Offset: 0x00000A54
public TimelineAsset timelineAsset
{
get
{
TrackAsset trackAsset = this;
while (trackAsset != null)
{
TimelineAsset timelineAsset;
if (trackAsset.parent == null)
{
timelineAsset = null;
}
else
{
TimelineAsset timelineAsset2 = trackAsset.parent as TimelineAsset;
if (!(timelineAsset2 != null))
{
trackAsset = trackAsset.parent as TrackAsset;
continue;
}
timelineAsset = timelineAsset2;
}
return timelineAsset;
}
return null;
}
}
// Token: 0x17000056 RID: 86
// (get) Token: 0x06000102 RID: 258 RVA: 0x000028C4 File Offset: 0x00000AC4
// (set) Token: 0x06000103 RID: 259 RVA: 0x000028DF File Offset: 0x00000ADF
public PlayableAsset parent
{
get
{
return this.m_Parent;
}
internal set
{
this.m_Parent = value;
}
}
// Token: 0x06000104 RID: 260 RVA: 0x000028EC File Offset: 0x00000AEC
public IEnumerable<TimelineClip> GetClips()
{
return this.clips;
}
// Token: 0x17000057 RID: 87
// (get) Token: 0x06000105 RID: 261 RVA: 0x00002908 File Offset: 0x00000B08
internal TimelineClip[] clips
{
get
{
if (this.m_Clips == null)
{
this.m_Clips = new List<TimelineClip>();
}
if (this.m_ClipsCache == null)
{
this.m_ClipsCache = this.m_Clips.ToArray();
}
return this.m_ClipsCache;
}
}
// Token: 0x17000058 RID: 88
// (get) Token: 0x06000106 RID: 262 RVA: 0x00002958 File Offset: 0x00000B58
public bool isEmpty
{
get
{
return this.m_Clips == null || this.m_Clips.Count == 0;
}
}
// Token: 0x17000059 RID: 89
// (get) Token: 0x06000107 RID: 263 RVA: 0x0000298C File Offset: 0x00000B8C
public bool isSubTrack
{
get
{
TrackAsset trackAsset = this.parent as TrackAsset;
return trackAsset != null && trackAsset.GetType() == base.GetType();
}
}
// Token: 0x1700005A RID: 90
// (get) Token: 0x06000108 RID: 264 RVA: 0x000029CC File Offset: 0x00000BCC
public override IEnumerable<PlayableBinding> outputs
{
get
{
TrackBindingTypeAttribute attribute = Attribute.GetCustomAttribute(base.GetType(), typeof(TrackBindingTypeAttribute)) as TrackBindingTypeAttribute;
Type trackBindingType = ((attribute == null) ? null : attribute.type);
yield return new PlayableBinding
{
sourceObject = this,
streamName = base.name,
streamType = DataStreamType.None,
sourceBindingType = trackBindingType
};
yield break;
}
}
// Token: 0x06000109 RID: 265 RVA: 0x000029F8 File Offset: 0x00000BF8
public IEnumerable<TrackAsset> GetChildTracks()
{
return this.m_Children.ToArray();
}
// Token: 0x1700005B RID: 91
// (get) Token: 0x0600010A RID: 266 RVA: 0x00002A18 File Offset: 0x00000C18
// (set) Token: 0x0600010B RID: 267 RVA: 0x00002A33 File Offset: 0x00000C33
internal string customPlayableTypename
{
get
{
return this.m_CustomPlayableFullTypename;
}
set
{
this.m_CustomPlayableFullTypename = value;
}
}
// Token: 0x1700005C RID: 92
// (get) Token: 0x0600010C RID: 268 RVA: 0x00002A40 File Offset: 0x00000C40
// (set) Token: 0x0600010D RID: 269 RVA: 0x00002A5B File Offset: 0x00000C5B
internal AnimationClip animClip
{
get
{
return this.m_AnimClip;
}
set
{
this.m_AnimClip = value;
}
}
// Token: 0x1700005D RID: 93
// (get) Token: 0x0600010E RID: 270 RVA: 0x00002A68 File Offset: 0x00000C68
// (set) Token: 0x0600010F RID: 271 RVA: 0x00002A82 File Offset: 0x00000C82
internal bool displayCascadeClips { get; set; }
// Token: 0x1700005E RID: 94
// (get) Token: 0x06000110 RID: 272 RVA: 0x00002A8C File Offset: 0x00000C8C
// (set) Token: 0x06000111 RID: 273 RVA: 0x00002AA7 File Offset: 0x00000CA7
internal bool soloed
{
get
{
return this.m_Soloed;
}
set
{
this.m_Soloed = value;
}
}
// Token: 0x1700005F RID: 95
// (get) Token: 0x06000112 RID: 274 RVA: 0x00002AB4 File Offset: 0x00000CB4
// (set) Token: 0x06000113 RID: 275 RVA: 0x00002ACF File Offset: 0x00000CCF
internal float height
{
get
{
return this.m_Height;
}
set
{
this.m_Height = value;
}
}
// Token: 0x17000060 RID: 96
// (get) Token: 0x06000114 RID: 276 RVA: 0x00002ADC File Offset: 0x00000CDC
// (set) Token: 0x06000115 RID: 277 RVA: 0x00002AF7 File Offset: 0x00000CF7
internal List<TrackAsset> subTracks
{
get
{
return this.m_Children;
}
set
{
this.m_Children = value;
}
}
// Token: 0x17000061 RID: 97
// (get) Token: 0x06000116 RID: 278 RVA: 0x00002B04 File Offset: 0x00000D04
// (set) Token: 0x06000117 RID: 279 RVA: 0x00002B1F File Offset: 0x00000D1F
internal bool locked
{
get
{
return this.m_Locked;
}
set
{
this.m_Locked = value;
}
}
// Token: 0x17000062 RID: 98
// (get) Token: 0x06000118 RID: 280 RVA: 0x00002B2C File Offset: 0x00000D2C
internal TimelineAsset.MediaType mediaType
{
get
{
return this.m_MediaType;
}
}
// Token: 0x17000063 RID: 99
// (get) Token: 0x06000119 RID: 281 RVA: 0x00002B48 File Offset: 0x00000D48
internal virtual bool compilable
{
get
{
return !this.muted && !this.isEmpty;
}
}
// Token: 0x0600011A RID: 282 RVA: 0x00002B74 File Offset: 0x00000D74
public void OnBeforeSerialize()
{
}
// Token: 0x0600011B RID: 283 RVA: 0x00002B77 File Offset: 0x00000D77
public void OnAfterDeserialize()
{
this.m_ClipsCache = null;
this.InvalidateTimelineCaches();
}
// Token: 0x0600011C RID: 284 RVA: 0x00002B88 File Offset: 0x00000D88
public virtual void OnEnable()
{
if (this.m_Children == null)
{
this.m_Children = new List<TrackAsset>();
}
if (this.m_Clips == null)
{
this.m_Clips = new List<TimelineClip>();
}
if (this.m_Children.Count > 0)
{
List<TrackAsset> list = this.m_Children.Where((TrackAsset t) => t != null).ToList<TrackAsset>();
this.m_Children = list;
}
this.displayCascadeClips = false;
}
// Token: 0x0600011D RID: 285 RVA: 0x00002C14 File Offset: 0x00000E14
public virtual Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
{
return Playable.Create(graph, inputCount);
}
// Token: 0x0600011E RID: 286 RVA: 0x00002C30 File Offset: 0x00000E30
public sealed override Playable CreatePlayable(PlayableGraph graph, GameObject go)
{
return Playable.Null;
}
// Token: 0x0600011F RID: 287 RVA: 0x00002C4C File Offset: 0x00000E4C
public TimelineClip CreateDefaultClip()
{
TrackClipTypeAttribute trackClipTypeAttribute = base.GetType().GetCustomAttributes(typeof(TrackClipTypeAttribute), true).OfType<TrackClipTypeAttribute>()
.FirstOrDefault((TrackClipTypeAttribute t) => typeof(IPlayableAsset).IsAssignableFrom(t.inspectedType) && typeof(ScriptableObject).IsAssignableFrom(t.inspectedType));
TimelineClip timelineClip;
if (trackClipTypeAttribute == null)
{
Debug.LogWarning("Cannot create a default clip for type " + base.GetType());
timelineClip = null;
}
else
{
timelineClip = this.CreateClipOfType(trackClipTypeAttribute.inspectedType);
}
return timelineClip;
}
// Token: 0x06000120 RID: 288 RVA: 0x00002CD0 File Offset: 0x00000ED0
internal TimelineClip CreateClipOfType(Type type)
{
if (type == null || !typeof(IPlayableAsset).IsAssignableFrom(type) || !typeof(ScriptableObject).IsAssignableFrom(type))
{
throw new InvalidOperationException("Cannot create an clip for type " + type.Name);
}
ScriptableObject scriptableObject = ScriptableObject.CreateInstance(type);
if (scriptableObject == null)
{
throw new InvalidOperationException("Could not create an instance of the ScriptableObject type " + type.Name);
}
scriptableObject.name = type.Name;
TimelineCreateUtilities.SaveAssetIntoObject(scriptableObject, this);
TimelineClip timelineClip = this.CreateNewClipContainerInternal();
timelineClip.displayName = scriptableObject.name;
timelineClip.asset = scriptableObject;
try
{
this.OnCreateClipFromAsset(scriptableObject, timelineClip);
}
catch (Exception ex)
{
Debug.LogError(ex.Message, scriptableObject);
return null;
}
this.AddClip(timelineClip);
return timelineClip;
}
// Token: 0x06000121 RID: 289 RVA: 0x00002DC0 File Offset: 0x00000FC0
internal void AddClip(TimelineClip newClip)
{
if (!this.m_Clips.Contains(newClip))
{
this.m_Clips.Add(newClip);
this.m_ClipsCache = null;
}
}
// Token: 0x06000122 RID: 290 RVA: 0x00002DEC File Offset: 0x00000FEC
internal Playable CreatePlayableGraph(PlayableGraph graph, GameObject go, IntervalTree tree)
{
this.UpdateDuration();
return this.OnCreatePlayableGraph(graph, go, tree);
}
// Token: 0x06000123 RID: 291 RVA: 0x00002E10 File Offset: 0x00001010
internal virtual Playable OnCreatePlayableGraph(PlayableGraph graph, GameObject go, IntervalTree tree)
{
if (tree == null)
{
throw new ArgumentException("IntervalTree argument cannot be null", "tree");
}
if (go == null)
{
throw new ArgumentException("GameObject argument cannot be null", "go");
}
Playable playable = this.CreateTrackMixer(graph, go, this.clips.Length);
for (int i = 0; i < this.clips.Length; i++)
{
Playable playable2 = this.CreatePlayable(graph, go, this.clips[i]);
if (playable2.IsValid<Playable>())
{
playable2.SetDuration(this.clips[i].duration);
RuntimeClip runtimeClip = new RuntimeClip(this.clips[i], playable2, playable);
tree.Add(runtimeClip);
graph.Connect<Playable, Playable>(playable2, 0, playable, i);
playable.SetInputWeight(i, 0f);
}
}
return playable;
}
// Token: 0x06000124 RID: 292 RVA: 0x00002EE8 File Offset: 0x000010E8
internal bool IsCompatibleWithClip(TimelineClip clip)
{
return this.ValidateClipType(clip.underlyingAsset.GetType());
}
// Token: 0x06000125 RID: 293 RVA: 0x00002F0E File Offset: 0x0000110E
internal void SortClips()
{
this.m_Clips.Sort((TimelineClip clip1, TimelineClip clip2) => clip1.start.CompareTo(clip2.start));
this.m_ClipsCache = null;
}
// Token: 0x06000126 RID: 294 RVA: 0x00002F40 File Offset: 0x00001140
internal void SetClips(List<TimelineClip> clips)
{
this.m_Clips = clips;
this.m_ClipsCache = clips.ToArray();
}
// Token: 0x06000127 RID: 295 RVA: 0x00002F58 File Offset: 0x00001158
internal TimelineClip CreateClipFromAsset(Object asset)
{
TimelineClip timelineClip;
if (asset == null)
{
timelineClip = null;
}
else
{
TimelineAsset timelineAsset = asset as TimelineAsset;
if (timelineAsset == null && !this.ValidateClipType(asset.GetType()))
{
throw new InvalidOperationException(string.Format("Cannot create a clip for track {0} with clip type: {1}. Did you forget a ClipClass attribute?", base.GetType(), asset.GetType()));
}
TimelineClip timelineClip2 = this.CreateNewClipContainerInternal();
timelineClip2.underlyingAsset = asset;
timelineClip2.displayName = asset.name;
timelineClip2.asset = asset;
try
{
this.OnCreateClipFromAsset(asset, timelineClip2);
}
catch (Exception ex)
{
Debug.LogError(ex.Message, asset);
this.RemoveClip(timelineClip2);
return null;
}
timelineClip = timelineClip2;
}
return timelineClip;
}
// Token: 0x06000128 RID: 296 RVA: 0x00003020 File Offset: 0x00001220
internal virtual void OnCreateClipFromAsset(Object asset, TimelineClip clip)
{
clip.asset = asset;
clip.underlyingAsset = asset;
clip.displayName = asset.name;
IPlayableAsset playableAsset = asset as IPlayableAsset;
if (playableAsset != null)
{
double duration = playableAsset.duration;
if (duration > 0.0 && !double.IsInfinity(duration))
{
clip.duration = duration;
}
}
}
// Token: 0x06000129 RID: 297 RVA: 0x00003080 File Offset: 0x00001280
internal TimelineClip CreateNewClipContainerInternal()
{
TimelineClip timelineClip = new TimelineClip(this);
timelineClip.asset = null;
double num = 0.0;
for (int i = 0; i < this.m_Clips.Count - 1; i++)
{
double num2 = this.m_Clips[i].duration;
if (double.IsInfinity(num2))
{
num2 = (double)TimelineClip.kDefaultClipDurationInSeconds;
}
num = Math.Max(num, this.m_Clips[i].start + num2);
}
timelineClip.mixInCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
timelineClip.mixOutCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
timelineClip.start = num;
timelineClip.duration = (double)TimelineClip.kDefaultClipDurationInSeconds;
timelineClip.displayName = "untitled";
return timelineClip;
}
// Token: 0x0600012A RID: 298 RVA: 0x0000316A File Offset: 0x0000136A
internal void AddChild(TrackAsset child)
{
if (!(child == null))
{
this.m_Children.Add(child);
child.parent = this;
this.InvalidateTimelineCaches();
}
}
// Token: 0x0600012B RID: 299 RVA: 0x00003198 File Offset: 0x00001398
internal bool AddChildAfter(TrackAsset child, TrackAsset other)
{
bool flag;
if (child == null)
{
flag = false;
}
else
{
int num = this.m_Children.IndexOf(other);
if (num >= 0 && num != this.m_Children.Count - 1)
{
this.m_Children.Insert(num + 1, child);
}
else
{
this.m_Children.Add(child);
}
this.InvalidateTimelineCaches();
child.parent = this;
flag = true;
}
return flag;
}
// Token: 0x0600012C RID: 300 RVA: 0x00003218 File Offset: 0x00001418
internal bool RemoveSubTrack(TrackAsset child)
{
bool flag;
if (this.m_Children.Remove(child))
{
this.InvalidateTimelineCaches();
child.parent = null;
flag = true;
}
else
{
flag = false;
}
return flag;
}
// Token: 0x0600012D RID: 301 RVA: 0x00003254 File Offset: 0x00001454
internal void RemoveClip(TimelineClip clip)
{
this.m_Clips.Remove(clip);
this.m_ClipsCache = null;
}
// Token: 0x0600012E RID: 302 RVA: 0x0000326C File Offset: 0x0000146C
internal virtual void GetEvaluationTime(out double outStart, out double outDuration)
{
if (this.clips.Length == 0)
{
outStart = 0.0;
outDuration = 0.0;
}
else
{
outStart = double.MaxValue;
double num = 0.0;
for (int i = 0; i < this.clips.Length; i++)
{
outStart = Math.Min(this.clips[i].start, outStart);
num = Math.Max(this.clips[i].start + this.clips[i].duration, num);
}
outStart = Math.Max(outStart, 0.0);
outDuration = num - outStart;
}
}
// Token: 0x0600012F RID: 303 RVA: 0x00003323 File Offset: 0x00001523
internal virtual void GetSequenceTime(out double outStart, out double outDuration)
{
this.GetEvaluationTime(out outStart, out outDuration);
}
// Token: 0x06000130 RID: 304 RVA: 0x00003330 File Offset: 0x00001530
public virtual void GatherProperties(PlayableDirector director, IPropertyCollector driver)
{
GameObject gameObjectBinding = this.GetGameObjectBinding(director);
if (gameObjectBinding != null)
{
driver.PushActiveGameObject(gameObjectBinding);
}
if (this.animClip != null)
{
driver.AddFromClip(this.animClip);
}
foreach (TimelineClip timelineClip in this.clips)
{
if (timelineClip.curves != null && timelineClip.asset != null)
{
driver.AddObjectProperties(timelineClip.asset, timelineClip.curves);
}
IPropertyPreview propertyPreview = timelineClip.asset as IPropertyPreview;
if (propertyPreview != null)
{
propertyPreview.GatherProperties(director, driver);
}
}
foreach (TrackAsset trackAsset in this.subTracks)
{
if (trackAsset != null)
{
trackAsset.GatherProperties(director, driver);
}
}
if (gameObjectBinding != null)
{
driver.PopActiveGameObject();
}
}
// Token: 0x06000131 RID: 305 RVA: 0x00003460 File Offset: 0x00001660
internal GameObject GetGameObjectBinding(PlayableDirector director)
{
GameObject gameObject;
if (director == null)
{
gameObject = null;
}
else
{
GameObject gameObject2 = director.GetGenericBinding(this) as GameObject;
if (gameObject2 != null)
{
gameObject = gameObject2;
}
else
{
Component component = director.GetGenericBinding(this) as Component;
if (component != null)
{
gameObject = component.gameObject;
}
else
{
gameObject = null;
}
}
}
return gameObject;
}
// Token: 0x06000132 RID: 306 RVA: 0x000034D0 File Offset: 0x000016D0
private bool ValidateClipType(Type clipType)
{
foreach (object obj in base.GetType().GetCustomAttributes(typeof(TrackClipTypeAttribute), true))
{
TrackClipTypeAttribute trackClipTypeAttribute = obj as TrackClipTypeAttribute;
if (trackClipTypeAttribute.inspectedType.IsAssignableFrom(clipType))
{
return true;
}
}
return false;
}
// Token: 0x06000133 RID: 307 RVA: 0x0000353C File Offset: 0x0000173C
private TimelineClip NestPlayableAsset(PlayableAsset asset)
{
DataStreamType dataStreamType = DataStreamType.None;
switch (this.mediaType)
{
case TimelineAsset.MediaType.Animation:
dataStreamType = DataStreamType.Animation;
break;
case TimelineAsset.MediaType.Audio:
dataStreamType = DataStreamType.Audio;
break;
case TimelineAsset.MediaType.Video:
dataStreamType = DataStreamType.Video;
break;
case TimelineAsset.MediaType.Script:
dataStreamType = DataStreamType.None;
break;
}
int num = -1;
int num2 = 0;
foreach (PlayableBinding playableBinding in asset.outputs)
{
if (playableBinding.streamType == dataStreamType)
{
num = num2;
break;
}
num2++;
}
if (num < 0)
{
throw new InvalidOperationException("Cannot nest asset because it does not contain any compatible tracks");
}
TimelineClip timelineClip = this.CreateNewClipContainerInternal();
timelineClip.asset = asset;
timelineClip.displayName = asset.name;
timelineClip.duration = asset.duration;
return timelineClip;
}
// Token: 0x06000134 RID: 308 RVA: 0x0000363C File Offset: 0x0000183C
private void UpdateDuration()
{
if (this.clips.Length == 0)
{
this.m_ClipsHash = 0;
this.m_Start = 0;
this.m_End = (DiscreteTime)((!(this.m_AnimClip != null)) ? 0f : this.m_AnimClip.length);
}
else
{
int num = HashUtility.CombineHash(this.clips.Select((TimelineClip c) => c.Hash()).ToArray<int>());
if (num != this.m_ClipsHash)
{
this.m_ClipsHash = num;
double num2;
double num3;
this.GetSequenceTime(out num2, out num3);
this.m_Start = (DiscreteTime)num2;
this.m_End = (DiscreteTime)(num2 + num3);
this.CalculateExtrapolationTimes();
}
}
}
// Token: 0x06000135 RID: 309 RVA: 0x00003718 File Offset: 0x00001918
protected internal virtual Playable CreatePlayable(PlayableGraph graph, GameObject go, TimelineClip clip)
{
IPlayableAsset playableAsset = clip.asset as IPlayableAsset;
Playable playable2;
if (playableAsset != null)
{
Playable playable = playableAsset.CreatePlayable(graph, go);
if (playable.IsValid<Playable>())
{
playable.SetAnimatedProperties(clip.curves);
playable.SetSpeed(clip.timeScale);
}
playable2 = playable;
}
else
{
playable2 = Playable.Null;
}
return playable2;
}
// Token: 0x06000136 RID: 310 RVA: 0x0000377C File Offset: 0x0000197C
private void InvalidateTimelineCaches()
{
TimelineAsset timelineAsset = this.timelineAsset;
if (timelineAsset != null)
{
timelineAsset.Invalidate();
}
}
// Token: 0x06000137 RID: 311 RVA: 0x000037A8 File Offset: 0x000019A8
private static TimelineAsset.MediaType GetMediaType(Type t)
{
object[] customAttributes = t.GetCustomAttributes(typeof(TrackMediaType), true);
TimelineAsset.MediaType mediaType;
if (customAttributes.Length > 0 && customAttributes[0] is TrackMediaType)
{
mediaType = ((TrackMediaType)customAttributes[0]).m_MediaType;
}
else
{
mediaType = TimelineAsset.MediaType.Script;
}
return mediaType;
}
// Token: 0x04000078 RID: 120
[SerializeField]
private bool m_Locked;
// Token: 0x04000079 RID: 121
[SerializeField]
private bool m_Muted;
// Token: 0x0400007A RID: 122
[SerializeField]
private bool m_Soloed;
// Token: 0x0400007B RID: 123
[SerializeField]
private float m_Height;
// Token: 0x0400007C RID: 124
[SerializeField]
private string m_CustomPlayableFullTypename = string.Empty;
// Token: 0x0400007D RID: 125
[NonSerialized]
private DiscreteTime m_Start;
// Token: 0x0400007E RID: 126
[NonSerialized]
private DiscreteTime m_End;
// Token: 0x0400007F RID: 127
[SerializeField]
[FormerlySerializedAs("m_animClip")]
private AnimationClip m_AnimClip;
// Token: 0x04000080 RID: 128
[NonSerialized]
private TimelineClip[] m_ClipsCache;
// Token: 0x04000081 RID: 129
[NonSerialized]
private int m_ClipsHash;
// Token: 0x04000082 RID: 130
[SerializeField]
private PlayableAsset m_Parent;
// Token: 0x04000083 RID: 131
[SerializeField]
private List<TrackAsset> m_Children;
// Token: 0x04000084 RID: 132
private TimelineAsset.MediaType m_MediaType;
// Token: 0x04000085 RID: 133
[SerializeField]
protected internal List<TimelineClip> m_Clips = new List<TimelineClip>();
}
}
@@ -0,0 +1,58 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x0200002F RID: 47
public static class TrackAssetExtensions
{
// Token: 0x060001B2 RID: 434 RVA: 0x000091DC File Offset: 0x000073DC
public static GroupTrack GetGroup(this TrackAsset asset)
{
GroupTrack groupTrack;
if (asset == null)
{
groupTrack = null;
}
else
{
groupTrack = asset.parent as GroupTrack;
}
return groupTrack;
}
// Token: 0x060001B3 RID: 435 RVA: 0x00009210 File Offset: 0x00007410
public static void SetGroup(this TrackAsset asset, GroupTrack group)
{
if (!(asset == null) && !(asset == group) && !(asset.parent == group))
{
if (group != null && asset.timelineAsset != group.timelineAsset)
{
throw new InvalidOperationException("Cannot assign to a group in a different timeline");
}
TimelineAsset timelineAsset = asset.timelineAsset;
TrackAsset trackAsset = asset.parent as TrackAsset;
TimelineAsset timelineAsset2 = asset.parent as TimelineAsset;
if (trackAsset != null || timelineAsset2 != null)
{
if (timelineAsset2 != null)
{
timelineAsset2.RemoveTrack(asset);
}
else
{
trackAsset.RemoveSubTrack(asset);
}
}
if (group == null)
{
asset.parent = asset.timelineAsset;
timelineAsset.AddTrackInternal(asset);
}
else
{
group.AddChild(asset);
}
}
}
}
}
@@ -0,0 +1,18 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x02000014 RID: 20
[AttributeUsage(AttributeTargets.Class)]
public class TrackBindingTypeAttribute : Attribute
{
// Token: 0x0600008E RID: 142 RVA: 0x00005355 File Offset: 0x00003555
public TrackBindingTypeAttribute(Type type)
{
this.type = type;
}
// Token: 0x0400003E RID: 62
public readonly Type type;
}
}
@@ -0,0 +1,18 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x02000011 RID: 17
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public class TrackClipTypeAttribute : Attribute
{
// Token: 0x0600008B RID: 139 RVA: 0x0000532D File Offset: 0x0000352D
public TrackClipTypeAttribute(Type clipClass)
{
this.inspectedType = clipClass;
}
// Token: 0x0400003C RID: 60
public readonly Type inspectedType;
}
}
@@ -0,0 +1,28 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x0200002A RID: 42
[AttributeUsage(AttributeTargets.Class)]
public class TrackColorAttribute : Attribute
{
// Token: 0x06000190 RID: 400 RVA: 0x00007EA6 File Offset: 0x000060A6
public TrackColorAttribute(float r, float g, float b)
{
this.m_Color = new Color(r, g, b);
}
// Token: 0x17000080 RID: 128
// (get) Token: 0x06000191 RID: 401 RVA: 0x00007EC0 File Offset: 0x000060C0
public Color color
{
get
{
return this.m_Color;
}
}
// Token: 0x040000BB RID: 187
private Color m_Color;
}
}
@@ -0,0 +1,18 @@
using System;
namespace UnityEngine.Timeline
{
// Token: 0x02000012 RID: 18
[AttributeUsage(AttributeTargets.Class)]
public class TrackMediaType : Attribute
{
// Token: 0x0600008C RID: 140 RVA: 0x0000533D File Offset: 0x0000353D
public TrackMediaType(TimelineAsset.MediaType mt)
{
this.m_MediaType = mt;
}
// Token: 0x0400003D RID: 61
public readonly TimelineAsset.MediaType m_MediaType;
}
}
@@ -0,0 +1,37 @@
using System;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
// Token: 0x02000041 RID: 65
internal static class WeightUtility
{
// Token: 0x0600020F RID: 527 RVA: 0x0000A914 File Offset: 0x00008B14
public static float NormalizeMixer(Playable mixer)
{
float num;
if (!mixer.IsValid<Playable>())
{
num = 0f;
}
else
{
int inputCount = mixer.GetInputCount<Playable>();
float num2 = 0f;
for (int i = 0; i < inputCount; i++)
{
num2 += mixer.GetInputWeight(i);
}
if (num2 > Mathf.Epsilon && num2 < 1f)
{
for (int j = 0; j < inputCount; j++)
{
mixer.SetInputWeight(j, mixer.GetInputWeight(j) / num2);
}
}
num = Mathf.Clamp01(num2);
}
return num;
}
}
}