Download LyraStarterGame/Source/LyraGame/Player/LyraPlayerSpawningManagerComponent.h from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 2.17 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Player/LyraPlayerSpawningManagerComponent.h
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/Player/LyraPlayerSpawningManagerComponent.h
-
curl -L -o LyraPlayerSpawningManagerComponent.h https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Player/LyraPlayerSpawningManagerComponent.h
2.17 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| class AController; | |
| class APlayerController; | |
| class APlayerState; | |
| class APlayerStart; | |
| class ALyraPlayerStart; | |
| class AActor; | |
| /** | |
| * @class ULyraPlayerSpawningManagerComponent | |
| */ | |
| UCLASS(MinimalAPI) | |
| class ULyraPlayerSpawningManagerComponent : public UGameStateComponent | |
| { | |
| GENERATED_BODY() | |
| public: | |
| UE_API ULyraPlayerSpawningManagerComponent(const FObjectInitializer& ObjectInitializer); | |
| /** UActorComponent */ | |
| UE_API virtual void InitializeComponent() override; | |
| UE_API virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; | |
| /** ~UActorComponent */ | |
| protected: | |
| // Utility | |
| UE_API APlayerStart* GetFirstRandomUnoccupiedPlayerStart(AController* Controller, const TArray<ALyraPlayerStart*>& FoundStartPoints) const; | |
| virtual AActor* OnChoosePlayerStart(AController* Player, TArray<ALyraPlayerStart*>& PlayerStarts) { return nullptr; } | |
| virtual void OnFinishRestartPlayer(AController* Player, const FRotator& StartRotation) { } | |
| UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName=OnFinishRestartPlayer)) | |
| UE_API void K2_OnFinishRestartPlayer(AController* Player, const FRotator& StartRotation); | |
| private: | |
| /** We proxy these calls from ALyraGameMode, to this component so that each experience can more easily customize the respawn system they want. */ | |
| UE_API AActor* ChoosePlayerStart(AController* Player); | |
| UE_API bool ControllerCanRestart(AController* Player); | |
| UE_API void FinishRestartPlayer(AController* NewPlayer, const FRotator& StartRotation); | |
| friend class ALyraGameMode; | |
| /** ~ALyraGameMode */ | |
| UPROPERTY(Transient) | |
| TArray<TWeakObjectPtr<ALyraPlayerStart>> CachedPlayerStarts; | |
| private: | |
| UE_API void OnLevelAdded(ULevel* InLevel, UWorld* InWorld); | |
| UE_API void HandleOnActorSpawned(AActor* SpawnedActor); | |
| UE_API APlayerStart* FindPlayFromHereStart(AController* Player); | |
| }; | |