Download LyraStarterGame/Source/LyraGame/UI/LyraHUD.cpp from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 2 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/UI/LyraHUD.cpp
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/UI/LyraHUD.cpp
-
curl -L -o LyraHUD.cpp https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/UI/LyraHUD.cpp
2 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| class AActor; | |
| class UWorld; | |
| ////////////////////////////////////////////////////////////////////// | |
| // ALyraHUD | |
| ALyraHUD::ALyraHUD(const FObjectInitializer& ObjectInitializer) | |
| : Super(ObjectInitializer) | |
| { | |
| PrimaryActorTick.bStartWithTickEnabled = false; | |
| } | |
| void ALyraHUD::PreInitializeComponents() | |
| { | |
| Super::PreInitializeComponents(); | |
| UGameFrameworkComponentManager::AddGameFrameworkComponentReceiver(this); | |
| } | |
| void ALyraHUD::BeginPlay() | |
| { | |
| UGameFrameworkComponentManager::SendGameFrameworkComponentExtensionEvent(this, UGameFrameworkComponentManager::NAME_GameActorReady); | |
| Super::BeginPlay(); | |
| } | |
| void ALyraHUD::EndPlay(const EEndPlayReason::Type EndPlayReason) | |
| { | |
| UGameFrameworkComponentManager::RemoveGameFrameworkComponentReceiver(this); | |
| Super::EndPlay(EndPlayReason); | |
| } | |
| void ALyraHUD::GetDebugActorList(TArray<AActor*>& InOutList) | |
| { | |
| UWorld* World = GetWorld(); | |
| Super::GetDebugActorList(InOutList); | |
| // Add all actors with an ability system component. | |
| for (TObjectIterator<UAbilitySystemComponent> It; It; ++It) | |
| { | |
| if (UAbilitySystemComponent* ASC = *It) | |
| { | |
| if (!ASC->HasAnyFlags(RF_ClassDefaultObject | RF_ArchetypeObject)) | |
| { | |
| AActor* AvatarActor = ASC->GetAvatarActor(); | |
| AActor* OwnerActor = ASC->GetOwnerActor(); | |
| if (AvatarActor && UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(AvatarActor)) | |
| { | |
| AddActorToDebugList(AvatarActor, InOutList, World); | |
| } | |
| else if (OwnerActor && UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(OwnerActor)) | |
| { | |
| AddActorToDebugList(OwnerActor, InOutList, World); | |
| } | |
| } | |
| } | |
| } | |
| } | |