第一次提交
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// Copyright 2025 https://yuewu.dev/en All Rights Reserved.
|
||||
|
||||
|
||||
#include "GCS_ActorOwnedObject.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
|
||||
UWorld* UGCS_ActorOwnedObject::GetWorld() const
|
||||
{
|
||||
// To Make sure the outer is Valid and can be used
|
||||
if (!HasAnyFlags(RF_ClassDefaultObject) && !GetOuter()->HasAnyFlags(RF_BeginDestroyed) && !GetOuter()->IsUnreachable())
|
||||
{
|
||||
//Attempt to get the world
|
||||
AActor* Outer = GetTypedOuter<AActor>();
|
||||
if (Outer != nullptr)
|
||||
{
|
||||
return Outer->GetWorld();
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
Reference in New Issue
Block a user