예제 #1
0
        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;
        }