Updated some data types

This commit is contained in:
TjgL 2025-01-22 16:10:41 +01:00
parent 156becc36c
commit 5524705f60
5 changed files with 28 additions and 23 deletions

View File

@ -17,8 +17,8 @@ ALMPlayer::ALMPlayer()
Camera->bUsePawnControlRotation = true;
Camera->SetRelativeLocation(FVector(20, 0, 90));
WeaponSkeletalMeshComponent = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Weapon Mesh"));
WeaponSkeletalMeshComponent->SetupAttachment(Camera);
ArmsMesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Arms Mesh"));
ArmsMesh->SetupAttachment(Camera);
}
// Called when the game starts or when spawned
@ -48,16 +48,15 @@ void ALMPlayer::SetWeaponManager(ULMWeaponManager* Manager)
}
WeaponManager = Manager;
WeaponManager->Initialize(WeaponSkeletalMeshComponent);
WeaponManager->Initialize(ArmsMesh);
}
// Called every frame
void ALMPlayer::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
// Called to bind functionality to input
void ALMPlayer::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);

View File

@ -37,12 +37,12 @@ public:
void SetWeaponManager(ULMWeaponManager* Manager);
private:
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Legumix", meta = (AllowPrivateAccess = true))
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true))
TObjectPtr<ULMWeaponManager> WeaponManager;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Legumix", meta = (AllowPrivateAccess = true))
TObjectPtr<USkeletalMeshComponent> WeaponSkeletalMeshComponent;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true))
TObjectPtr<USkeletalMeshComponent> ArmsMesh;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Legumix", meta = (AllowPrivateAccess = true))
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true))
TObjectPtr<UCameraComponent> Camera;
};

View File

@ -3,17 +3,12 @@
#pragma once
#include "CoreMinimal.h"
#include "LMAmmoType.h"
#include "GameFramework/Actor.h"
#include "LMAmmo.generated.h"
class USphereComponent;
UENUM(BlueprintType)
enum class EAmmoType : uint8
{
EAT_RadishAmmo UMETA(DisplayName = "Radish Ammo"),
EAT_CornAmmo UMETA(DisplayName = "Corn Ammo")
};
UCLASS()
class LEGUMEMIX_API ALMAmmo : public AActor

View File

@ -0,0 +1,8 @@
#pragma once
UENUM(BlueprintType)
enum class EAmmoType : uint8
{
EAT_RadishAmmo UMETA(DisplayName = "Radish Ammo"),
EAT_CornAmmo UMETA(DisplayName = "Corn Ammo")
};

View File

@ -1,6 +1,4 @@
#pragma once
#include "AnimationBlueprintEditorSettings.h"
#include "LMAmmo.h"
#include "LMWeaponDataStructure.generated.h"
USTRUCT(BlueprintType)
@ -8,18 +6,23 @@ struct FLMWeaponDataStructure : public FTableRowBase
{
GENERATED_BODY()
/** Max ammo in inventory */
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int MaxAmmo; // Max ammo in "inventory"
int MaxAmmo;
/** Max ammo in clip. */
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int MaxClipAmmo; // Max ammo in clip
int MaxClipAmmo;
/** Mesh of the weapon display in the scene. */
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TObjectPtr<USkeletalMesh> MeshWeapon; //Mesh of the weapon display in the scene
TObjectPtr<USkeletalMesh> MeshWeapon;
/** The animation blueprint to animate the mesh. */
UPROPERTY(EditAnywhere, BlueprintReadWrite)
EAmmoType AmmoType; //Type of ammo, which ammo this weapon is using
TObjectPtr<UAnimBlueprint> AnimationBluePrint;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TObjectPtr<UAnimBlueprint> AnimationBluePrint; //The animation blueprint to animate the mesh
/** The sound to play when firing. */
UPROPERTY(EditAnywhere, BlueprintReadWrite,Category=Legumix)
TObjectPtr<USoundWave> FireSound;
};