RSExampleCharacter.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 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "CoreMinimal.h" |
| 7 | #include "AbilitySystemInterface.h" |
| 8 | #include "GameFramework/Character.h" |
| 9 | #include "RSExampleCharacter.generated.h" |
| 10 | |
| 11 | class UAbilitySystemComponent; |
| 12 | class UGameplayAbility; |
| 13 | |
| 14 | UCLASS() |
| 15 | class ARSExampleCharacter : public ACharacter, public IAbilitySystemInterface |
| 16 | { |
| 17 | GENERATED_BODY() |
| 18 | |
| 19 | public: |
| 20 | virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override; |
| 21 | |
| 22 | // Server: the controller possessed this pawn. |
| 23 | virtual void PossessedBy(AController* NewController) override; |
| 24 | |
| 25 | // Owning client and simulated proxies: the PlayerState pointer arrived. |
| 26 | virtual void OnRep_PlayerState() override; |
| 27 | |
| 28 | protected: |
| 29 | UPROPERTY(EditDefaultsOnly, Category = "Abilities") |
| 30 | TArray<TSubclassOf<UGameplayAbility>> StartupAbilities; |
| 31 | |
| 32 | private: |
| 33 | void InitAbilityActorInfo(); |
| 34 | void GrantStartupAbilities(); |
| 35 | }; |