Tangible creation and destruction in place
This commit is contained in:
@@ -6,8 +6,12 @@
|
||||
|
||||
UlxTangible::UlxTangible()
|
||||
{
|
||||
Manager = nullptr;
|
||||
TangibleId = -1;
|
||||
CurrentActor = nullptr;
|
||||
ActorBlueprint = nullptr;
|
||||
NearAccordingToLuprex = false;
|
||||
NearAccordingToUnreal = false;
|
||||
}
|
||||
|
||||
void UlxTangible::Init(UlxTangibleManager* tm, int64 id)
|
||||
@@ -69,15 +73,50 @@ void UlxTangible::SetActorBlueprintClass(TSubclassOf<AActor> bp) {
|
||||
}
|
||||
}
|
||||
|
||||
void UlxTangible::UpdateAnimationQueue(std::string_view aq) {
|
||||
AnimTracker.Update(aq);
|
||||
TArray<uint64> aborted = AnimTracker.GetAborted();
|
||||
for (uint64 hash : aborted) {
|
||||
IlxTangibleInterface::Execute_AbortAnimation(GetActor(), hash);
|
||||
}
|
||||
FlxAnimationStep step;
|
||||
ElxAnimationMode mode = AnimTracker.GetNextStep(step);
|
||||
if (mode != ElxAnimationMode::INVALID) {
|
||||
bool started = IlxTangibleInterface::Execute_StartAnimation(GetActor(), mode, step);
|
||||
if (started) {
|
||||
AnimTracker.StartedStep(step.Hash);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FVector UlxTangible::GetLocation() const {
|
||||
if (CurrentActor == nullptr) {
|
||||
return FVector(0,0,0);
|
||||
} else {
|
||||
return CurrentActor->GetActorLocation();
|
||||
}
|
||||
}
|
||||
|
||||
void UlxTangible::Destroy() {
|
||||
SetActorBlueprintClass(nullptr);
|
||||
Manager = nullptr;
|
||||
TangibleId = -1;
|
||||
CurrentActor = nullptr;
|
||||
ActorBlueprint = nullptr;
|
||||
AnimTracker.Clear();
|
||||
NearAccordingToLuprex = false;
|
||||
NearAccordingToUnreal = false;
|
||||
}
|
||||
|
||||
FString UlxTangible::GetTangiblePlane(AActor* actor) {
|
||||
UlxTangibleComponent* comp = actor->GetComponentByClass<UlxTangibleComponent>();
|
||||
check(comp != nullptr);
|
||||
return comp->Tangible->Plane;
|
||||
return comp->Tangible->Plane.ToString();
|
||||
}
|
||||
|
||||
void UlxTangible::SetTangiblePlane(AActor* actor, const FString& plane) {
|
||||
UlxTangibleComponent* comp = actor->GetComponentByClass<UlxTangibleComponent>();
|
||||
check(comp != nullptr);
|
||||
comp->Tangible->Plane = plane;
|
||||
comp->Tangible->Plane = FName(plane);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user