public BehaviorTask GetChildById(int nodeId) { if (this.m_states != null && this.m_states.Count > 0) { for (int i = 0; i < this.m_states.Count; ++i) { BehaviorTask c = this.m_states[i]; if (c.GetId() == nodeId) { return(c); } } } return(null); }
protected BehaviorTask GetChildById(int nodeId) { if (this.m_children != null && this.m_children.Count > 0) { for (int i = 0; i < this.m_children.Count; ++i) { BehaviorTask c = this.m_children[i]; if (c.GetId() == nodeId) { return(c); } } } return(null); }
public static string GetTickInfo(Agent pAgent, BehaviorTask b, string action) { #if !BEHAVIAC_RELEASE if (Config.IsLoggingOrSocketing) { if (pAgent != null && pAgent.IsMasked()) { //BEHAVIAC_PROFILE("GetTickInfo", true); string bClassName = b.GetClassNameString(); //filter out intermediate bt, whose class name is empty if (!string.IsNullOrEmpty(bClassName)) { int nodeId = b.GetId(); BehaviorTreeTask bt = pAgent != null?pAgent.btgetcurrent() : null; //TestBehaviorGroup\scratch.xml.EventetTask[0]:enter string bpstr = ""; if (bt != null) { string btName = bt.GetName(); bpstr = string.Format("{0}.xml->", btName); } bpstr += string.Format("{0}[{1}]", bClassName, nodeId); if (!string.IsNullOrEmpty(action)) { bpstr += string.Format(":{0}", action); } return(bpstr); } } } #endif return(string.Empty); }
public static string GetTickInfo(Agent pAgent, BehaviorTask b, string action) { #if !BEHAVIAC_RELEASE if (Config.IsLoggingOrSocketing) { if (pAgent != null && pAgent.IsMasked()) { //BEHAVIAC_PROFILE("GetTickInfo", true); string bClassName = b.GetClassNameString(); //filter out intermediate bt, whose class name is empty if (!string.IsNullOrEmpty(bClassName)) { int nodeId = b.GetId(); BehaviorTreeTask bt = pAgent != null ? pAgent.btgetcurrent() : null; //TestBehaviorGroup\scratch.xml.EventetTask[0]:enter string bpstr = ""; if (bt != null) { string btName = bt.GetName(); bpstr = string.Format("{0}.xml->", btName); } bpstr += string.Format("{0}[{1}]", bClassName, nodeId); if (!string.IsNullOrEmpty(action)) { bpstr += string.Format(":{0}", action); } return bpstr; } } } #endif return string.Empty; }