Download LyraStarterGame/Source/LyraGame/GameModes/LyraExperienceDefinition.cpp from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 2.35 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/GameModes/LyraExperienceDefinition.cpp
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/GameModes/LyraExperienceDefinition.cpp
-
curl -L -o LyraExperienceDefinition.cpp https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/GameModes/LyraExperienceDefinition.cpp
2.35 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| ULyraExperienceDefinition::ULyraExperienceDefinition() | |
| { | |
| } | |
| EDataValidationResult ULyraExperienceDefinition::IsDataValid(FDataValidationContext& Context) const | |
| { | |
| EDataValidationResult Result = CombineDataValidationResults(Super::IsDataValid(Context), EDataValidationResult::Valid); | |
| int32 EntryIndex = 0; | |
| for (const UGameFeatureAction* Action : Actions) | |
| { | |
| if (Action) | |
| { | |
| EDataValidationResult ChildResult = Action->IsDataValid(Context); | |
| Result = CombineDataValidationResults(Result, ChildResult); | |
| } | |
| else | |
| { | |
| Result = EDataValidationResult::Invalid; | |
| Context.AddError(FText::Format(LOCTEXT("ActionEntryIsNull", "Null entry at index {0} in Actions"), FText::AsNumber(EntryIndex))); | |
| } | |
| ++EntryIndex; | |
| } | |
| // Make sure users didn't subclass from a BP of this (it's fine and expected to subclass once in BP, just not twice) | |
| if (!GetClass()->IsNative()) | |
| { | |
| const UClass* ParentClass = GetClass()->GetSuperClass(); | |
| // Find the native parent | |
| const UClass* FirstNativeParent = ParentClass; | |
| while ((FirstNativeParent != nullptr) && !FirstNativeParent->IsNative()) | |
| { | |
| FirstNativeParent = FirstNativeParent->GetSuperClass(); | |
| } | |
| if (FirstNativeParent != ParentClass) | |
| { | |
| Context.AddError(FText::Format(LOCTEXT("ExperienceInheritenceIsUnsupported", "Blueprint subclasses of Blueprint experiences is not currently supported (use composition via ActionSets instead). Parent class was {0} but should be {1}."), | |
| FText::AsCultureInvariant(GetPathNameSafe(ParentClass)), | |
| FText::AsCultureInvariant(GetPathNameSafe(FirstNativeParent)) | |
| )); | |
| Result = EDataValidationResult::Invalid; | |
| } | |
| } | |
| return Result; | |
| } | |
| void ULyraExperienceDefinition::UpdateAssetBundleData() | |
| { | |
| Super::UpdateAssetBundleData(); | |
| for (UGameFeatureAction* Action : Actions) | |
| { | |
| if (Action) | |
| { | |
| Action->AddAdditionalAssetBundleData(AssetBundleData); | |
| } | |
| } | |
| } | |