本文整理匯總了C#中Agent.btgetcurrent方法的典型用法代碼示例。如果您正苦於以下問題:C# Agent.btgetcurrent方法的具體用法?C# Agent.btgetcurrent怎麽用?C# Agent.btgetcurrent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Agent
的用法示例。
在下文中一共展示了Agent.btgetcurrent方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetTickInfo
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;
}
示例2: Log
//profiler
public void Log(Agent pAgent, string btMsg, long time)
{
#if !BEHAVIAC_RELEASE
if (Config.IsLoggingOrSocketing)
{
if (Config.IsProfiling)
{
//BEHAVIAC_PROFILE("LogManager.Instance.LogProfiler");
if (!System.Object.ReferenceEquals(pAgent, null) && pAgent.IsMasked())
{
//string agentClassName = pAgent.GetObjectTypeName();
//string agentInstanceName = pAgent.GetName();
BehaviorTreeTask bt = !System.Object.ReferenceEquals(pAgent, null) ? pAgent.btgetcurrent() : null;
string btName;
if (bt != null)
{
btName = bt.GetName();
}
else
{
btName = "None";
}
//[profiler]Ship.Ship_1 ships\suicide.xml.BehaviorTree[0] 0.031
string buffer;
//buffer = FormatString("[profiler]%s.%s %s.%s %d\n", agentClassName, agentInstanceName, btName, btMsg, time);
buffer = string.Format("[profiler]{0}.xml.{1} {2}\n", btName, btMsg, time);
Output(pAgent, buffer);
}
}
}
#endif
}
示例3: update
protected override EBTStatus update(Agent pAgent, EBTStatus childStatus)
{
Debug.Check(m_returnStatus == EBTStatus.BT_INVALID);
ReferencedBehavior pNode = this.GetNode() as ReferencedBehavior;
if (pNode != null)
{
string pThisTree = pAgent.btgetcurrent().GetName();
string msg = string.Format("{0}[{1}] {2}", pThisTree, pNode.GetId(), pNode.m_referencedBehaviorPath);
LogManager.Log(pAgent, msg, EActionResult.EAR_none, LogMode.ELM_jump);
pAgent.btreferencetree(pNode.m_referencedBehaviorPath);
}
return EBTStatus.BT_RUNNING;
}