本文整理汇总了C#中Agent.btreferencetree方法的典型用法代码示例。如果您正苦于以下问题:C# Agent.btreferencetree方法的具体用法?C# Agent.btreferencetree怎么用?C# Agent.btreferencetree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Agent
的用法示例。
在下文中一共展示了Agent.btreferencetree方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReQuery
private bool ReQuery(Agent pAgent)
{
Query pQueryNode = this.GetNode() as Query;
if (pQueryNode != null)
{
List<Query.Descriptor_t> qd = pQueryNode.GetDescriptors();
if (qd.Count > 0)
{
Dictionary<string, BehaviorTree> bs = Workspace.Instance.GetBehaviorTrees();
BehaviorTree btFound = null;
float similarityMax = -1.0f;
foreach(BehaviorTree bt in bs.Values)
{
string domains = bt.GetDomains();
if (string.IsNullOrEmpty(pQueryNode.m_domain) || (!string.IsNullOrEmpty(domains) && domains.IndexOf(pQueryNode.m_domain) != -1))
{
List<BehaviorTree.Descriptor_t> bd = bt.GetDescriptors();
float similarity = pQueryNode.ComputeSimilarity(qd, bd);
if (similarity > similarityMax)
{
similarityMax = similarity;
btFound = bt;
}
}
}
if (btFound != null)
{
pAgent.btreferencetree(btFound.GetName());
//pAgent.btexec();
return true;
}
}
}
return false;
}
示例2: 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;
}