4 static const string BASE_TARGET_PORT =
"BaseTargetIn";
6 [
Attribute(
"0.5", UIWidgets.EditBox,
"Threshold time since target was detected",
"")]
7 float m_TimeThreshold_S;
9 PerceptionComponent m_PerceptionComp;
12 protected override bool TestFunction(AIAgent owner)
14 if (!m_PerceptionComp)
15 m_PerceptionComp = PerceptionComponent.Cast(owner.GetControlledEntity().FindComponent(PerceptionComponent));
18 GetVariableIn(BASE_TARGET_PORT,target);
20 if (!target || !m_PerceptionComp)
29 float timeMax = Math.Max(m_TimeThreshold_S, m_PerceptionComp.GetUpdateInterval()) + 0.02;
31 float timeSinceDetected = ;
32 bool returnValue = timeSinceDetected < timeMax;
34 return target.GetTimeSinceDetected() < timeMax;
38 protected override bool VisibleInPalette()
44 protected override string GetOnHoverDescription()
46 return "Checks time since target was detected and compares it with threshold. Returns true when time is below the threshold.";
50 protected static ref TStringArray s_aVarsIn = {
53 protected override TStringArray GetVariablesIn()