Class Tangible can now recreate its Actor
This commit is contained in:
@@ -3,12 +3,10 @@
|
||||
#include "IntegrationGameModeBase.h"
|
||||
#include "lpx-drvutil.hpp"
|
||||
#include "DebugPrint.h"
|
||||
#include "TangibleComponent.h"
|
||||
#include "Tangible.h"
|
||||
#include "TangibleManager.h"
|
||||
#include "TangibleInterface.h"
|
||||
#include "CommonTypes.h"
|
||||
#include "AnimQueue.h"
|
||||
#include "IntegrationGameState.h"
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
@@ -17,7 +15,7 @@ using namespace CommonTypes;
|
||||
|
||||
AIntegrationGameModeBase::AIntegrationGameModeBase()
|
||||
{
|
||||
TangibleManager = NewObject<UTangibleManager>();
|
||||
TangibleManager = NewObject<UlxTangibleManager>();
|
||||
EngineSeconds = 0.0;
|
||||
NextThreadTrigger = 1.0;
|
||||
//PrimaryActorTick.bCanEverTick = true; // Probably wrong
|
||||
@@ -127,8 +125,9 @@ void AIntegrationGameModeBase::UpdateTangibles() {
|
||||
FlxLockedWrapper w(LockableWrapper);
|
||||
int64 actor = w.GetActor();
|
||||
TangibleManager->SetPlayer(actor);
|
||||
TangibleManager->SetNear(w.GetNear(actor, 100, 100, 100));
|
||||
for (int64 id : TangibleManager->GetNear()) {
|
||||
IdView near = w.GetNear(actor, 100, 100, 100);
|
||||
TangibleManager->SetNear(near);
|
||||
for (int64 id : near) {
|
||||
TangibleManager->MakeTangible(id);
|
||||
}
|
||||
// Update animation queues of live tangibles.
|
||||
@@ -136,7 +135,7 @@ void AIntegrationGameModeBase::UpdateTangibles() {
|
||||
StringViewVec aqueues = w.GetAnimationQueues(tanids);
|
||||
for (int i = 0; i < tanids.Num(); i++) {
|
||||
uint64_t tanid = tanids[i];
|
||||
UTangibleComponent *t = TangibleManager->GetTangible(tanid);
|
||||
UlxTangible *t = TangibleManager->GetTangible(tanid);
|
||||
t->AnimTracker.Update(aqueues[i]);
|
||||
TArray<uint64> aborted = t->AnimTracker.GetAborted();
|
||||
for (uint64 hash : aborted) {
|
||||
@@ -243,7 +242,7 @@ void AIntegrationGameModeBase::BeginPlay()
|
||||
}
|
||||
|
||||
// Initialize the tangible manager.
|
||||
TangibleManager = NewObject<UTangibleManager>();
|
||||
TangibleManager = NewObject<UlxTangibleManager>();
|
||||
TangibleManager->Init(GetWorld(), ClassTangibleActor);
|
||||
}
|
||||
|
||||
@@ -252,16 +251,3 @@ void AIntegrationGameModeBase::EndPlay(const EEndPlayReason::Type EndPlayReason)
|
||||
ResetToInitialState();
|
||||
}
|
||||
|
||||
namespace IntegrationGameState {
|
||||
|
||||
UTangibleManager* GetTangibleManager(AActor *actor) {
|
||||
AGameModeBase* gmb = actor->GetWorld()->GetAuthGameMode();
|
||||
AIntegrationGameModeBase* igmb = Cast<AIntegrationGameModeBase>(gmb);
|
||||
if (igmb == nullptr) {
|
||||
return nullptr;
|
||||
} else {
|
||||
return igmb->TangibleManager;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace IntegrationGameState
|
||||
|
||||
Reference in New Issue
Block a user