Updated Interaction.cpp
Added base functionality for both functions to make camera move
This commit is contained in:
parent
58243e8ccc
commit
ab2d2118dd
@ -4,6 +4,7 @@
|
|||||||
#include "Interaction.h"
|
#include "Interaction.h"
|
||||||
|
|
||||||
#include "Chaos/BoundingVolumeUtilities.h"
|
#include "Chaos/BoundingVolumeUtilities.h"
|
||||||
|
#include "Components/Button.h"
|
||||||
#include "Components/WidgetComponent.h"
|
#include "Components/WidgetComponent.h"
|
||||||
|
|
||||||
|
|
||||||
@ -52,6 +53,16 @@ void AInteraction::RemoveWidget()
|
|||||||
ShopDialogWidget->RemoveFromViewport();
|
ShopDialogWidget->RemoveFromViewport();
|
||||||
UE_LOG(LogTemp, Display, TEXT("setting isDisabled to true"));
|
UE_LOG(LogTemp, Display, TEXT("setting isDisabled to true"));
|
||||||
ItemSelectorWidget = CreateWidget<UUserWidget>(GetWorld(), ItemSelector);
|
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)
|
if (ItemSelectorWidget == nullptr)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -61,4 +72,14 @@ void AInteraction::RemoveWidget()
|
|||||||
ItemSelectorWidget->AddToViewport(0);
|
ItemSelectorWidget->AddToViewport(0);
|
||||||
bisDisabled = false;
|
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"));
|
||||||
|
}
|
||||||
|
@ -44,5 +44,11 @@ public:
|
|||||||
|
|
||||||
UPROPERTY()
|
UPROPERTY()
|
||||||
bool bisDisabled = false;
|
bool bisDisabled = false;
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, Category= "ButtonLeft")
|
||||||
|
virtual void CameraLeftMover();
|
||||||
|
|
||||||
|
UFUNCTION(BlueprintCallable, Category= "ButtonLeft")
|
||||||
|
virtual void CameraRightMover();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user