Added : Ammo files
This commit is contained in:
parent
6da5f75089
commit
dde9f34958
@ -21,6 +21,18 @@
|
|||||||
"BuildId": "37670630"
|
"BuildId": "37670630"
|
||||||
},
|
},
|
||||||
"BuildProducts": [
|
"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",
|
"Path": "$(EngineDir)/Binaries/ThirdParty/USD/UsdResources/Win64/plugins/ar/resources/plugInfo.json",
|
||||||
"Type": "RequiredResource"
|
"Type": "RequiredResource"
|
||||||
@ -2833,6 +2845,50 @@
|
|||||||
"Path": "$(EngineDir)/Plugins/Animation/LiveLink/Binaries/Win64/UnrealEditor.modules",
|
"Path": "$(EngineDir)/Plugins/Animation/LiveLink/Binaries/Win64/UnrealEditor.modules",
|
||||||
"Type": "RequiredResource"
|
"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",
|
"Path": "$(EngineDir)/Plugins/Cameras/CameraShakePreviewer/Binaries/Win64/UnrealEditor-CameraShakePreviewer.dll",
|
||||||
"Type": "DynamicLibrary"
|
"Type": "DynamicLibrary"
|
||||||
@ -3665,6 +3721,18 @@
|
|||||||
"Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/Binaries/Win64/UnrealEditor.modules",
|
"Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/Binaries/Win64/UnrealEditor.modules",
|
||||||
"Type": "RequiredResource"
|
"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",
|
"Path": "$(EngineDir)/Plugins/Experimental/NFORDenoise/Binaries/Win64/UnrealEditor-NFORDenoise.dll",
|
||||||
"Type": "DynamicLibrary"
|
"Type": "DynamicLibrary"
|
||||||
@ -3889,66 +3957,6 @@
|
|||||||
"Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor.modules",
|
"Path": "$(EngineDir)/Plugins/Interchange/Runtime/Binaries/Win64/UnrealEditor.modules",
|
||||||
"Type": "RequiredResource"
|
"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",
|
"Path": "$(EngineDir)/Plugins/Media/AndroidMedia/Binaries/Win64/UnrealEditor-AndroidMediaEditor.dll",
|
||||||
"Type": "DynamicLibrary"
|
"Type": "DynamicLibrary"
|
||||||
@ -4808,21 +4816,13 @@
|
|||||||
{
|
{
|
||||||
"Path": "$(EngineDir)/Plugins/XGEController/Binaries/Win64/UnrealEditor.modules",
|
"Path": "$(EngineDir)/Plugins/XGEController/Binaries/Win64/UnrealEditor.modules",
|
||||||
"Type": "RequiredResource"
|
"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": [
|
"RuntimeDependencies": [
|
||||||
|
{
|
||||||
|
"Path": "$(ProjectDir)/LegumeMix.uproject",
|
||||||
|
"Type": "UFS"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Path": "$(EngineDir)/Binaries/ThirdParty/DbgHelp/dbghelp.dll",
|
"Path": "$(EngineDir)/Binaries/ThirdParty/DbgHelp/dbghelp.dll",
|
||||||
"Type": "NonUFS"
|
"Type": "NonUFS"
|
||||||
@ -29839,6 +29839,14 @@
|
|||||||
"Path": "$(EngineDir)/Plugins/Animation/LiveLink/LiveLink.uplugin",
|
"Path": "$(EngineDir)/Plugins/Animation/LiveLink/LiveLink.uplugin",
|
||||||
"Type": "UFS"
|
"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",
|
"Path": "$(EngineDir)/Plugins/Cameras/CameraShakePreviewer/CameraShakePreviewer.uplugin",
|
||||||
"Type": "UFS"
|
"Type": "UFS"
|
||||||
@ -30179,6 +30187,10 @@
|
|||||||
"Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/MeshModelingToolsetExp.uplugin",
|
"Path": "$(EngineDir)/Plugins/Experimental/MeshModelingToolsetExp/MeshModelingToolsetExp.uplugin",
|
||||||
"Type": "UFS"
|
"Type": "UFS"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Path": "$(EngineDir)/Plugins/Experimental/MetaHuman/MetaHumanSDK/MetaHumanSDK.uplugin",
|
||||||
|
"Type": "UFS"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Path": "$(EngineDir)/Plugins/Experimental/NFORDenoise/NFORDenoise.uplugin",
|
"Path": "$(EngineDir)/Plugins/Experimental/NFORDenoise/NFORDenoise.uplugin",
|
||||||
"Type": "UFS"
|
"Type": "UFS"
|
||||||
@ -30239,10 +30251,6 @@
|
|||||||
"Path": "$(EngineDir)/Plugins/Interchange/Runtime/Interchange.uplugin",
|
"Path": "$(EngineDir)/Plugins/Interchange/Runtime/Interchange.uplugin",
|
||||||
"Type": "UFS"
|
"Type": "UFS"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"Path": "$(EngineDir)/Plugins/Marketplace/Developer/RiderLink/RiderLink.uplugin",
|
|
||||||
"Type": "UFS"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"Path": "$(EngineDir)/Plugins/Media/AndroidMedia/AndroidMedia.uplugin",
|
"Path": "$(EngineDir)/Plugins/Media/AndroidMedia/AndroidMedia.uplugin",
|
||||||
"Type": "UFS"
|
"Type": "UFS"
|
||||||
@ -30538,10 +30546,6 @@
|
|||||||
{
|
{
|
||||||
"Path": "$(EngineDir)/Plugins/XGEController/XGEController.uplugin",
|
"Path": "$(EngineDir)/Plugins/XGEController/XGEController.uplugin",
|
||||||
"Type": "UFS"
|
"Type": "UFS"
|
||||||
},
|
|
||||||
{
|
|
||||||
"Path": "$(ProjectDir)/LegumeMix.uproject",
|
|
||||||
"Type": "UFS"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"BuildPlugins": [
|
"BuildPlugins": [
|
||||||
@ -30573,6 +30577,7 @@
|
|||||||
"BaseCharacterFXEditor",
|
"BaseCharacterFXEditor",
|
||||||
"BlendSpaceMotionAnalysis",
|
"BlendSpaceMotionAnalysis",
|
||||||
"BlueprintHeaderView",
|
"BlueprintHeaderView",
|
||||||
|
"Bridge",
|
||||||
"CLionSourceCodeAccess",
|
"CLionSourceCodeAccess",
|
||||||
"CableComponent",
|
"CableComponent",
|
||||||
"CameraShakePreviewer",
|
"CameraShakePreviewer",
|
||||||
@ -30661,6 +30666,7 @@
|
|||||||
"MeshModelingToolset",
|
"MeshModelingToolset",
|
||||||
"MeshModelingToolsetExp",
|
"MeshModelingToolsetExp",
|
||||||
"MeshPainting",
|
"MeshPainting",
|
||||||
|
"MetaHumanSDK",
|
||||||
"Metasound",
|
"Metasound",
|
||||||
"MobileLauncherProfileWizard",
|
"MobileLauncherProfileWizard",
|
||||||
"MobilePatchingUtils",
|
"MobilePatchingUtils",
|
||||||
@ -30699,8 +30705,8 @@
|
|||||||
"RenderDocPlugin",
|
"RenderDocPlugin",
|
||||||
"RenderGraphInsights",
|
"RenderGraphInsights",
|
||||||
"ResonanceAudio",
|
"ResonanceAudio",
|
||||||
"RiderLink",
|
|
||||||
"RiderSourceCodeAccess",
|
"RiderSourceCodeAccess",
|
||||||
|
"RigLogic",
|
||||||
"RigVM",
|
"RigVM",
|
||||||
"SQLiteCore",
|
"SQLiteCore",
|
||||||
"SequencerAnimTools",
|
"SequencerAnimTools",
|
||||||
|
BIN
Content/Legumix/Player/BP_Player.uasset
(Stored with Git LFS)
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
BIN
Content/Legumix/Weapon/BP_Ammo.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -2,11 +2,12 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "Player/LMPlayer.h"
|
#include "Player/LMPlayer.h"
|
||||||
|
#include "Weapon/LMAmmo.h"
|
||||||
#include "Weapon/LMWeaponManager.h"
|
#include "Weapon/LMWeaponManager.h"
|
||||||
|
|
||||||
ALMPlayer::ALMPlayer()
|
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;
|
PrimaryActorTick.bCanEverTick = true;
|
||||||
|
|
||||||
WeaponManager = CreateDefaultSubobject<ULMWeaponManager>(TEXT("Weapon Manager"));
|
WeaponManager = CreateDefaultSubobject<ULMWeaponManager>(TEXT("Weapon Manager"));
|
||||||
@ -17,18 +18,33 @@ ALMPlayer::ALMPlayer()
|
|||||||
WeaponManager->SetWeaponMeshComponent(WeaponSkeletalMeshComponent);
|
WeaponManager->SetWeaponMeshComponent(WeaponSkeletalMeshComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Called when the game starts or when spawned
|
||||||
void ALMPlayer::BeginPlay()
|
void ALMPlayer::BeginPlay()
|
||||||
{
|
{
|
||||||
Super::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)
|
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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,12 +19,14 @@ void ALMPlayerController::BeginPlay()
|
|||||||
void ALMPlayerController::SetupInputComponent()
|
void ALMPlayerController::SetupInputComponent()
|
||||||
{
|
{
|
||||||
Super::SetupInputComponent();
|
Super::SetupInputComponent();
|
||||||
UEnhancedInputComponent* Input = Cast<UEnhancedInputComponent>(InputComponent);
|
if(UEnhancedInputComponent* Input = Cast<UEnhancedInputComponent>(InputComponent))
|
||||||
Input->BindAction(MoveAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Move);
|
{
|
||||||
Input->BindAction(JumpAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Jump);
|
Input->BindAction(MoveAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Move);
|
||||||
Input->BindAction(LookAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Look);
|
Input->BindAction(JumpAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Jump);
|
||||||
Input->BindAction(FireAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Fire);
|
Input->BindAction(LookAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Look);
|
||||||
Input->BindAction(ReloadAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Reload);
|
Input->BindAction(FireAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Fire);
|
||||||
|
Input->BindAction(ReloadAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Reload);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ALMPlayerController::Move(const FInputActionValue& InputValue)
|
void ALMPlayerController::Move(const FInputActionValue& InputValue)
|
||||||
|
43
Source/LegumeMix/Private/Weapon/LMAmmo.cpp
Normal file
43
Source/LegumeMix/Private/Weapon/LMAmmo.cpp
Normal 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);
|
||||||
|
}
|
||||||
|
|
@ -8,17 +8,24 @@
|
|||||||
|
|
||||||
class ULMWeaponManager;
|
class ULMWeaponManager;
|
||||||
|
|
||||||
|
class ALMAmmo;
|
||||||
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class LEGUMEMIX_API ALMPlayer : public ACharacter
|
class LEGUMEMIX_API ALMPlayer : public ACharacter
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// Sets default values for this character's properties
|
||||||
ALMPlayer();
|
ALMPlayer();
|
||||||
virtual void Tick(float DeltaTime) override;
|
virtual void Tick(float DeltaTime) override;
|
||||||
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
||||||
|
|
||||||
|
UFUNCTION()
|
||||||
|
void PickUpAmmo(ALMAmmo* Ammo);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
// Called when the game starts or when spawned
|
||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
50
Source/LegumeMix/Public/Weapon/LMAmmo.h
Normal file
50
Source/LegumeMix/Public/Weapon/LMAmmo.h
Normal 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);
|
||||||
|
};
|
Reference in New Issue
Block a user