RSExamplePlayerState.h
Click a line number to link it. Shift-click to select a range.
| 1 | // Copyright (c) 2026 Reignance Studios. MIT License, see LICENSE. |
| 2 | // Example only: copy into your game module and rename the RSExample prefix. |
| 3 | // Tutorial: https://reignancestudios.com/tutorial-gas-asc-on-playerstate |
| 4 | |
| 5 | #pragma once |
| 6 | |
| 7 | #include "CoreMinimal.h" |
| 8 | #include "AbilitySystemInterface.h" |
| 9 | #include "GameFramework/PlayerState.h" |
| 10 | #include "RSExamplePlayerState.generated.h" |
| 11 | |
| 12 | class UAbilitySystemComponent; |
| 13 | class URSExampleAttributeSet; |
| 14 | |
| 15 | UCLASS() |
| 16 | class ARSExamplePlayerState : public APlayerState, public IAbilitySystemInterface |
| 17 | { |
| 18 | GENERATED_BODY() |
| 19 | |
| 20 | public: |
| 21 | ARSExamplePlayerState(); |
| 22 | |
| 23 | virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override { return AbilitySystem; } |
| 24 | |
| 25 | protected: |
| 26 | // The ASC lives here so abilities, effects and attributes survive pawn death and respawn. |
| 27 | UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Abilities") |
| 28 | TObjectPtr<UAbilitySystemComponent> AbilitySystem; |
| 29 | |
| 30 | UPROPERTY() |
| 31 | TObjectPtr<URSExampleAttributeSet> Attributes; |
| 32 | }; |