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 "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")); | ||||
| } | ||||
|  | ||||
| @ -44,5 +44,11 @@ public: | ||||
| 
 | ||||
| 	UPROPERTY() | ||||
| 	bool bisDisabled = false; | ||||
| 
 | ||||
| 	UFUNCTION(BlueprintCallable, Category= "ButtonLeft") | ||||
| 	virtual void CameraLeftMover(); | ||||
| 
 | ||||
| 	UFUNCTION(BlueprintCallable, Category= "ButtonLeft") | ||||
| 	virtual void CameraRightMover(); | ||||
| }; | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user