Download LyraStarterGame/Source/LyraGame/Character/LyraHeroComponent.h from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 4.5 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Character/LyraHeroComponent.h
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/Character/LyraHeroComponent.h
-
curl -L -o LyraHeroComponent.h https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Character/LyraHeroComponent.h
4.5 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| namespace EEndPlayReason { enum Type : int; } | |
| struct FLoadedMappableConfigPair; | |
| struct FMappableConfigPair; | |
| class UGameFrameworkComponentManager; | |
| class UInputComponent; | |
| class ULyraCameraMode; | |
| class ULyraInputConfig; | |
| class UObject; | |
| struct FActorInitStateChangedParams; | |
| struct FFrame; | |
| struct FGameplayTag; | |
| struct FInputActionValue; | |
| /** | |
| * Component that sets up input and camera handling for player controlled pawns (or bots that simulate players). | |
| * This depends on a PawnExtensionComponent to coordinate initialization. | |
| */ | |
| UCLASS(MinimalAPI, Blueprintable, Meta=(BlueprintSpawnableComponent)) | |
| class ULyraHeroComponent : public UPawnComponent, public IGameFrameworkInitStateInterface | |
| { | |
| GENERATED_BODY() | |
| public: | |
| UE_API ULyraHeroComponent(const FObjectInitializer& ObjectInitializer); | |
| /** Returns the hero component if one exists on the specified actor. */ | |
| UFUNCTION(BlueprintPure, Category = "Lyra|Hero") | |
| static ULyraHeroComponent* FindHeroComponent(const AActor* Actor) { return (Actor ? Actor->FindComponentByClass<ULyraHeroComponent>() : nullptr); } | |
| /** Overrides the camera from an active gameplay ability */ | |
| UE_API void SetAbilityCameraMode(TSubclassOf<ULyraCameraMode> CameraMode, const FGameplayAbilitySpecHandle& OwningSpecHandle); | |
| /** Clears the camera override if it is set */ | |
| UE_API void ClearAbilityCameraMode(const FGameplayAbilitySpecHandle& OwningSpecHandle); | |
| /** Adds mode-specific input config */ | |
| UE_API void AddAdditionalInputConfig(const ULyraInputConfig* InputConfig); | |
| /** Removes a mode-specific input config if it has been added */ | |
| UE_API void RemoveAdditionalInputConfig(const ULyraInputConfig* InputConfig); | |
| /** True if this is controlled by a real player and has progressed far enough in initialization where additional input bindings can be added */ | |
| UE_API bool IsReadyToBindInputs() const; | |
| /** The name of the extension event sent via UGameFrameworkComponentManager when ability inputs are ready to bind */ | |
| static UE_API const FName NAME_BindInputsNow; | |
| /** The name of this component-implemented feature */ | |
| static UE_API const FName NAME_ActorFeatureName; | |
| //~ Begin IGameFrameworkInitStateInterface interface | |
| virtual FName GetFeatureName() const override { return NAME_ActorFeatureName; } | |
| UE_API virtual bool CanChangeInitState(UGameFrameworkComponentManager* Manager, FGameplayTag CurrentState, FGameplayTag DesiredState) const override; | |
| UE_API virtual void HandleChangeInitState(UGameFrameworkComponentManager* Manager, FGameplayTag CurrentState, FGameplayTag DesiredState) override; | |
| UE_API virtual void OnActorInitStateChanged(const FActorInitStateChangedParams& Params) override; | |
| UE_API virtual void CheckDefaultInitialization() override; | |
| //~ End IGameFrameworkInitStateInterface interface | |
| protected: | |
| UE_API virtual void OnRegister() override; | |
| UE_API virtual void BeginPlay() override; | |
| UE_API virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; | |
| UE_API virtual void InitializePlayerInput(UInputComponent* PlayerInputComponent); | |
| UE_API void Input_AbilityInputTagPressed(FGameplayTag InputTag); | |
| UE_API void Input_AbilityInputTagReleased(FGameplayTag InputTag); | |
| UE_API void Input_Move(const FInputActionValue& InputActionValue); | |
| UE_API void Input_LookMouse(const FInputActionValue& InputActionValue); | |
| UE_API void Input_LookStick(const FInputActionValue& InputActionValue); | |
| UE_API void Input_Crouch(const FInputActionValue& InputActionValue); | |
| UE_API void Input_AutoRun(const FInputActionValue& InputActionValue); | |
| UE_API TSubclassOf<ULyraCameraMode> DetermineCameraMode() const; | |
| protected: | |
| UPROPERTY(EditAnywhere) | |
| TArray<FInputMappingContextAndPriority> DefaultInputMappings; | |
| /** Camera mode set by an ability. */ | |
| UPROPERTY() | |
| TSubclassOf<ULyraCameraMode> AbilityCameraMode; | |
| /** Spec handle for the last ability to set a camera mode. */ | |
| FGameplayAbilitySpecHandle AbilityCameraModeOwningSpecHandle; | |
| /** True when player input bindings have been applied, will never be true for non - players */ | |
| bool bReadyToBindInputs; | |
| }; | |