本文整理汇总了C++中UBTNode::GetNextNode方法的典型用法代码示例。如果您正苦于以下问题:C++ UBTNode::GetNextNode方法的具体用法?C++ UBTNode::GetNextNode怎么用?C++ UBTNode::GetNextNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UBTNode
的用法示例。
在下文中一共展示了UBTNode::GetNextNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InjectNodes
//.........这里部分代码省略.........
bool bAlreadyInjected = false;
for (int32 Idx = 0; Idx < LinkData.Decorators.Num(); Idx++)
{
if (LinkData.Decorators[Idx] && LinkData.Decorators[Idx]->IsInjected())
{
bAlreadyInjected = true;
break;
}
}
// add decorators to link
const int32 NumOriginalDecorators = LinkData.Decorators.Num();
for (int32 Idx = 0; Idx < NumInjectedDecorators; Idx++)
{
UBTDecorator* InstancedOb = Cast<UBTDecorator>(OwnerComp.NodeInstances[FirstNodeIdx + Idx]);
InstancedOb->InitializeFromAsset(*BehaviorAsset);
InstancedOb->InitializeDecorator(ChildIdx);
if (!bAlreadyInjected)
{
LinkData.Decorators.Add(InstancedOb);
}
}
// update composite logic operators
if (!bAlreadyInjected && (LinkData.DecoratorOps.Num() || BehaviorAsset->RootDecoratorOps.Num()))
{
const int32 NumOriginalOps = LinkData.DecoratorOps.Num();
if (NumOriginalDecorators > 0)
{
// and operator for two groups of composites: original and new one
FBTDecoratorLogic MasterAndOp(EBTDecoratorLogic::And, LinkData.DecoratorOps.Num() ? 2 : (NumOriginalDecorators + 1));
LinkData.DecoratorOps.Insert(MasterAndOp, 0);
if (NumOriginalOps == 0)
{
// add Test operations, original link didn't have composite operators
for (int32 Idx = 0; Idx < NumOriginalDecorators; Idx++)
{
FBTDecoratorLogic TestOp(EBTDecoratorLogic::Test, Idx);
LinkData.DecoratorOps.Add(TestOp);
}
}
}
// add injected operators
if (BehaviorAsset->RootDecoratorOps.Num() == 0)
{
FBTDecoratorLogic InjectedAndOp(EBTDecoratorLogic::And, NumInjectedDecorators);
LinkData.DecoratorOps.Add(InjectedAndOp);
for (int32 Idx = 0; Idx < NumInjectedDecorators; Idx++)
{
FBTDecoratorLogic TestOp(EBTDecoratorLogic::Test, NumOriginalDecorators + Idx);
LinkData.DecoratorOps.Add(TestOp);
}
}
else
{
for (int32 Idx = 0; Idx < BehaviorAsset->RootDecoratorOps.Num(); Idx++)
{
FBTDecoratorLogic InjectedOp = BehaviorAsset->RootDecoratorOps[Idx];
if (InjectedOp.Operation == EBTDecoratorLogic::Test)
{
InjectedOp.Number += NumOriginalDecorators;
}
LinkData.DecoratorOps.Add(InjectedOp);
}
}
}
#if USE_BEHAVIORTREE_DEBUGGER
if (!bAlreadyInjected)
{
// insert to NextExecutionNode list for debugger
UBTNode* NodeIt = GetParentNode();
while (NodeIt && NodeIt->GetNextNode() != this)
{
NodeIt = NodeIt->GetNextNode();
}
if (NodeIt)
{
NodeIt->InitializeExecutionOrder(OwnerComp.NodeInstances[FirstNodeIdx]);
NodeIt = NodeIt->GetNextNode();
for (int32 Idx = 1; Idx < NumInjectedDecorators; Idx++)
{
NodeIt->InitializeExecutionOrder(OwnerComp.NodeInstances[FirstNodeIdx + Idx]);
NodeIt = NodeIt->GetNextNode();
}
NodeIt->InitializeExecutionOrder((UBTNode*)this);
}
}
#endif
}
}
}