Spawning a TangibleActor
This commit is contained in:
BIN
Content/TangibleActor.uasset
LFS
BIN
Content/TangibleActor.uasset
LFS
Binary file not shown.
@@ -191,6 +191,11 @@ void AIntegrationGameModeBase::BeginPlay()
|
|||||||
ThreadEvent = FPlatformProcess::GetSynchEventFromPool(false);
|
ThreadEvent = FPlatformProcess::GetSynchEventFromPool(false);
|
||||||
Thread = FRunnableThread::Create(this, TEXT("Worker Thread"));
|
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)
|
void AIntegrationGameModeBase::EndPlay(const EEndPlayReason::Type EndPlayReason)
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ public:
|
|||||||
// Transfer console output from the Luprex engine to unreal.
|
// Transfer console output from the Luprex engine to unreal.
|
||||||
void HandleLuprexConsoleOutput();
|
void HandleLuprexConsoleOutput();
|
||||||
|
|
||||||
|
// Array of tangibles.
|
||||||
|
TArray<AActor*> Tangibles;
|
||||||
|
|
||||||
// This stores the entire text currently visible in the console.
|
// This stores the entire text currently visible in the console.
|
||||||
engineutil::ConsoleOutput ConsoleOutput;
|
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
|
} // namespace engineutil
|
||||||
|
|
||||||
|
|||||||
@@ -43,5 +43,7 @@ public:
|
|||||||
void ClearDirty() { Dirty = false; }
|
void ClearDirty() { Dirty = false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
AActor* CreateTangible(UWorld *w, UClass* uclass);
|
||||||
|
|
||||||
} // namespace engineutil
|
} // namespace engineutil
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user