-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.cs
71 lines (61 loc) · 2.37 KB
/
utils.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
using UnityEngine;
namespace DisplayMachineryDetail
{
public class Utils
{
// machinery checks for update
// Double trigger checks
public static string IsDoubleGate(GateBehaviour gate)
{
if (gate.GetComponent<GateBehaviour>().DoubleTrigger) { return "Double"; }
else { return "Single"; }
}
public static string IsDoubleKey(KeyTriggerBehaviour keyTrigger)
{
if (keyTrigger.GetComponent<KeyTriggerBehaviour>().DoubleTrigger) { return "Double"; }
else { return "Single"; }
}
public static string IsDoubleButton(ButtonBehaviour button)
{
if (button.GetComponent<ButtonBehaviour>().TriggerOnExit) { return "Double"; }
else { return "Single"; }
}
public static string IsDoubleDetector(DetectorBehaviour detector)
{
if (detector.GetComponent<DetectorBehaviour>().TriggerOnExit) { return "Double"; }
else { return "Single"; }
}
public static string IsForward(BoatMotorBehaviour boatMotor)
{
if (boatMotor.GetComponent<BoatMotorBehaviour>().Force < 0) { return "Reverse"; }
else { return ""; }
}
public static string IsReversed(MagnetBehaviour magnet)
{
if (magnet.GetComponent<MagnetBehaviour>().Reversed) { return "Repell"; }
else { return "Attract"; }
}
// wheel
public static string IsBrakeEngaged(CarBehaviour wheel)
{
if (wheel.GetComponent<CarBehaviour>().IsBrakeEngaged) { return ""; }
else { return "No brake"; }
}
public static string IsReversedWheel(CarBehaviour wheel)
{
if (wheel.GetComponent<CarBehaviour>().MotorSpeed > 0) { return "Reverse"; }
else { return ""; }
}
// Damageable checks
public static string IsIndestructible(DamagableMachineryBehaviour damageable)
{
if (damageable.GetComponent<DamagableMachineryBehaviour>().Indestructible) { return "∞"; }
else { return ""; }
}
public static string IsDestroyed(DamagableMachineryBehaviour damageable)
{
if (damageable.GetComponent<DamagableMachineryBehaviour>().Destroyed) { return "Broken"; }
else { return ""; }
}
}
}