本文整理汇总了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;
}