Download LyraStarterGame/Source/LyraGame/Character/LyraCharacterWithAbilities.cpp from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 1.54 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Character/LyraCharacterWithAbilities.cpp
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/Character/LyraCharacterWithAbilities.cpp
-
curl -L -o LyraCharacterWithAbilities.cpp https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Character/LyraCharacterWithAbilities.cpp
1.54 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| ALyraCharacterWithAbilities::ALyraCharacterWithAbilities(const FObjectInitializer& ObjectInitializer) | |
| : Super(ObjectInitializer) | |
| { | |
| AbilitySystemComponent = ObjectInitializer.CreateDefaultSubobject<ULyraAbilitySystemComponent>(this, TEXT("AbilitySystemComponent")); | |
| AbilitySystemComponent->SetIsReplicated(true); | |
| AbilitySystemComponent->SetReplicationMode(EGameplayEffectReplicationMode::Mixed); | |
| // These attribute sets will be detected by AbilitySystemComponent::InitializeComponent. Keeping a reference so that the sets don't get garbage collected before that. | |
| HealthSet = CreateDefaultSubobject<ULyraHealthSet>(TEXT("HealthSet")); | |
| CombatSet = CreateDefaultSubobject<ULyraCombatSet>(TEXT("CombatSet")); | |
| // AbilitySystemComponent needs to be updated at a high frequency. | |
| SetNetUpdateFrequency(100.0f); | |
| } | |
| void ALyraCharacterWithAbilities::PostInitializeComponents() | |
| { | |
| Super::PostInitializeComponents(); | |
| check(AbilitySystemComponent); | |
| AbilitySystemComponent->InitAbilityActorInfo(this, this); | |
| } | |
| UAbilitySystemComponent* ALyraCharacterWithAbilities::GetAbilitySystemComponent() const | |
| { | |
| return AbilitySystemComponent; | |
| } | |