-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathDebugEffect.cs
44 lines (37 loc) · 1.05 KB
/
DebugEffect.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
using System;
namespace SmokeScreen
{
[EffectDefinition("DEBUG_EFFECT")]
class DebugEffect : EffectBehaviour
{
public override void OnEvent()
{
Print(effectName.PadRight(16) + "OnEvent single -------------------------------------------------------");
}
private float lastPower = -1;
public override void OnEvent(float power)
{
if (Math.Abs(lastPower - power) > 0.01f)
{
lastPower = power;
Print(effectName.PadRight(16) + " " + instanceName + "OnEvent pow = " + power.ToString("F2"));
}
}
public override void OnInitialize()
{
Print("OnInitialize");
}
public override void OnLoad(ConfigNode node)
{
Print("OnLoad");
}
public override void OnSave(ConfigNode node)
{
Print("OnSave");
}
private static void Print(String s)
{
print("[SmokeScreen DebugEffect] " + s);
}
}
}