| 1019 | } |
| 1020 | |
| 1021 | ULevelStreamingDynamic* URoom::LoadInstance(UObject* WorldContextObject, const TSoftObjectPtr<UWorld>& Level, const FString& InstanceNameSuffix, FVector Location, FRotator Rotation) |
| 1022 | { |
| 1023 | DungeonLog_InfoSilent("[W:%s] Loading LevelStreamingDynamic", *GetNameSafe(WorldContextObject)); |
| 1024 | |
| 1025 | if (Level.IsNull()) |
| 1026 | { |
| 1027 | DungeonLog_Error("Failed to load level instance: Level is invalid."); |
| 1028 | return nullptr; |
| 1029 | } |
| 1030 | |
| 1031 | bool success = false; |
| 1032 | ULevelStreamingDynamic* Instance = ULevelStreamingDynamic::LoadLevelInstanceBySoftObjectPtr(WorldContextObject, Level, Location, Rotation, success, InstanceNameSuffix); |
| 1033 | Instance->bDisableDistanceStreaming = true; // Make sure the level will not be streamed out by distance. We have our own streaming logic. |
| 1034 | |
| 1035 | if (!success) |
| 1036 | { |
| 1037 | DungeonLog_Error("Failed to load level instance: Unknown reason"); |
| 1038 | return nullptr; |
| 1039 | } |
| 1040 | |
| 1041 | return Instance; |
| 1042 | } |
| 1043 | |
| 1044 | void URoom::UnloadInstance(ULevelStreamingDynamic* Instance) |
| 1045 | { |
nothing calls this directly
no outgoing calls
no test coverage detected