Added : Ammo files

This commit is contained in:
Emilie Schott 2025-01-21 16:03:24 +01:00
parent 6da5f75089
commit dde9f34958
8 changed files with 217 additions and 90 deletions

View File

@ -21,6 +21,18 @@
"BuildId": "37670630"
},
"BuildProducts": [
{
"Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor-LegumeMix.dll",
"Type": "DynamicLibrary"
},
{
"Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor-LegumeMix.pdb",
"Type": "SymbolFile"
},
{
"Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor.modules",
"Type": "RequiredResource"
},
{
"Path": "$(EngineDir)/Binaries/ThirdParty/USD/UsdResources/Win64/plugins/ar/resources/plugInfo.json",
"Type": "RequiredResource"
@ -2833,6 +2845,50 @@
"Path": "$(EngineDir)/Plugins/Animation/LiveLink/Binaries/Win64/UnrealEditor.modules",
"Type": "RequiredResource"
},
{
"Path": "$(EngineDir)/Plugins/Animation/RigLogic/Binaries/Win64/UnrealEditor-RigLogicDeveloper.dll",
"Type": "DynamicLibrary"
},
{
"Path": "$(EngineDir)/Plugins/Animation/RigLogic/Binaries/Win64/UnrealEditor-RigLogicEditor.dll",
"Type": "DynamicLibrary"
},
{
"Path": "$(EngineDir)/Plugins/Animation/RigLogic/Binaries/Win64/UnrealEditor-RigLogicLib.dll",
"Type": "DynamicLibrary"
},
{
"Path": "$(EngineDir)/Plugins/Animation/RigLogic/Binaries/Win64/UnrealEditor-RigLogicLibTest.dll",
"Type": "DynamicLibrary"
},
{
"Path": "$(EngineDir)/Plugins/Animation/RigLogic/Binaries/Win64/UnrealEditor-RigLogicModule.dll",
"Type": "DynamicLibrary"
},
{
"Path": "$(EngineDir)/Plugins/Animation/RigLogic/Binaries/Win64/UnrealEditor.modules",
"Type": "RequiredResource"
},
{
"Path": "$(EngineDir)/Plugins/Bridge/Binaries/Win64/UnrealEditor-Bridge.dll",
"Type": "DynamicLibrary"
},
{
"Path": "$(EngineDir)/Plugins/Bridge/Binaries/Win64/UnrealEditor-Bridge.pdb",
"Type": "SymbolFile"
},
{
"Path": "$(EngineDir)/Plugins/Bridge/Binaries/Win64/UnrealEditor-MegascansPlugin.dll",
"Type": "DynamicLibrary"
},
{
"Path": "$(EngineDir)/Plugins/Bridge/Binaries/Win64/UnrealEditor-MegascansPlugin.pdb",
"Type": "SymbolFile"
},
{
"Path": "$(EngineDir)/Plugins/Bridge/Binaries/Win64/UnrealEditor.modules",
"Type": "RequiredResource"
},
{
"Path": "$(EngineDir)/Plugins/Cameras/CameraShakePreviewer/Binaries/Win64/UnrealEditor-CameraShakePreviewer.dll",
"Type": "DynamicLibrary"
@ -3665,6 +3721,18 @@
"Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/Binaries/Win64/UnrealEditor.modules",
"Type": "RequiredResource"
},
{
"Path": "$(EngineDir)/Plugins/Experimental/MetaHuman/MetaHumanSDK/Binaries/Win64/UnrealEditor-MetaHumanSDKEditor.dll",
"Type": "DynamicLibrary"
},
{
"Path": "$(EngineDir)/Plugins/Experimental/MetaHuman/MetaHumanSDK/Binaries/Win64/UnrealEditor-MetaHumanSDKRuntime.dll",
"Type": "DynamicLibrary"
},
{
"Path": "$(EngineDir)/Plugins/Experimental/MetaHuman/MetaHumanSDK/Binaries/Win64/UnrealEditor.modules",
"Type": "RequiredResource"
},
{
"Path": "$(EngineDir)/Plugins/Experimental/NFORDenoise/Binaries/Win64/UnrealEditor-NFORDenoise.dll",
"Type": "DynamicLibrary"
@ -3889,66 +3957,6 @@
"Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor.modules",
"Type": "RequiredResource"
},
{
"Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RD.dll",
"Type": "DynamicLibrary"
},
{
"Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RD.pdb",
"Type": "SymbolFile"
},
{
"Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderBlueprint.dll",
"Type": "DynamicLibrary"
},
{
"Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderBlueprint.pdb",
"Type": "SymbolFile"
},
{
"Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderGameControl.dll",
"Type": "DynamicLibrary"
},
{
"Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderGameControl.pdb",
"Type": "SymbolFile"
},
{
"Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderLC.dll",
"Type": "DynamicLibrary"
},
{
"Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderLC.pdb",
"Type": "SymbolFile"
},
{
"Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderLink.dll",
"Type": "DynamicLibrary"
},
{
"Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderLink.pdb",
"Type": "SymbolFile"
},
{
"Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderLogging.dll",
"Type": "DynamicLibrary"
},
{
"Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderLogging.pdb",
"Type": "SymbolFile"
},
{
"Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderShaderInfo.dll",
"Type": "DynamicLibrary"
},
{
"Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor-RiderShaderInfo.pdb",
"Type": "SymbolFile"
},
{
"Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/Binaries/Win64/UnrealEditor.modules",
"Type": "RequiredResource"
},
{
"Path": "$(EngineDir)/Plugins/Media/AndroidMedia/Binaries/Win64/UnrealEditor-AndroidMediaEditor.dll",
"Type": "DynamicLibrary"
@ -4808,21 +4816,13 @@
{
"Path": "$(EngineDir)/Plugins/XGEController/Binaries/Win64/UnrealEditor.modules",
"Type": "RequiredResource"
},
{
"Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor-LegumeMix.dll",
"Type": "DynamicLibrary"
},
{
"Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor-LegumeMix.pdb",
"Type": "SymbolFile"
},
{
"Path": "$(ProjectDir)/Binaries/Win64/UnrealEditor.modules",
"Type": "RequiredResource"
}
],
"RuntimeDependencies": [
{
"Path": "$(ProjectDir)/LegumeMix.uproject",
"Type": "UFS"
},
{
"Path": "$(EngineDir)/Binaries/ThirdParty/DbgHelp/dbghelp.dll",
"Type": "NonUFS"
@ -29839,6 +29839,14 @@
"Path": "$(EngineDir)/Plugins/Animation/LiveLink/LiveLink.uplugin",
"Type": "UFS"
},
{
"Path": "$(EngineDir)/Plugins/Animation/RigLogic/RigLogic.uplugin",
"Type": "UFS"
},
{
"Path": "$(EngineDir)/Plugins/Bridge/Bridge.uplugin",
"Type": "UFS"
},
{
"Path": "$(EngineDir)/Plugins/Cameras/CameraShakePreviewer/CameraShakePreviewer.uplugin",
"Type": "UFS"
@ -30179,6 +30187,10 @@
"Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/MeshModelingToolsetExp.uplugin",
"Type": "UFS"
},
{
"Path": "$(EngineDir)/Plugins/Experimental/MetaHuman/MetaHumanSDK/MetaHumanSDK.uplugin",
"Type": "UFS"
},
{
"Path": "$(EngineDir)/Plugins/Experimental/NFORDenoise/NFORDenoise.uplugin",
"Type": "UFS"
@ -30239,10 +30251,6 @@
"Path": "$(EngineDir)/Plugins/Interchange/Runtime/Interchange.uplugin",
"Type": "UFS"
},
{
"Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/RiderLink.uplugin",
"Type": "UFS"
},
{
"Path": "$(EngineDir)/Plugins/Media/AndroidMedia/AndroidMedia.uplugin",
"Type": "UFS"
@ -30538,10 +30546,6 @@
{
"Path": "$(EngineDir)/Plugins/XGEController/XGEController.uplugin",
"Type": "UFS"
},
{
"Path": "$(ProjectDir)/LegumeMix.uproject",
"Type": "UFS"
}
],
"BuildPlugins": [
@ -30573,6 +30577,7 @@
"BaseCharacterFXEditor",
"BlendSpaceMotionAnalysis",
"BlueprintHeaderView",
"Bridge",
"CLionSourceCodeAccess",
"CableComponent",
"CameraShakePreviewer",
@ -30661,6 +30666,7 @@
"MeshModelingToolset",
"MeshModelingToolsetExp",
"MeshPainting",
"MetaHumanSDK",
"Metasound",
"MobileLauncherProfileWizard",
"MobilePatchingUtils",
@ -30699,8 +30705,8 @@
"RenderDocPlugin",
"RenderGraphInsights",
"ResonanceAudio",
"RiderLink",
"RiderSourceCodeAccess",
"RigLogic",
"RigVM",
"SQLiteCore",
"SequencerAnimTools",

BIN
Content/Legumix/Player/BP_Player.uasset (Stored with Git LFS)

Binary file not shown.

BIN
Content/Legumix/Weapon/BP_Ammo.uasset (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -2,11 +2,12 @@
#include "Player/LMPlayer.h"
#include "Weapon/LMAmmo.h"
#include "Weapon/LMWeaponManager.h"
ALMPlayer::ALMPlayer()
{
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
WeaponManager = CreateDefaultSubobject<ULMWeaponManager>(TEXT("Weapon Manager"));
@ -17,18 +18,33 @@ ALMPlayer::ALMPlayer()
WeaponManager->SetWeaponMeshComponent(WeaponSkeletalMeshComponent);
}
// Called when the game starts or when spawned
void ALMPlayer::BeginPlay()
{
Super::BeginPlay();
}
void ALMPlayer::PickUpAmmo(ALMAmmo* Ammo)
{
if (GEngine)
{
FString AmmoAmount = FString::Printf(TEXT("Quantité de munition : %i"), Ammo->GetAmmoAmount());
GEngine->AddOnScreenDebugMessage(1, 30.f, FColor::Red, AmmoAmount);
}
}
// 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

@ -19,12 +19,14 @@ void ALMPlayerController::BeginPlay()
void ALMPlayerController::SetupInputComponent()
{
Super::SetupInputComponent();
UEnhancedInputComponent* Input = Cast<UEnhancedInputComponent>(InputComponent);
Input->BindAction(MoveAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Move);
Input->BindAction(JumpAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Jump);
Input->BindAction(LookAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Look);
Input->BindAction(FireAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Fire);
Input->BindAction(ReloadAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Reload);
if(UEnhancedInputComponent* Input = Cast<UEnhancedInputComponent>(InputComponent))
{
Input->BindAction(MoveAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Move);
Input->BindAction(JumpAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Jump);
Input->BindAction(LookAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Look);
Input->BindAction(FireAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Fire);
Input->BindAction(ReloadAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Reload);
}
}
void ALMPlayerController::Move(const FInputActionValue& InputValue)

View File

@ -0,0 +1,43 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "Weapon/LMAmmo.h"
#include "Components/BoxComponent.h"
#include "Components/SphereComponent.h"
#include "Player/LMPlayer.h"
// Sets default values
ALMAmmo::ALMAmmo()
{
PrimaryActorTick.bCanEverTick = true;
AmmoMeshComponent = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("AmmoMeshComponent"));
RootComponent = AmmoMeshComponent;
CollisionSphere = CreateDefaultSubobject<USphereComponent>(TEXT("CollisionSphere"));
CollisionSphere->SetupAttachment(RootComponent);
CollisionSphere->OnComponentBeginOverlap.AddDynamic(this, &ALMAmmo::OnSphereOverlap);
AmmoType = EAmmoType::EAT_RadishAmmo;
AmmoAmount = 1;
}
void ALMAmmo::BeginPlay()
{
Super::BeginPlay();
}
void ALMAmmo::OnSphereOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
if (ALMPlayer* Player = Cast<ALMPlayer>(OtherActor))
{
Player->PickUpAmmo(this);
Destroy();
}
}
void ALMAmmo::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}

View File

@ -8,17 +8,24 @@
class ULMWeaponManager;
class ALMAmmo;
UCLASS()
class LEGUMEMIX_API ALMPlayer : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this character's properties
ALMPlayer();
virtual void Tick(float DeltaTime) override;
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
UFUNCTION()
void PickUpAmmo(ALMAmmo* Ammo);
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:

View File

@ -0,0 +1,50 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.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
{
GENERATED_BODY()
public:
ALMAmmo();
virtual void Tick(float DeltaTime) override;
UFUNCTION(BlueprintCallable)
inline int GetAmmoAmount() { return AmmoAmount; }
UFUNCTION(BlueprintCallable)
inline EAmmoType GetAmmoType() { return AmmoType; }
protected:
virtual void BeginPlay() override;
UPROPERTY(EditAnywhere)
TObjectPtr<UStaticMeshComponent> AmmoMeshComponent;
UPROPERTY(EditAnywhere)
TObjectPtr<USphereComponent> CollisionSphere;
UPROPERTY(EditAnywhere)
EAmmoType AmmoType;
UPROPERTY(EditAnywhere)
int AmmoAmount;
UFUNCTION(BlueprintCallable)
void OnSphereOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);
};