-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTimelineEvent.cs
63 lines (51 loc) · 1.29 KB
/
TimelineEvent.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using UnityEngine;
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
public abstract class TimelineEvent
{
public Timeline Timeline { get; internal set; }
public int EventIndex { get; internal set; }
public float EventTimecode { get; internal set; }
internal protected TimelineEvent()
{
}
public override string ToString()
{
return string.Format("[{0}] #{1}: {2} @ {3}",
this.Timeline.Script.name,
this.EventIndex,
this is TimelineWaitMarker ? "Wait" :
this is TimelineAction ? "Do" :
this is TimelineLoopMarker ? ((TimelineLoopMarker)this).MarkerType == TimelineLoopMarkerType.Begin ? "LoopBegin" : "LoopEnd" :
"Sequence",
this.EventTimecode);
}
}
public sealed class TimelineWaitMarker: TimelineEvent
{
}
public sealed class TimelineLoopMarker: TimelineEvent
{
public TimelineLoopMarkerType MarkerType { get; internal set; }
public int LoopCount { get; internal set; }
}
public enum TimelineLoopMarkerType
{
Begin,
End
}
public sealed class TimelineAction : TimelineEvent
{
public Action<TimelineAction> Action { get; internal set; }
internal void Invoke()
{
this.Action(this);
}
}
public abstract class TimelineSpan: TimelineEvent
{
public abstract float Duration { get; }
internal abstract void Update(float timecode);
}