Download LyraStarterGame/Source/LyraGame/Inventory/InventoryFragment_SetStats.cpp from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 609 Bytes
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Inventory/InventoryFragment_SetStats.cpp
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/Inventory/InventoryFragment_SetStats.cpp
-
curl -L -o InventoryFragment_SetStats.cpp https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Inventory/InventoryFragment_SetStats.cpp
609 Bytes
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| void UInventoryFragment_SetStats::OnInstanceCreated(ULyraInventoryItemInstance* Instance) const | |
| { | |
| for (const auto& KVP : InitialItemStats) | |
| { | |
| Instance->AddStatTagStack(KVP.Key, KVP.Value); | |
| } | |
| } | |
| int32 UInventoryFragment_SetStats::GetItemStatByTag(FGameplayTag Tag) const | |
| { | |
| if (const int32* StatPtr = InitialItemStats.Find(Tag)) | |
| { | |
| return *StatPtr; | |
| } | |
| return 0; | |
| } | |