本文整理匯總了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;
}