Implement 'Set Tangible Plane'
This commit is contained in:
@@ -11,6 +11,19 @@ UTangibleComponent::UTangibleComponent()
|
||||
void UTangibleComponent::Init(UTangibleManager* tm, AActor* a, int64 id)
|
||||
{
|
||||
TangibleManager = tm;
|
||||
Actor = a;
|
||||
OwningActor = a;
|
||||
TangibleId = id;
|
||||
}
|
||||
|
||||
FString UTangibleComponent::GetTangiblePlane(AActor* actor) {
|
||||
UTangibleComponent* comp = actor->GetComponentByClass<UTangibleComponent>();
|
||||
check(comp != nullptr);
|
||||
return comp->Plane;
|
||||
}
|
||||
|
||||
void UTangibleComponent::SetTangiblePlane(AActor* actor, const FString& plane) {
|
||||
UTangibleComponent* comp = actor->GetComponentByClass<UTangibleComponent>();
|
||||
check(comp != nullptr);
|
||||
comp->Plane = plane;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
|
||||
// The actor that we're a part of.
|
||||
UPROPERTY()
|
||||
TWeakObjectPtr<AActor> Actor;
|
||||
TWeakObjectPtr<AActor> OwningActor;
|
||||
|
||||
// Our tangible Manager.
|
||||
UPROPERTY()
|
||||
@@ -50,7 +50,15 @@ public:
|
||||
// Current Plane.
|
||||
FString Plane;
|
||||
|
||||
public:
|
||||
void Init(UTangibleManager* tm, AActor* a, int64 id);
|
||||
|
||||
AActor* GetActor() const { return Actor.Get(); }
|
||||
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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user