Spawning a TangibleActor
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -43,5 +43,7 @@ public:
|
||||
void ClearDirty() { Dirty = false; }
|
||||
};
|
||||
|
||||
AActor* CreateTangible(UWorld *w, UClass* uclass);
|
||||
|
||||
} // namespace engineutil
|
||||
|
||||
|
||||
Reference in New Issue
Block a user