Download LyraStarterGame/Source/LyraGame/UI/Weapons/LyraWeaponUserInterface.cpp from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 1.41 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/UI/Weapons/LyraWeaponUserInterface.cpp
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/UI/Weapons/LyraWeaponUserInterface.cpp
-
curl -L -o LyraWeaponUserInterface.cpp https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/UI/Weapons/LyraWeaponUserInterface.cpp
1.41 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| struct FGeometry; | |
| ULyraWeaponUserInterface::ULyraWeaponUserInterface(const FObjectInitializer& ObjectInitializer) | |
| : Super(ObjectInitializer) | |
| { | |
| } | |
| void ULyraWeaponUserInterface::NativeConstruct() | |
| { | |
| Super::NativeConstruct(); | |
| } | |
| void ULyraWeaponUserInterface::NativeDestruct() | |
| { | |
| Super::NativeDestruct(); | |
| } | |
| void ULyraWeaponUserInterface::NativeTick(const FGeometry& MyGeometry, float InDeltaTime) | |
| { | |
| Super::NativeTick(MyGeometry, InDeltaTime); | |
| if (APawn* Pawn = GetOwningPlayerPawn()) | |
| { | |
| if (ULyraEquipmentManagerComponent* EquipmentManager = Pawn->FindComponentByClass<ULyraEquipmentManagerComponent>()) | |
| { | |
| if (ULyraWeaponInstance* NewInstance = EquipmentManager->GetFirstInstanceOfType<ULyraWeaponInstance>()) | |
| { | |
| if (NewInstance != CurrentInstance && NewInstance->GetInstigator() != nullptr) | |
| { | |
| ULyraWeaponInstance* OldWeapon = CurrentInstance; | |
| CurrentInstance = NewInstance; | |
| RebuildWidgetFromWeapon(); | |
| OnWeaponChanged(OldWeapon, CurrentInstance); | |
| } | |
| } | |
| } | |
| } | |
| } | |
| void ULyraWeaponUserInterface::RebuildWidgetFromWeapon() | |
| { | |
| } | |