-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLoseAction.cs
78 lines (72 loc) · 2.89 KB
/
LoseAction.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using LEGOMaterials;
using Unity.LEGO.Game;
using Unity.LEGO.Behaviours.Triggers;
namespace Unity.LEGO.Behaviours.Actions
{
public class LoseAction : ObjectiveAction
{
public override ObjectiveConfiguration GetDefaultObjectiveConfiguration(Trigger trigger)
{
ObjectiveConfiguration result = new ObjectiveConfiguration();
if (trigger)
{
var triggerType = trigger.GetType();
if (triggerType == typeof(PickupTrigger))
{
result.Title = "Don't Pickup the Pickups!";
result.Description = "Don't do it!";
result.ProgressType = ObjectiveProgressType.Amount;
}
else if (triggerType == typeof(TouchTrigger))
{
result.Title = "Don't Touch the Object";
result.Description = "You can't touch this!";
}
else if (triggerType == typeof(NearbyTrigger))
{
result.Title = "Avoid the Object";
result.Description = "Avoid it!";
}
else if (triggerType == typeof(TimerTrigger))
{
result.Title = "Finish Before the Time is Up";
result.Description = "Hurry up!";
result.ProgressType = ObjectiveProgressType.Time;
}
else if (triggerType == typeof(RandomTrigger))
{
result.Title = "Finish Before a Random Time is Up";
result.Description = "Hurry up!";
}
else if (triggerType == typeof(InputTrigger))
{
result.Title = "Don't Press the Button";
result.Description = "Don't push it";
}
else if (triggerType == typeof(CounterTrigger))
{
result.Title = "Don't Complete the Objective";
result.Description = "Don't do it!";
}
else
{
result.Title = "Don't Complete the Objective";
result.Description = "Don't do it!";
}
}
else
{
result.Title = "Didn't Stand a Chance!";
result.Description = "Connect a Trigger Brick to the Lose Brick to make your game easier.";
}
result.Lose = true;
return result;
}
protected override void Reset()
{
base.Reset();
m_FlashColour = MouldingColour.GetColour(MouldingColour.Id.BrightRed) * 2.0f;
m_IconPath = "Assets/LEGO/Gizmos/LEGO Behaviour Icons/Lose Action.png";
}
}
}