Exemple #1
0
        protected override void onexit(Agent pAgent, EBTStatus status)
        {
            Debug.Check(this.m_node is ReferencedBehavior);
            ReferencedBehavior pNode = this.m_node as ReferencedBehavior;

            Debug.Check(pNode != null);

            this.m_subTree          = null;
            pAgent.ExcutingTreeTask = this.oldTreeTask_;
#if !BEHAVIAC_RELEASE
            pAgent.LogReturnTree(pNode.GetReferencedTree(pAgent));
#endif

            Debug.Check(this.currentState != null);
            this.currentState.Pop();
        }
Exemple #2
0
            protected override bool onenter(Agent pAgent)
            {
                ReferencedBehavior pNode = this.GetNode() as ReferencedBehavior;

                Debug.Check(pNode != null);

                this.m_nextStateId = -1;

                string szTreePath = pNode.GetReferencedTree(pAgent);

                this.m_subTree = Workspace.Instance.CreateBehaviorTreeTask(szTreePath);

                pNode.SetTaskParams(pAgent, this.m_subTree);

                return(true);
            }
Exemple #3
0
        public static string GetParentTreeName(Agent pAgent, BehaviorNode n)
        {
            string btName = null;

            if (n is ReferencedBehavior)
            {
                n = n.Parent;
            }

            bool bIsTree    = false;
            bool bIsRefTree = false;

            while (n != null)
            {
                bIsTree    = (n is BehaviorTree);
                bIsRefTree = (n is ReferencedBehavior);

                if (bIsTree || bIsRefTree)
                {
                    break;
                }

                n = n.Parent;
            }

            if (bIsTree)
            {
                BehaviorTree bt = n as BehaviorTree;
                btName = bt.GetName();
            }
            else if (bIsRefTree)
            {
                ReferencedBehavior refTree = n as ReferencedBehavior;
                btName = refTree.GetReferencedTree(pAgent);
            }
            else
            {
                Debug.Check(false);
            }

            return(btName);
        }
Exemple #4
0
        public void LogPlanReferenceTreeExit(Agent a, ReferencedBehavior referencedNode)
        {
#if !BEHAVIAC_RELEASE
            if (Config.IsLoggingOrSocketing)
            {
                string ni = BehaviorTask.GetTickInfo(a, referencedNode, null);
                LogManager.Instance.Log("[plan_referencetree_exit]{0} {1}.xml\n", ni, referencedNode.GetReferencedTree(a));
            }
#endif
        }
Exemple #5
0
        public void LogPlanReferenceTreeExit(Agent a, ReferencedBehavior referencedNode)
        {
            #if !BEHAVIAC_RELEASE

            if (Config.IsLoggingOrSocketing)
            {
                string ni = BehaviorTask.GetTickInfo(a, referencedNode, null);
                LogManager.Instance.Log("[plan_referencetree_exit]{0} {1}.xml\n", ni, referencedNode.GetReferencedTree(a));
            }

            #endif
        }