Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
- #pragma once
- #include "DemoCharacter.generated.h"
- UCLASS(config=Game)
- class ADemoCharacter : public ACharacter
- {
- GENERATED_UCLASS_BODY()
- virtual void Tick(float DeltaSeconds) OVERRIDE;
- /** Pawn mesh: 1st person view (arms; seen only by self) */
- UPROPERTY(VisibleDefaultsOnly, Category=Mesh)
- TSubobjectPtr<class USkeletalMeshComponent> Mesh1P;
- /** First person camera */
- UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
- TSubobjectPtr<class UCameraComponent> FirstPersonCameraComponent;
- /** 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;
- /** Gun muzzle's offset from the characters location */
- UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Gameplay)
- FVector GunOffset;
- /** Projectile class to spawn */
- UPROPERTY(EditDefaultsOnly, Category=Projectile)
- TSubclassOf<class ADemoProjectile> ProjectileClass;
- /** Sound to play each time we fire */
- UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Gameplay)
- USoundBase* FireSound;
- /** AnimMontage to play each time we fire */
- UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay)
- UAnimMontage* FireAnimation;
- protected:
- /** Handler for a touch input beginning. */
- void TouchStarted(const ETouchIndex::Type FingerIndex, const FVector Location);
- /** Fires a projectile. */
- void OnFire();
- /** Handles moving forward/backward */
- void MoveForward(float Val);
- /** Handles stafing movement, left and right */
- void MoveRight(float Val);
- /**
- * 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);
- protected:
- // APawn interface
- virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) OVERRIDE;
- // End of APawn interface
- /** Get actor derived from UsableActor currently looked at by the player */
- class AUsableActor* GetUsableInView();
- /* Max distance to use/focus on actors. */
- UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay)
- float MaxUseDistance;
- /* True only in first frame when focused on new usable actor. */
- bool bHasNewFocus;
- /* Actor derived from UsableActor currently in center-view. */
- AUsableActor* FocusedUsableActor;
- public:
- /** Use the actor currently in view (if derived from UsableActor) */
- UFUNCTION(BlueprintCallable, WithValidation, Server, Reliable, Category = PlayerAbility)
- virtual void Use();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement