#include "PortaUtils.h"

UWorld* PortaUtils::GetCurrentWorld()
{
#if WITH_EDITOR
	UEditorEngine* EditorEngine = Cast<UEditorEngine>(GEngine);
	if (GIsEditor && EditorEngine != nullptr)
	{
		auto World = EditorEngine->PlayWorld != nullptr ? ToRawPtr(EditorEngine->PlayWorld) : EditorEngine->GetEditorWorldContext().World();
		if (World)
			return World;
	}

#endif
	return GEngine->GetCurrentPlayWorld();

}
