Download LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGlobalAbilitySystem.h from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 2.44 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGlobalAbilitySystem.h
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGlobalAbilitySystem.h
-
curl -L -o LyraGlobalAbilitySystem.h https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGlobalAbilitySystem.h
2.44 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| class UGameplayAbility; | |
| class UGameplayEffect; | |
| class ULyraAbilitySystemComponent; | |
| class UObject; | |
| struct FActiveGameplayEffectHandle; | |
| struct FFrame; | |
| struct FGameplayAbilitySpecHandle; | |
| USTRUCT() | |
| struct FGlobalAppliedAbilityList | |
| { | |
| GENERATED_BODY() | |
| UPROPERTY() | |
| TMap<TObjectPtr<ULyraAbilitySystemComponent>, FGameplayAbilitySpecHandle> Handles; | |
| void AddToASC(TSubclassOf<UGameplayAbility> Ability, ULyraAbilitySystemComponent* ASC); | |
| void RemoveFromASC(ULyraAbilitySystemComponent* ASC); | |
| void RemoveFromAll(); | |
| }; | |
| USTRUCT() | |
| struct FGlobalAppliedEffectList | |
| { | |
| GENERATED_BODY() | |
| UPROPERTY() | |
| TMap<TObjectPtr<ULyraAbilitySystemComponent>, FActiveGameplayEffectHandle> Handles; | |
| void AddToASC(TSubclassOf<UGameplayEffect> Effect, ULyraAbilitySystemComponent* ASC); | |
| void RemoveFromASC(ULyraAbilitySystemComponent* ASC); | |
| void RemoveFromAll(); | |
| }; | |
| UCLASS() | |
| class ULyraGlobalAbilitySystem : public UWorldSubsystem | |
| { | |
| GENERATED_BODY() | |
| public: | |
| ULyraGlobalAbilitySystem(); | |
| UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category="Lyra") | |
| void ApplyAbilityToAll(TSubclassOf<UGameplayAbility> Ability); | |
| UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category="Lyra") | |
| void ApplyEffectToAll(TSubclassOf<UGameplayEffect> Effect); | |
| UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category = "Lyra") | |
| void RemoveAbilityFromAll(TSubclassOf<UGameplayAbility> Ability); | |
| UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category = "Lyra") | |
| void RemoveEffectFromAll(TSubclassOf<UGameplayEffect> Effect); | |
| /** Register an ASC with global system and apply any active global effects/abilities. */ | |
| void RegisterASC(ULyraAbilitySystemComponent* ASC); | |
| /** Removes an ASC from the global system, along with any active global effects/abilities. */ | |
| void UnregisterASC(ULyraAbilitySystemComponent* ASC); | |
| private: | |
| UPROPERTY() | |
| TMap<TSubclassOf<UGameplayAbility>, FGlobalAppliedAbilityList> AppliedAbilities; | |
| UPROPERTY() | |
| TMap<TSubclassOf<UGameplayEffect>, FGlobalAppliedEffectList> AppliedEffects; | |
| UPROPERTY() | |
| TArray<TObjectPtr<ULyraAbilitySystemComponent>> RegisteredASCs; | |
| }; | |