4 [
Attribute(
"0", UIWidgets.CheckBox,
"Fail node after simulate?")]
5 protected bool m_bFailAfter;
7 [
Attribute(
"0", UIWidgets.CheckBox,
"Running until OnAbort")]
8 protected bool m_bWaitOnAbort;
10 [
Attribute(
"0", UIWidgets.CheckBox,
"Increment OnAbort")]
11 protected bool m_bIncrementOnAbort;
13 [
Attribute(
"", UIWidgets.Auto,
"Echo when increased")]
14 protected string m_sDebugMessage;
16 static const string PORT_VAR_IN =
"Counter";
17 static const string PORT_VAR_OUT=
"Out";
20 protected static ref TStringArray s_aVarsIn = {
23 override TStringArray GetVariablesIn()
29 protected static ref TStringArray s_aVarsOut = {
32 override array<string> GetVariablesOut()
38 override void OnAbort(AIAgent owner, Node nodeCausingAbort)
40 if (m_bIncrementOnAbort)
43 GetVariableIn(PORT_VAR_IN, count);
45 if (m_sDebugMessage !=
string.Empty)
46 Print(
"DebugCounter: " + m_sDebugMessage);
47 SetVariableOut(PORT_VAR_OUT, count);
52 override ENodeResult EOnTaskSimulate(AIAgent owner,
float dt)
55 return ENodeResult.RUNNING;
58 GetVariableIn(PORT_VAR_IN, count);
60 if (m_sDebugMessage !=
string.Empty)
61 Print(
"DebugCounter: " + m_sDebugMessage);
62 SetVariableOut(PORT_VAR_OUT, count);
65 return ENodeResult.FAIL;
67 return ENodeResult.SUCCESS;
71 override bool VisibleInPalette()
77 override protected bool CanReturnRunning()
83 protected override string GetOnHoverDescription()
85 return "Increments variable for debug with configurable node behavior.";
89 override string GetNodeMiddleText()
92 if (m_bIncrementOnAbort)
93 text =
"Increment OnAbort\n";
95 return text +
"RUNNING";
97 return text +
"FAILS";
99 return text +
"SUCESS";