89 lines
2.6 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "InputActionValue.h"
#include "GameFramework/Character.h"
#include "ProjectFish/Definations.h"
#include "Shipbase.generated.h"
UCLASS(PrioritizeCategories = Config)
class PROJECTFISH_API AShipbase : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this character's properties
AShipbase();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
virtual void NotifyControllerChanged() override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;
UFUNCTION()
void OnOverlapWall(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);
protected:
/** Called for movement input */
void Move(const FInputActionValue& Value);
/** Called for looking input */
void Look(const FInputActionValue& Value);
void SprintMove();
void StopSprintMove();
/*** ApplyConfig ***/
void ApplyShipSize();
void ApplyMovementSettings();
void ApplyCameraSettings();
protected:
UPROPERTY(EditAnywhere,BlueprintReadOnly, Category= "Config", meta = (AllowPrivateAccess = "true"))
FShipDataConfig ShipData;
UPROPERTY(VisibleAnywhere,BlueprintReadOnly, Category = Ship, meta = ( AllowPrivateAccess = "true"))
class UStaticMeshComponent* ShipMesh;
/***Camera***/
UPROPERTY(VisibleAnywhere,BlueprintReadOnly, Category = Camera, meta = ( AllowPrivateAccess = "true"))
class UShipSpringArmComponent* CameraBoom;
UPROPERTY(VisibleAnywhere,BlueprintReadOnly, Category = Camera, meta = ( AllowPrivateAccess = "true"))
class UCameraComponent* FollowCamera;
/***Input***/
/** MappingContext */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
class UInputMappingContext* DefaultMappingContext;
/** Sprint Move Input Action */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Input, meta = (AllowPrivateAccess = "true"))
class UInputAction* SprintAction;
/** 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;
};