Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. // Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
  2.  
  3. #pragma once
  4.  
  5. #include "CoreMinimal.h"
  6. #include "GameFramework/Character.h"
  7. #include "AbilitySystemInterface.h" //We added this
  8. #include "FANTaCharacter.generated.h"
  9.  
  10. UCLASS(config=Game)
  11. class AGameplayAbilitiesTutCharacter : public ACharacter, public IAbilitySystemInterface //We add this parent.
  12. {
  13. UAbilitySystemComponent* GetAbilitySystemComponent() const override //We add this function, overriding it from IAbilitySystemInterface.
  14. {
  15. return AbilitySystem;
  16. }
  17. };
  18. class AFANTaCharacter : public ACharacter
  19. {
  20. GENERATED_BODY()
  21.  
  22. /** Camera boom positioning the camera behind the character */
  23. UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
  24. class USpringArmComponent* CameraBoom;
  25.  
  26. /** Follow camera */
  27. UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
  28. class UCameraComponent* FollowCamera;
  29.  
  30. //Our ability system
  31. UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Abilities, meta = (AllowPrivateAccess = "true"))
  32. class UAbilitySystemComponent* AbilitySystem;
  33.  
  34. public:
  35. AFANTaCharacter();
  36.  
  37. /** Base turn rate, in deg/sec. Other scaling may affect final turn rate. */
  38. UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
  39. float BaseTurnRate;
  40.  
  41. /** Base look up/down rate, in deg/sec. Other scaling may affect final rate. */
  42. UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
  43. float BaseLookUpRate;
  44.  
  45. protected:
  46.  
  47. /** Resets HMD orientation in VR. */
  48. void OnResetVR();
  49.  
  50. /** Called for forwards/backward input */
  51. void MoveForward(float Value);
  52.  
  53. /** Called for side to side input */
  54. void MoveRight(float Value);
  55.  
  56. /**
  57. * Called via input to turn at a given rate.
  58. * @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
  59. */
  60. void TurnAtRate(float Rate);
  61.  
  62. /**
  63. * Called via input to turn look up/down at a given rate.
  64. * @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
  65. */
  66. void LookUpAtRate(float Rate);
  67.  
  68. /** Handler for when a touch input begins. */
  69. void TouchStarted(ETouchIndex::Type FingerIndex, FVector Location);
  70.  
  71. /** Handler for when a touch input stops. */
  72. void TouchStopped(ETouchIndex::Type FingerIndex, FVector Location);
  73.  
  74. protected:
  75. // APawn interface
  76. virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
  77. // End of APawn interface
  78.  
  79. public:
  80. /** Returns CameraBoom subobject **/
  81. FORCEINLINE class USpringArmComponent* GetCameraBoom() const { return CameraBoom; }
  82. /** Returns FollowCamera subobject **/
  83. FORCEINLINE class UCameraComponent* GetFollowCamera() const { return FollowCamera; }
  84. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement