本文整理汇总了C++中UObject::GetWorld方法的典型用法代码示例。如果您正苦于以下问题:C++ UObject::GetWorld方法的具体用法?C++ UObject::GetWorld怎么用?C++ UObject::GetWorld使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UObject
的用法示例。
在下文中一共展示了UObject::GetWorld方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetWorld
UWorld* UUserWidget::GetWorld() const
{
if ( HasAllFlags(RF_ClassDefaultObject) )
{
// If we are a CDO, we must return nullptr instead of calling Outer->GetWorld() to fool UObject::ImplementsGetWorld.
return nullptr;
}
// Use the Player Context's world, if a specific player context is given, otherwise fall back to
// following the outer chain.
if ( PlayerContext.IsValid() )
{
if ( UWorld* World = PlayerContext.GetWorld() )
{
return World;
}
}
// Could be a GameInstance, could be World, could also be a WidgetTree, so we're just going to follow
// the outer chain to find the world we're in.
UObject* Outer = GetOuter();
while ( Outer )
{
UWorld* World = Outer->GetWorld();
if ( World )
{
return World;
}
Outer = Outer->GetOuter();
}
return nullptr;
}
示例2: FindPossessableObjectId
FGuid ULevelSequence::FindPossessableObjectId(UObject& Object) const
{
return ObjectReferences.FindBindingId(&Object, Object.GetWorld());
}