// 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() TWeakObjectPtr OwningActor; // Our tangible Manager. UPROPERTY() TWeakObjectPtr TangibleManager; // Animation tracker FlxAnimTracker AnimTracker; // Current Plane. FString Plane; public: void Init(UTangibleManager* tm, AActor* a, int64 id); 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); };