2023-09-25 18:00:34 -04:00
|
|
|
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
#include "Components/ActorComponent.h"
|
|
|
|
|
#include "AnimQueue.h"
|
|
|
|
|
#include "TangibleComponent.generated.h"
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* TangibleComponent
|
|
|
|
|
*
|
|
|
|
|
* The TangibleManager procedurally injects a TangibleComponent
|
|
|
|
|
* into the actor. This gives us a place to store tangible-specific
|
|
|
|
|
* actor properties, such as the tangible Id, the animation queue,
|
|
|
|
|
* and so forth.
|
|
|
|
|
*
|
|
|
|
|
* To cooperate the with the garbage collector, don't store pointers
|
|
|
|
|
* to TangibleComponents in data structures. Instead, store a pointer
|
|
|
|
|
* to the actor and then use GetComponentByClass to retrieve the
|
|
|
|
|
* TangibleComponent on demand.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
class UTangibleManager;
|
|
|
|
|
|
|
|
|
|
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
|
|
|
|
|
class INTEGRATION_API UTangibleComponent : public UActorComponent
|
|
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
UTangibleComponent();
|
|
|
|
|
|
|
|
|
|
// The tangible ID.
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
uint64 TangibleId;
|
|
|
|
|
|
|
|
|
|
// The actor that we're a part of.
|
|
|
|
|
UPROPERTY()
|
2023-09-25 18:32:05 -04:00
|
|
|
TWeakObjectPtr<AActor> OwningActor;
|
2023-09-25 18:00:34 -04:00
|
|
|
|
|
|
|
|
// Our tangible Manager.
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
TWeakObjectPtr<UTangibleManager> TangibleManager;
|
|
|
|
|
|
|
|
|
|
// Animation tracker
|
|
|
|
|
FlxAnimTracker AnimTracker;
|
|
|
|
|
|
|
|
|
|
// Current Plane.
|
|
|
|
|
FString Plane;
|
|
|
|
|
|
2023-09-25 18:32:05 -04:00
|
|
|
public:
|
2023-09-25 18:00:34 -04:00
|
|
|
void Init(UTangibleManager* tm, AActor* a, int64 id);
|
|
|
|
|
|
2023-09-25 18:32:05 -04:00
|
|
|
AActor* GetActor() const { return OwningActor.Get(); }
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
UFUNCTION(BlueprintCallable, Meta = (DefaultToSelf = "target"), Category = Luprex)
|
|
|
|
|
static FString GetTangiblePlane(AActor* target);
|
|
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintCallable, Meta = (DefaultToSelf = "target"), Category = Luprex)
|
|
|
|
|
static void SetTangiblePlane(AActor* target, const FString& plane);
|
2023-09-25 18:00:34 -04:00
|
|
|
};
|