Minor - Initialise le contrôleur et le pawn - V01.3.0

Initialise le contrôleur du joueur avec une caméra orthographique et la gestion des inputs, et initialise le pawn du joueur avec un mesh par défaut.

Ceci permet d'avoir un setup de base fonctionnel pour le joueur.
This commit is contained in:
2025-10-15 12:48:33 +02:00
parent 34a6fec411
commit 55a9234871
7 changed files with 147 additions and 42 deletions

View File

@@ -1,11 +1,18 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
// Include General Macros
#include "M4_CTP_Macros.h"
#define MESH_DEFAULT TEXT("SM_Cube.SM_Cube")
// Include necessary Unreal Engine headers
#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "InputAction.h"
#include "InputActionValue.h"
#include "InputMappingContext.h"
#include "Components/StaticMeshComponent.h"
#include "EnhancedInputComponent.h"
#include "EnhancedInputSubsystems.h"
@@ -26,21 +33,19 @@ public :
UStaticMeshComponent* GetMeshComponent() const { return MeshComponent; }
virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;
UPROPERTY(EditAnywhere, Category="centipede")
TObjectPtr<UInputAction> MoveAction;
protected:
virtual void BeginPlay() override;
private:
UPROPERTY(Category = "Centipede", VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
UPROPERTY(EditAnywhere,Category = "Centipede")
TObjectPtr<UStaticMeshComponent> MeshComponent;
void Move(const FInputActionValue& Value);
UPROPERTY(EditAnywhere, Category = "Centipede")
TSoftObjectPtr<UStaticMesh> DefaultMesh = \
TSoftObjectPtr<UStaticMesh>(FSoftObjectPath(FString(C_MESH_FOLDER) + MESH_DEFAULT));
UStaticMesh* LoadedMesh;
};