Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Copyright Epic Games, Inc. All Rights Reserved.
- #pragma once
- #include "CoreMinimal.h"
- #include "GameFramework/Character.h"
- #include "AbilitySystemInterface.h"
- #include <GameplayEffectTypes.h>
- #include "GASAbilitySystemComponent.h"
- #include "GASAttributeSet.h"
- #include "GASCharacter.generated.h"
- UCLASS(config=Game)
- class AGASCharacter : public ACharacter, public IAbilitySystemInterface
- {
- GENERATED_BODY()
- /** Camera boom positioning the camera behind the character */
- UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
- class USpringArmComponent* CameraBoom;
- /** Follow camera */
- UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
- class UCameraComponent* FollowCamera;
- UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
- class UGASAbilitySystemComponent* AbilitySystemComponent;
- UPROPERTY()
- class UGASAttributeSet* Attributes;
- public:
- AGASCharacter();
- /** Base turn rate, in deg/sec. Other scaling may affect final turn rate. */
- UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
- float BaseTurnRate;
- /** Base look up/down rate, in deg/sec. Other scaling may affect final rate. */
- UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
- float BaseLookUpRate;
- virtual class UAbilitySystemComponent* GetAbilitySystemComponent() const override;
- virtual void InitializeAttributes();
- virtual void GiveAbilities();
- virtual void PossessedBy(AController* NewController) override;
- virtual void OnRep_PlayerState() override;
- /**Effect that initialises our default attributes. */
- UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category = "GAS")
- TSubclassOf<class UGameplayEffect> DefaultAttributeEffect;
- /**Effect that initialises our default attributes. */
- UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category = "GAS")
- TArray<TSubclassOf<class UGASGameplayAbility>> DefaultAbilities;
- protected:
- /** Resets HMD orientation in VR. */
- void OnResetVR();
- /** Called for forwards/backward input */
- void MoveForward(float Value);
- /** Called for side to side input */
- void MoveRight(float Value);
- /**
- * Called via input to turn at a given rate.
- * @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
- */
- void TurnAtRate(float Rate);
- /**
- * Called via input to turn look up/down at a given rate.
- * @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
- */
- void LookUpAtRate(float Rate);
- /** Handler for when a touch input begins. */
- void TouchStarted(ETouchIndex::Type FingerIndex, FVector Location);
- /** Handler for when a touch input stops. */
- void TouchStopped(ETouchIndex::Type FingerIndex, FVector Location);
- protected:
- // APawn interface
- virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
- // End of APawn interface
- public:
- /** Returns CameraBoom subobject **/
- FORCEINLINE class USpringArmComponent* GetCameraBoom() const { return CameraBoom; }
- /** Returns FollowCamera subobject **/
- FORCEINLINE class UCameraComponent* GetFollowCamera() const { return FollowCamera; }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement