Download LyraStarterGame/Source/LyraGame/UI/LyraTouchRegion.cpp from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 1.22 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/UI/LyraTouchRegion.cpp
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/UI/LyraTouchRegion.cpp
-
curl -L -o LyraTouchRegion.cpp https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/UI/LyraTouchRegion.cpp
1.22 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| struct FGeometry; | |
| struct FPointerEvent; | |
| FReply ULyraTouchRegion::NativeOnTouchStarted(const FGeometry& InGeometry, const FPointerEvent& InGestureEvent) | |
| { | |
| bShouldSimulateInput = true; | |
| return Super::NativeOnTouchStarted(InGeometry, InGestureEvent); | |
| } | |
| FReply ULyraTouchRegion::NativeOnTouchMoved(const FGeometry& InGeometry, const FPointerEvent& InGestureEvent) | |
| { | |
| // Input our associatied key as long as the player is touching within our bounds | |
| //InputKeyValue(FVector::OneVector); | |
| bShouldSimulateInput = true; | |
| // Continuously trigger the input if we should | |
| return Super::NativeOnTouchMoved(InGeometry, InGestureEvent); | |
| } | |
| FReply ULyraTouchRegion::NativeOnTouchEnded(const FGeometry& InGeometry, const FPointerEvent& InGestureEvent) | |
| { | |
| bShouldSimulateInput = false; | |
| return Super::NativeOnTouchEnded(InGeometry, InGestureEvent); | |
| } | |
| void ULyraTouchRegion::NativeTick(const FGeometry& MyGeometry, float InDeltaTime) | |
| { | |
| Super::NativeTick(MyGeometry, InDeltaTime); | |
| if(bShouldSimulateInput) | |
| { | |
| InputKeyValue(FVector::OneVector); | |
| } | |
| } | |