Updated Interaction.cpp

Added base functionality for both functions to make camera move
This commit is contained in:
MH261677 2023-01-16 17:02:12 +00:00
parent 58243e8ccc
commit ab2d2118dd
2 changed files with 28 additions and 1 deletions

View File

@ -4,6 +4,7 @@
#include "Interaction.h"
#include "Chaos/BoundingVolumeUtilities.h"
#include "Components/Button.h"
#include "Components/WidgetComponent.h"
@ -52,6 +53,16 @@ void AInteraction::RemoveWidget()
ShopDialogWidget->RemoveFromViewport();
UE_LOG(LogTemp, Display, TEXT("setting isDisabled to true"));
ItemSelectorWidget = CreateWidget<UUserWidget>(GetWorld(), ItemSelector);
UProperty* Property = ItemSelectorWidget->GetClass()->FindPropertyByName("publicActor");
if (Property == nullptr)
{
UE_LOG(LogTemp, Error, TEXT("Property not found"));
}
else
{
FObjectPropertyBase* ObjectProperty = static_cast<FObjectPropertyBase*>(Property);
ObjectProperty->SetObjectPropertyValue(ObjectProperty->ContainerPtrToValuePtr<void>(ItemSelectorWidget), this);
}
if (ItemSelectorWidget == nullptr)
{
return;
@ -62,3 +73,13 @@ void AInteraction::RemoveWidget()
bisDisabled = false;
}
}
void AInteraction::CameraLeftMover()
{
UE_LOG(LogTemp, Display, TEXT("Button Left is being pressed"));
}
void AInteraction::CameraRightMover()
{
UE_LOG(LogTemp, Display, TEXT("Button Right is being pressed"));
}

View File

@ -44,5 +44,11 @@ public:
UPROPERTY()
bool bisDisabled = false;
UFUNCTION(BlueprintCallable, Category= "ButtonLeft")
virtual void CameraLeftMover();
UFUNCTION(BlueprintCallable, Category= "ButtonLeft")
virtual void CameraRightMover();
};