Updated some data types
This commit is contained in:
parent
156becc36c
commit
5524705f60
@ -17,8 +17,8 @@ ALMPlayer::ALMPlayer()
|
|||||||
Camera->bUsePawnControlRotation = true;
|
Camera->bUsePawnControlRotation = true;
|
||||||
Camera->SetRelativeLocation(FVector(20, 0, 90));
|
Camera->SetRelativeLocation(FVector(20, 0, 90));
|
||||||
|
|
||||||
WeaponSkeletalMeshComponent = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Weapon Mesh"));
|
ArmsMesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Arms Mesh"));
|
||||||
WeaponSkeletalMeshComponent->SetupAttachment(Camera);
|
ArmsMesh->SetupAttachment(Camera);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the game starts or when spawned
|
// Called when the game starts or when spawned
|
||||||
@ -48,16 +48,15 @@ void ALMPlayer::SetWeaponManager(ULMWeaponManager* Manager)
|
|||||||
}
|
}
|
||||||
|
|
||||||
WeaponManager = Manager;
|
WeaponManager = Manager;
|
||||||
WeaponManager->Initialize(WeaponSkeletalMeshComponent);
|
WeaponManager->Initialize(ArmsMesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called every frame
|
|
||||||
void ALMPlayer::Tick(float DeltaTime)
|
void ALMPlayer::Tick(float DeltaTime)
|
||||||
{
|
{
|
||||||
Super::Tick(DeltaTime);
|
Super::Tick(DeltaTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called to bind functionality to input
|
|
||||||
void ALMPlayer::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
|
void ALMPlayer::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
|
||||||
{
|
{
|
||||||
Super::SetupPlayerInputComponent(PlayerInputComponent);
|
Super::SetupPlayerInputComponent(PlayerInputComponent);
|
||||||
|
@ -37,12 +37,12 @@ public:
|
|||||||
void SetWeaponManager(ULMWeaponManager* Manager);
|
void SetWeaponManager(ULMWeaponManager* Manager);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Legumix", meta = (AllowPrivateAccess = true))
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true))
|
||||||
TObjectPtr<ULMWeaponManager> WeaponManager;
|
TObjectPtr<ULMWeaponManager> WeaponManager;
|
||||||
|
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Legumix", meta = (AllowPrivateAccess = true))
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true))
|
||||||
TObjectPtr<USkeletalMeshComponent> WeaponSkeletalMeshComponent;
|
TObjectPtr<USkeletalMeshComponent> ArmsMesh;
|
||||||
|
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="Legumix", meta = (AllowPrivateAccess = true))
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true))
|
||||||
TObjectPtr<UCameraComponent> Camera;
|
TObjectPtr<UCameraComponent> Camera;
|
||||||
};
|
};
|
||||||
|
@ -3,17 +3,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
|
#include "LMAmmoType.h"
|
||||||
#include "GameFramework/Actor.h"
|
#include "GameFramework/Actor.h"
|
||||||
#include "LMAmmo.generated.h"
|
#include "LMAmmo.generated.h"
|
||||||
|
|
||||||
class USphereComponent;
|
class USphereComponent;
|
||||||
|
|
||||||
UENUM(BlueprintType)
|
|
||||||
enum class EAmmoType : uint8
|
|
||||||
{
|
|
||||||
EAT_RadishAmmo UMETA(DisplayName = "Radish Ammo"),
|
|
||||||
EAT_CornAmmo UMETA(DisplayName = "Corn Ammo")
|
|
||||||
};
|
|
||||||
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class LEGUMEMIX_API ALMAmmo : public AActor
|
class LEGUMEMIX_API ALMAmmo : public AActor
|
||||||
|
8
Source/LegumeMix/Public/Weapon/LMAmmoType.h
Normal file
8
Source/LegumeMix/Public/Weapon/LMAmmoType.h
Normal 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")
|
||||||
|
};
|
@ -1,6 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "AnimationBlueprintEditorSettings.h"
|
|
||||||
#include "LMAmmo.h"
|
|
||||||
#include "LMWeaponDataStructure.generated.h"
|
#include "LMWeaponDataStructure.generated.h"
|
||||||
|
|
||||||
USTRUCT(BlueprintType)
|
USTRUCT(BlueprintType)
|
||||||
@ -8,18 +6,23 @@ struct FLMWeaponDataStructure : public FTableRowBase
|
|||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
/** Max ammo in inventory */
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
int MaxAmmo; // Max ammo in "inventory"
|
int MaxAmmo;
|
||||||
|
|
||||||
|
/** Max ammo in clip. */
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
int MaxClipAmmo; // Max ammo in clip
|
int MaxClipAmmo;
|
||||||
|
|
||||||
|
/** Mesh of the weapon display in the scene. */
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
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)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
EAmmoType AmmoType; //Type of ammo, which ammo this weapon is using
|
TObjectPtr<UAnimBlueprint> AnimationBluePrint;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
/** The sound to play when firing. */
|
||||||
TObjectPtr<UAnimBlueprint> AnimationBluePrint; //The animation blueprint to animate the mesh
|
UPROPERTY(EditAnywhere, BlueprintReadWrite,Category=Legumix)
|
||||||
|
TObjectPtr<USoundWave> FireSound;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user