public Task RootTaskNode(Agent pAgent) { if (this.m_taskNode == null) { string szTreePath = this.GetReferencedTree(pAgent); BehaviorTree bt = Workspace.Instance.LoadBehaviorTree(szTreePath); if (bt != null && bt.GetChildrenCount() == 1) { BehaviorNode root = bt.GetChild(0); this.m_taskNode = root as Task; } } return(this.m_taskNode); }