Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
- #pragma once
- #include "GameFramework/Character.h"
- #include "TwinStickCPawn.generated.h"
- UCLASS(Blueprintable)
- class ATwinStickCPawn : public APawn
- {
- GENERATED_BODY()
- /* The mesh component */
- UPROPERTY(Category = Mesh, VisibleDefaultsOnly, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
- class UStaticMeshComponent* ShipMeshComponent;
- /** The camera */
- UPROPERTY(Category = Camera, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
- class UCameraComponent* CameraComponent;
- /** Camera boom positioning the camera above the character */
- UPROPERTY(Category = Camera, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
- class USpringArmComponent* CameraBoom;
- public:
- ATwinStickCPawn(const FObjectInitializer& ObjectInitializer);
- /** Offset from the ships location to spawn projectiles */
- UPROPERTY(Category = Gameplay, EditAnywhere, BlueprintReadWrite )
- FVector GunOffset;
- /* How fast the weapon will fire */
- UPROPERTY(Category = Gameplay, EditAnywhere, BlueprintReadWrite)
- float FireRate;
- /* The speed our ship moves around the level */
- UPROPERTY(Category = Gameplay, EditAnywhere, BlueprintReadWrite)
- float MoveSpeed;
- /** Sound to play each time we fire */
- UPROPERTY(Category = Audio, EditAnywhere, BlueprintReadWrite)
- class USoundBase* FireSound;
- UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = JumpyFrogs)
- TSubclassOf<class AActor> BlueprintVar;
- // Begin Actor Interface
- virtual void Tick(float DeltaSeconds) override;
- virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override;
- // End Actor Interface
- /* Fire a shot in the specified direction */
- void FireShot(FVector FireDirection);
- /* Handler for the fire timer expiry */
- void ShotTimerExpired();
- // Static names for axis bindings
- static const FName MoveForwardBinding;
- static const FName MoveRightBinding;
- static const FName FireForwardBinding;
- static const FName FireRightBinding;
- private:
- /* Flag to control firing */
- uint32 bCanFire : 1;
- /** Handle for efficient management of ShotTimerExpired timer */
- FTimerHandle TimerHandle_ShotTimerExpired;
- public:
- /** Returns ShipMeshComponent subobject **/
- FORCEINLINE class UStaticMeshComponent* GetShipMeshComponent() const { return ShipMeshComponent; }
- /** Returns CameraComponent subobject **/
- FORCEINLINE class UCameraComponent* GetCameraComponent() const { return CameraComponent; }
- /** Returns CameraBoom subobject **/
- FORCEINLINE class USpringArmComponent* GetCameraBoom() const { return CameraBoom; }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement