77 lines
2.5 KiB
C++
77 lines
2.5 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "GameFramework/Character.h"
|
|
#include "InputActionValue.h"
|
|
#include "CombatCharacter.generated.h"
|
|
|
|
|
|
UCLASS(config=Game)
|
|
class ACombatCharacter : public ACharacter
|
|
{
|
|
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;
|
|
|
|
/** MappingContext */
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
|
|
class UInputMappingContext* DefaultMappingContext;
|
|
|
|
/** Jump Input Action */
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
|
|
class UInputAction* JumpAction;
|
|
|
|
/** Move Input Action */
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
|
|
class UInputAction* MoveAction;
|
|
|
|
/** Look Input Action */
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
|
|
class UInputAction* LookAction;
|
|
|
|
/* Interact Input Action */
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
|
|
class UInputAction* InteractAction;
|
|
|
|
/* ToggleCombat Input Action */
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
|
|
class UInputAction* ToggleCombatAction;
|
|
public:
|
|
ACombatCharacter();
|
|
|
|
protected:
|
|
/** Called for movement input */
|
|
void Move(const FInputActionValue& Value);
|
|
|
|
/** Called for looking input */
|
|
void Look(const FInputActionValue& Value);
|
|
|
|
void Interact(const FInputActionValue& Value);
|
|
void ToggleCombat(const FInputActionValue& Value);
|
|
protected:
|
|
// APawn interface
|
|
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
|
|
|
// To add mapping context
|
|
virtual void BeginPlay();
|
|
|
|
public:
|
|
/** Returns CameraBoom subobject **/
|
|
FORCEINLINE class USpringArmComponent* GetCameraBoom() const { return CameraBoom; }
|
|
/** Returns FollowCamera subobject **/
|
|
FORCEINLINE class UCameraComponent* GetFollowCamera() const { return FollowCamera; }
|
|
|
|
public:
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category="Components", meta=(AllowPrivateAccess="true"))
|
|
TObjectPtr<class UCombatComponent> CombatComponent;
|
|
};
|
|
|