Download LyraStarterGame/Source/LyraGame/Input/LyraInputComponent.h from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 2.57 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Input/LyraInputComponent.h
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/Input/LyraInputComponent.h
-
curl -L -o LyraInputComponent.h https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Input/LyraInputComponent.h
2.57 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| class UEnhancedInputLocalPlayerSubsystem; | |
| class UInputAction; | |
| class UObject; | |
| /** | |
| * ULyraInputComponent | |
| * | |
| * Component used to manage input mappings and bindings using an input config data asset. | |
| */ | |
| UCLASS(Config = Input) | |
| class ULyraInputComponent : public UEnhancedInputComponent | |
| { | |
| GENERATED_BODY() | |
| public: | |
| ULyraInputComponent(const FObjectInitializer& ObjectInitializer); | |
| void AddInputMappings(const ULyraInputConfig* InputConfig, UEnhancedInputLocalPlayerSubsystem* InputSubsystem) const; | |
| void RemoveInputMappings(const ULyraInputConfig* InputConfig, UEnhancedInputLocalPlayerSubsystem* InputSubsystem) const; | |
| template<class UserClass, typename FuncType> | |
| void BindNativeAction(const ULyraInputConfig* InputConfig, const FGameplayTag& InputTag, ETriggerEvent TriggerEvent, UserClass* Object, FuncType Func, bool bLogIfNotFound); | |
| template<class UserClass, typename PressedFuncType, typename ReleasedFuncType> | |
| void BindAbilityActions(const ULyraInputConfig* InputConfig, UserClass* Object, PressedFuncType PressedFunc, ReleasedFuncType ReleasedFunc, TArray<uint32>& BindHandles); | |
| void RemoveBinds(TArray<uint32>& BindHandles); | |
| }; | |
| template<class UserClass, typename FuncType> | |
| void ULyraInputComponent::BindNativeAction(const ULyraInputConfig* InputConfig, const FGameplayTag& InputTag, ETriggerEvent TriggerEvent, UserClass* Object, FuncType Func, bool bLogIfNotFound) | |
| { | |
| check(InputConfig); | |
| if (const UInputAction* IA = InputConfig->FindNativeInputActionForTag(InputTag, bLogIfNotFound)) | |
| { | |
| BindAction(IA, TriggerEvent, Object, Func); | |
| } | |
| } | |
| template<class UserClass, typename PressedFuncType, typename ReleasedFuncType> | |
| void ULyraInputComponent::BindAbilityActions(const ULyraInputConfig* InputConfig, UserClass* Object, PressedFuncType PressedFunc, ReleasedFuncType ReleasedFunc, TArray<uint32>& BindHandles) | |
| { | |
| check(InputConfig); | |
| for (const FLyraInputAction& Action : InputConfig->AbilityInputActions) | |
| { | |
| if (Action.InputAction && Action.InputTag.IsValid()) | |
| { | |
| if (PressedFunc) | |
| { | |
| BindHandles.Add(BindAction(Action.InputAction, ETriggerEvent::Triggered, Object, PressedFunc, Action.InputTag).GetHandle()); | |
| } | |
| if (ReleasedFunc) | |
| { | |
| BindHandles.Add(BindAction(Action.InputAction, ETriggerEvent::Completed, Object, ReleasedFunc, Action.InputTag).GetHandle()); | |
| } | |
| } | |
| } | |
| } | |