diff --git a/Source/LegumeMix/Private/Player/LMPlayer.cpp b/Source/LegumeMix/Private/Player/LMPlayer.cpp index b3b65f5..b32b23e 100644 --- a/Source/LegumeMix/Private/Player/LMPlayer.cpp +++ b/Source/LegumeMix/Private/Player/LMPlayer.cpp @@ -17,8 +17,8 @@ ALMPlayer::ALMPlayer() Camera->bUsePawnControlRotation = true; Camera->SetRelativeLocation(FVector(20, 0, 90)); - WeaponSkeletalMeshComponent = CreateDefaultSubobject(TEXT("Weapon Mesh")); - WeaponSkeletalMeshComponent->SetupAttachment(Camera); + ArmsMesh = CreateDefaultSubobject(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); diff --git a/Source/LegumeMix/Public/Player/LMPlayer.h b/Source/LegumeMix/Public/Player/LMPlayer.h index 4027c1b..510b8c2 100644 --- a/Source/LegumeMix/Public/Player/LMPlayer.h +++ b/Source/LegumeMix/Public/Player/LMPlayer.h @@ -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 WeaponManager; - UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Legumix", meta = (AllowPrivateAccess = true)) - TObjectPtr WeaponSkeletalMeshComponent; + UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true)) + TObjectPtr ArmsMesh; - UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Legumix", meta = (AllowPrivateAccess = true)) + UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true)) TObjectPtr Camera; }; diff --git a/Source/LegumeMix/Public/Weapon/LMAmmo.h b/Source/LegumeMix/Public/Weapon/LMAmmo.h index d397a72..a799d5a 100644 --- a/Source/LegumeMix/Public/Weapon/LMAmmo.h +++ b/Source/LegumeMix/Public/Weapon/LMAmmo.h @@ -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 diff --git a/Source/LegumeMix/Public/Weapon/LMAmmoType.h b/Source/LegumeMix/Public/Weapon/LMAmmoType.h new file mode 100644 index 0000000..3d84e1d --- /dev/null +++ b/Source/LegumeMix/Public/Weapon/LMAmmoType.h @@ -0,0 +1,8 @@ +#pragma once + +UENUM(BlueprintType) +enum class EAmmoType : uint8 +{ + EAT_RadishAmmo UMETA(DisplayName = "Radish Ammo"), + EAT_CornAmmo UMETA(DisplayName = "Corn Ammo") +}; \ No newline at end of file diff --git a/Source/LegumeMix/Public/Weapon/LMWeaponDataStructure.h b/Source/LegumeMix/Public/Weapon/LMWeaponDataStructure.h index 033939a..0572676 100644 --- a/Source/LegumeMix/Public/Weapon/LMWeaponDataStructure.h +++ b/Source/LegumeMix/Public/Weapon/LMWeaponDataStructure.h @@ -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 MeshWeapon; //Mesh of the weapon display in the scene + TObjectPtr MeshWeapon; + /** The animation blueprint to animate the mesh. */ UPROPERTY(EditAnywhere, BlueprintReadWrite) - EAmmoType AmmoType; //Type of ammo, which ammo this weapon is using + TObjectPtr AnimationBluePrint; - UPROPERTY(EditAnywhere, BlueprintReadWrite) - TObjectPtr AnimationBluePrint; //The animation blueprint to animate the mesh + /** The sound to play when firing. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite,Category=Legumix) + TObjectPtr FireSound; };