-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTimelineConditional.cs
43 lines (35 loc) · 1.04 KB
/
TimelineConditional.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
using UnityEngine;
namespace neo.timelineExtensions
{
public interface ITimelineConditional
{
bool timelineConditionMet { get; }
bool IsConditionMet(TimeMachineCondition condition);
}
public enum TimeMachineCondition
{
Always,
Never,
ConditionalNotMet,
ConditionalMet
}
public class TimelineConditional : MonoBehaviour, ITimelineConditional
{
public bool timelineConditionMet { get; protected set; } = false;
public bool IsConditionMet(TimeMachineCondition condition)
{
switch (condition)
{
case TimeMachineCondition.Always:
return true;
case TimeMachineCondition.ConditionalNotMet:
return !timelineConditionMet;
case TimeMachineCondition.ConditionalMet:
return timelineConditionMet;
case TimeMachineCondition.Never:
default:
return false;
}
}
}
}