SHARE
TWEET

Untitled

a guest May 30th, 2014 249 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
  2. #pragma once
  3.  
  4. #include "DemoCharacter.generated.h"
  5.  
  6. UCLASS(config=Game)
  7. class ADemoCharacter : public ACharacter
  8. {
  9.         GENERATED_UCLASS_BODY()
  10.  
  11.         virtual void Tick(float DeltaSeconds) OVERRIDE;
  12.  
  13.         /** Pawn mesh: 1st person view (arms; seen only by self) */
  14.         UPROPERTY(VisibleDefaultsOnly, Category=Mesh)
  15.         TSubobjectPtr<class USkeletalMeshComponent> Mesh1P;
  16.  
  17.         /** First person camera */
  18.         UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
  19.         TSubobjectPtr<class UCameraComponent> FirstPersonCameraComponent;
  20.  
  21.         /** Base turn rate, in deg/sec. Other scaling may affect final turn rate. */
  22.         UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
  23.         float BaseTurnRate;
  24.  
  25.         /** Base look up/down rate, in deg/sec. Other scaling may affect final rate. */
  26.         UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
  27.         float BaseLookUpRate;
  28.  
  29.         /** Gun muzzle's offset from the characters location */
  30.         UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Gameplay)
  31.         FVector GunOffset;
  32.  
  33.         /** Projectile class to spawn */
  34.         UPROPERTY(EditDefaultsOnly, Category=Projectile)
  35.         TSubclassOf<class ADemoProjectile> ProjectileClass;
  36.  
  37.         /** Sound to play each time we fire */
  38.         UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Gameplay)
  39.         USoundBase* FireSound;
  40.  
  41.         /** AnimMontage to play each time we fire */
  42.         UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay)
  43.         UAnimMontage* FireAnimation;
  44.  
  45. protected:
  46.  
  47.         /** Handler for a touch input beginning. */
  48.         void TouchStarted(const ETouchIndex::Type FingerIndex, const FVector Location);
  49.  
  50.         /** Fires a projectile. */
  51.         void OnFire();
  52.  
  53.         /** Handles moving forward/backward */
  54.         void MoveForward(float Val);
  55.  
  56.         /** Handles stafing movement, left and right */
  57.         void MoveRight(float Val);
  58.  
  59.         /**
  60.          * Called via input to turn at a given rate.
  61.          * @param Rate  This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
  62.          */
  63.         void TurnAtRate(float Rate);
  64.  
  65.         /**
  66.          * Called via input to turn look up/down at a given rate.
  67.          * @param Rate  This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
  68.          */
  69.         void LookUpAtRate(float Rate);
  70.  
  71. protected:
  72.         // APawn interface
  73.         virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) OVERRIDE;
  74.         // End of APawn interface
  75.  
  76.         /** Get actor derived from UsableActor currently looked at by the player */
  77.         class AUsableActor* GetUsableInView();
  78.  
  79.         /* Max distance to use/focus on actors. */
  80.         UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay)
  81.                 float MaxUseDistance;
  82.  
  83.         /* True only in first frame when focused on new usable actor. */
  84.         bool bHasNewFocus;
  85.  
  86.         /* Actor derived from UsableActor currently in center-view. */
  87.         AUsableActor* FocusedUsableActor;
  88.  
  89. public:
  90.  
  91.         /** Use the actor currently in view (if derived from UsableActor) */
  92.         UFUNCTION(BlueprintCallable, WithValidation, Server, Reliable, Category = PlayerAbility)
  93.                 virtual void Use();
  94. };
RAW Paste Data
Top