Spawning a TangibleActor

This commit is contained in:
2023-08-29 20:05:10 -04:00
parent c8db8c44da
commit 3ac39c2aaf
5 changed files with 19 additions and 2 deletions

View File

@@ -191,6 +191,11 @@ void AIntegrationGameModeBase::BeginPlay()
ThreadEvent = FPlatformProcess::GetSynchEventFromPool(false);
Thread = FRunnableThread::Create(this, TEXT("Worker Thread"));
}
// Create a tangible.
UWorld* w = GetWorld();
AActor* aa = engineutil::CreateTangible(w, ClassTangibleActor);
Tangibles.Add(aa);
}
void AIntegrationGameModeBase::EndPlay(const EEndPlayReason::Type EndPlayReason)

View File

@@ -46,6 +46,9 @@ public:
// Transfer console output from the Luprex engine to unreal.
void HandleLuprexConsoleOutput();
// Array of tangibles.
TArray<AActor*> Tangibles;
// This stores the entire text currently visible in the console.
engineutil::ConsoleOutput ConsoleOutput;

View File

@@ -76,6 +76,13 @@ void ConsoleOutput::Truncate() {
}
}
AActor* CreateTangible(UWorld *w, UClass* uclass) {
FVector location;
FRotator rotation;
FActorSpawnParameters params;
AActor *result = w->SpawnActor(uclass, &location, &rotation, params);
return result;
}
} // namespace engineutil

View File

@@ -43,5 +43,7 @@ public:
void ClearDirty() { Dirty = false; }
};
AActor* CreateTangible(UWorld *w, UClass* uclass);
} // namespace engineutil