3 static const string PORT_STATE =
"UnitState";
5 [
Attribute(
"0", UIWidgets.ComboBox,
"State of unit",
"", ParamEnumArray.FromEnum(EUnitState) )]
6 protected EUnitState m_stateToChange;
8 [
Attribute(
"1", UIWidgets.CheckBox,
"Add true, remove false")]
9 protected bool m_stateAdd;
11 protected override bool VisibleInPalette()
16 override ENodeResult EOnTaskSimulate(AIAgent owner,
float dt)
19 if(GetVariableIn(PORT_STATE,unitState))
21 m_stateToChange = Math.AbsInt(unitState);
22 m_stateAdd = unitState > 0;
29 SCR_AIInfoComponent infoComp = chimeraAgent.m_InfoComponent;
34 infoComp.AddUnitState(m_stateToChange);
36 infoComp.RemoveUnitState(m_stateToChange);
37 return ENodeResult.SUCCESS;
40 override string GetNodeMiddleText()
42 string result =
"Removing";
45 return result +
" " +
typename.EnumToString(EUnitState,m_stateToChange);
48 protected static ref TStringArray s_aVarsIn = {
51 override TStringArray GetVariablesIn()
56 override string GetOnHoverDescription()
58 return "Changes Unit State either adding flag or removing depending of sign of variable in in-port";