Merge branch 'DA-Test' of https://git.tlimon.fr/ICAN_4JV/LegumeMix into DA-Test

This commit is contained in:
Lu 2025-04-07 13:10:43 +02:00
commit 3729c194f7
37 changed files with 302 additions and 64 deletions

View File

@ -131,9 +131,11 @@ ManualIPAddress=
+Profiles=(Name="Ragdoll",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="PhysicsBody",CustomResponses=((Channel="Pawn",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore),(Channel="Bullet",Response=ECR_Ignore)),HelpMessage="Simulating Skeletal Mesh Component. All other channels will be set to default.") +Profiles=(Name="Ragdoll",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="PhysicsBody",CustomResponses=((Channel="Pawn",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore),(Channel="Bullet",Response=ECR_Ignore)),HelpMessage="Simulating Skeletal Mesh Component. All other channels will be set to default.")
+Profiles=(Name="Vehicle",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="Vehicle",CustomResponses=,HelpMessage="Vehicle object that blocks Vehicle, WorldStatic, and WorldDynamic. All other channels will be set to default.") +Profiles=(Name="Vehicle",CollisionEnabled=QueryAndPhysics,bCanModify=False,ObjectTypeName="Vehicle",CustomResponses=,HelpMessage="Vehicle object that blocks Vehicle, WorldStatic, and WorldDynamic. All other channels will be set to default.")
+Profiles=(Name="UI",CollisionEnabled=QueryOnly,bCanModify=False,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap),(Channel="Bullet",Response=ECR_Ignore)),HelpMessage="WorldStatic object that overlaps all actors by default. All new custom channels will use its own default response. ") +Profiles=(Name="UI",CollisionEnabled=QueryOnly,bCanModify=False,ObjectTypeName="WorldDynamic",CustomResponses=((Channel="WorldStatic",Response=ECR_Overlap),(Channel="WorldDynamic",Response=ECR_Overlap),(Channel="Pawn",Response=ECR_Overlap),(Channel="Camera",Response=ECR_Overlap),(Channel="PhysicsBody",Response=ECR_Overlap),(Channel="Vehicle",Response=ECR_Overlap),(Channel="Destructible",Response=ECR_Overlap),(Channel="Bullet",Response=ECR_Ignore)),HelpMessage="WorldStatic object that overlaps all actors by default. All new custom channels will use its own default response. ")
+Profiles=(Name="Drop",CollisionEnabled=QueryAndPhysics,bCanModify=True,ObjectTypeName="Drop",CustomResponses=((Channel="WorldStatic",Response=ECR_Ignore),(Channel="Pawn",Response=ECR_Ignore),(Channel="Visibility",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore),(Channel="PhysicsBody",Response=ECR_Ignore),(Channel="Vehicle",Response=ECR_Ignore),(Channel="Destructible",Response=ECR_Ignore),(Channel="Bullet",Response=ECR_Ignore),(Channel="Enemy",Response=ECR_Ignore),(Channel="Drop",Response=ECR_Ignore)),HelpMessage="Needs description")
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel1,DefaultResponse=ECR_Block,bTraceType=True,bStaticObject=False,Name="Bullet") +DefaultChannelResponses=(Channel=ECC_GameTraceChannel1,DefaultResponse=ECR_Block,bTraceType=True,bStaticObject=False,Name="Bullet")
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel2,DefaultResponse=ECR_Block,bTraceType=True,bStaticObject=False,Name="Enemy") +DefaultChannelResponses=(Channel=ECC_GameTraceChannel2,DefaultResponse=ECR_Block,bTraceType=True,bStaticObject=False,Name="Enemy")
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel3,DefaultResponse=ECR_Ignore,bTraceType=False,bStaticObject=False,Name="Projectile") +DefaultChannelResponses=(Channel=ECC_GameTraceChannel3,DefaultResponse=ECR_Ignore,bTraceType=False,bStaticObject=False,Name="Projectile")
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel4,DefaultResponse=ECR_Block,bTraceType=False,bStaticObject=False,Name="Drop")
+EditProfiles=(Name="NoCollision",CustomResponses=((Channel="Bullet",Response=ECR_Ignore))) +EditProfiles=(Name="NoCollision",CustomResponses=((Channel="Bullet",Response=ECR_Ignore)))
+EditProfiles=(Name="OverlapAll",CustomResponses=((Channel="Bullet",Response=ECR_Overlap))) +EditProfiles=(Name="OverlapAll",CustomResponses=((Channel="Bullet",Response=ECR_Overlap)))
+EditProfiles=(Name="CharacterMesh",CustomResponses=((Channel="Bullet",Response=ECR_Ignore))) +EditProfiles=(Name="CharacterMesh",CustomResponses=((Channel="Bullet",Response=ECR_Ignore)))

BIN
Content/FMOD/Desktop/Master.bank (Stored with Git LFS)

Binary file not shown.

BIN
Content/FMOD/Desktop/Master.strings.bank (Stored with Git LFS)

Binary file not shown.

BIN
Content/Legumix/Drops/BP_AmmoSpawner.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Legumix/Drops/BP_HealthPack.uasset (Stored with Git LFS)

Binary file not shown.

BIN
Content/Legumix/Ennemy/E_EnemyState.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Legumix/Levels/LVL_00.umap (Stored with Git LFS)

Binary file not shown.

BIN
Content/Legumix/Levels/LVL_TEST_003.umap (Stored with Git LFS)

Binary file not shown.

BIN
Content/Legumix/Player/BP_GrabComponent.uasset (Stored with Git LFS) Normal file

Binary file not shown.

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

Binary file not shown.

Binary file not shown.

BIN
Content/Legumix/Player/C_GrabMovement.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

View File

@ -3,8 +3,20 @@
#include "Ammo/LMAmmoPack.h" #include "Ammo/LMAmmoPack.h"
#include "Player/LMPlayer.h"
#include "Weapon/LMWeaponManager.h"
ALMAmmoPack::ALMAmmoPack() ALMAmmoPack::ALMAmmoPack()
{ {
PrimaryActorTick.bCanEverTick = false; PrimaryActorTick.bCanEverTick = false;
} }
void ALMAmmoPack::ConsumePack(ALMPlayer* Player)
{
Super::ConsumePack(Player);
Player->AddAmmo(AmmoType, AmmoCount);
OnPackConsumed();
Despawn();
}

View File

@ -5,7 +5,6 @@
ALMEnemy::ALMEnemy() ALMEnemy::ALMEnemy()
{ {
PrimaryActorTick.bCanEverTick = true; PrimaryActorTick.bCanEverTick = true;
EnemyState = EEnemyState::EES_Chasing;
AttackingRadius = 100.f; AttackingRadius = 100.f;
AttackingDamage = 0.f; AttackingDamage = 0.f;
} }
@ -22,11 +21,6 @@ void ALMEnemy::Attack(const APawn* TargetedPawn)
GEngine->AddOnScreenDebugMessage(1, 2.f, FColor::Cyan, Debug); GEngine->AddOnScreenDebugMessage(1, 2.f, FColor::Cyan, Debug);
} }
double ALMEnemy::GetDistanceToTarget(const AActor* TargetedActor)
{
return (TargetedActor->GetActorLocation() - GetActorLocation()).Length();
}
void ALMEnemy::Tick(float DeltaTime) void ALMEnemy::Tick(float DeltaTime)
{ {
Super::Tick(DeltaTime); Super::Tick(DeltaTime);

View File

@ -3,9 +3,21 @@
#include "LMHealthPack.h" #include "LMHealthPack.h"
#include "Player/LMHealthComponent.h"
#include "Player/LMPlayer.h"
ALMHealthPack::ALMHealthPack() ALMHealthPack::ALMHealthPack()
{ {
PrimaryActorTick.bCanEverTick = false; PrimaryActorTick.bCanEverTick = false;
} }
void ALMHealthPack::ConsumePack(ALMPlayer* Player)
{
Super::ConsumePack(Player);
Player->GetHealthComponent()->AddHealth(HealthGain);
OnPackConsumed();
Despawn();
}

View File

@ -3,20 +3,63 @@
#include "LMItemDrop.h" #include "LMItemDrop.h"
#include "Kismet/KismetMathLibrary.h"
ALMItemDrop::ALMItemDrop() ALMItemDrop::ALMItemDrop()
{ {
PrimaryActorTick.bCanEverTick = true; PrimaryActorTick.bCanEverTick = true;
Root = CreateDefaultSubobject<USceneComponent>("Root");
RootComponent = Root;
StaticMeshComponent = CreateDefaultSubobject<UStaticMeshComponent>("MeshComponent"); StaticMeshComponent = CreateDefaultSubobject<UStaticMeshComponent>("MeshComponent");
RootComponent = StaticMeshComponent; StaticMeshComponent->SetupAttachment(RootComponent);
} }
void ALMItemDrop::BeginPlay() void ALMItemDrop::BeginPlay()
{ {
Super::BeginPlay(); Super::BeginPlay();
SpawnLocation = GetActorLocation();
GetWorldTimerManager().SetTimer(DespawnHandle, this, &ALMItemDrop::Despawn, TimeBeforeDespawn); GetWorldTimerManager().SetTimer(DespawnHandle, this, &ALMItemDrop::Despawn, TimeBeforeDespawn);
} }
void ALMItemDrop::SetAttractor(AActor* Target)
{
Attractor = Target;
GetWorldTimerManager().SetTimer(MoveHandle, this, &ALMItemDrop::DoMovingTowardsTarget, MoveRate, true);
GetWorldTimerManager().ClearTimer(DespawnHandle);
}
void ALMItemDrop::DoMovingTowardsTarget()
{
if (MoveTime >= MoveDuration)
{
GetWorldTimerManager().ClearTimer(MoveHandle);
SetActorLocation(Attractor->GetActorLocation());
return;
}
const FVector Position = Attractor->GetActorLocation();
const float Duration = MoveTime / MoveDuration;
FString text = FString::Printf(TEXT("Time : %f / %f = %f"), MoveTime, MoveDuration, Duration);
GEngine->AddOnScreenDebugMessage(-15, 1.f, FColor::Red, text);
const float CurvePosition = PositionAtTime->GetFloatValue(Duration);
const FVector NewPosition = UKismetMathLibrary::VLerp(SpawnLocation, Position, CurvePosition);
MoveTime += MoveRate;
SetActorLocation(NewPosition);
}
void ALMItemDrop::ConsumePack(ALMPlayer* Player)
{
if (MoveHandle.IsValid())
{
GetWorldTimerManager().ClearTimer(MoveHandle);
}
}
void ALMItemDrop::Despawn() void ALMItemDrop::Despawn()
{ {
GetWorldTimerManager().ClearTimer(DespawnHandle); GetWorldTimerManager().ClearTimer(DespawnHandle);

View File

@ -0,0 +1,66 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "LMGrabRange.h"
#include "LMItemDrop.h"
#include "Player/LMPlayer.h"
ULMGrabRange::ULMGrabRange()
{
PrimaryComponentTick.bCanEverTick = true;
}
void ULMGrabRange::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
if (!bIsEnabled)
return;
for (int i = Drops.Num() - 1; i >= 0; i--)
{
ALMItemDrop* Item = Drops[i];
const FVector ItemPosition = Item->GetActorLocation();
const FVector Position = GetComponentLocation();
const float DistanceLeft = FVector::Dist(ItemPosition, Position);
FString text = FString::Printf(TEXT("Item %s at distance %f"), *Item->GetName(), DistanceLeft);
GEngine->AddOnScreenDebugMessage(i, 1.f, FColor::Cyan, text);
if (DistanceLeft <= RangeToGrab)
{
Item->ConsumePack(Player);
Drops.Remove(Item);
}
}
}
void ULMGrabRange::OnDropOverlapped(ALMItemDrop* ItemDrop)
{
Drops.AddUnique(ItemDrop);
ItemDrop->SetAttractor(Player);
}
void ULMGrabRange::BeginPlay()
{
Super::BeginPlay();
Player = CastChecked<ALMPlayer>(GetOwner());
OnComponentBeginOverlap.AddUniqueDynamic(this, &ULMGrabRange::OnComponentOverlap);
}
void ULMGrabRange::OnComponentOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
if (!bIsEnabled)
return;
if (ALMItemDrop* ItemDrop = Cast<ALMItemDrop>(OtherActor))
{
OnDropOverlapped(ItemDrop);
}
}

View File

@ -0,0 +1,45 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/SphereComponent.h"
#include "LMGrabRange.generated.h"
class ALMPlayer;
class ALMItemDrop;
UCLASS(Blueprintable, ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
class LEGUMEMIX_API ULMGrabRange : public USphereComponent
{
GENERATED_BODY()
private:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Legumix, meta=(AllowPrivateAccess=true))
bool bIsEnabled = true;
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category=Legumix, meta=(AllowPrivateAccess=true))
TArray<ALMItemDrop*> Drops;
/** The range at which the drop is consumed. */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Legumix, meta=(AllowPrivateAccess=true, ClampMin=0.1f))
float RangeToGrab = 10.f;
TObjectPtr<ALMPlayer> Player;
public:
ULMGrabRange();
UFUNCTION(BlueprintCallable, Category=Legumix)
void OnDropOverlapped(ALMItemDrop* ItemDrop);
virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
protected:
virtual void BeginPlay() override;
private:
UFUNCTION()
void OnComponentOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);
};

View File

@ -116,6 +116,14 @@ bool ALMPlayer::CanJumpInternal_Implementation() const
return JumpIsAllowedInternal(); return JumpIsAllowedInternal();
} }
void ALMPlayer::AddAmmo(const EAmmoType Ammo, const int AmmoCount)
{
if (GetWeaponManager()->AddAmmoType(Ammo, AmmoCount))
{
OnAmmoPickup();
}
}
void ALMPlayer::SetWeaponManager(ULMWeaponManager* Manager) void ALMPlayer::SetWeaponManager(ULMWeaponManager* Manager)
{ {
UE_LOG(LogTemp, Warning, TEXT("Set weapon manager")) UE_LOG(LogTemp, Warning, TEXT("Set weapon manager"))

View File

@ -35,6 +35,7 @@ void ALMPlayerController::SetupInputComponent()
Input->BindAction(FireAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Fire); Input->BindAction(FireAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Fire);
Input->BindAction(ReloadAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Reload); Input->BindAction(ReloadAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Reload);
Input->BindAction(ScrollAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Scroll); Input->BindAction(ScrollAction, ETriggerEvent::Triggered, this, &ALMPlayerController::Scroll);
Input->BindAction(ScrollAction, ETriggerEvent::Canceled, this, &ALMPlayerController::ScrollEnded);
Input->BindAction(PauseAction, ETriggerEvent::Triggered, this, &ALMPlayerController::TogglePause); Input->BindAction(PauseAction, ETriggerEvent::Triggered, this, &ALMPlayerController::TogglePause);
Input->BindAction(SlideAction, ETriggerEvent::Started, this, &ALMPlayerController::SlideInput); Input->BindAction(SlideAction, ETriggerEvent::Started, this, &ALMPlayerController::SlideInput);
Input->BindAction(SlideAction, ETriggerEvent::Completed, this, &ALMPlayerController::SlideCancel); Input->BindAction(SlideAction, ETriggerEvent::Completed, this, &ALMPlayerController::SlideCancel);
@ -73,8 +74,19 @@ void ALMPlayerController::Reload(const FInputActionValue& InputValue)
void ALMPlayerController::Scroll(const FInputActionValue& InputValue) void ALMPlayerController::Scroll(const FInputActionValue& InputValue)
{ {
if (bIsScrolling)
return;
const float ScrollAmount = InputValue.Get<float>(); const float ScrollAmount = InputValue.Get<float>();
LegumixPlayer->GetWeaponManager()->SwitchWeapon(ScrollAmount); LegumixPlayer->GetWeaponManager()->SwitchWeapon(ScrollAmount);
bIsScrolling = true;
GetWorldTimerManager().SetTimer(ScrollTimer, this, &ALMPlayerController::ScrollEnded, SwitchWeaponDelay, false);
}
void ALMPlayerController::ScrollEnded()
{
GetWorldTimerManager().ClearTimer(ScrollTimer);
bIsScrolling = false;
} }
void ALMPlayerController::PauseInput(const FInputActionValue& InputValue) void ALMPlayerController::PauseInput(const FInputActionValue& InputValue)

View File

@ -21,4 +21,6 @@ public:
public: public:
ALMAmmoPack(); ALMAmmoPack();
virtual void ConsumePack(ALMPlayer* Player) override;
}; };

View File

@ -6,13 +6,6 @@
#include "GameFramework/Character.h" #include "GameFramework/Character.h"
#include "LMEnemy.generated.h" #include "LMEnemy.generated.h"
UENUM(BlueprintType)
enum class EEnemyState : uint8
{
EES_Chasing UMETA(DisplayName = "Chasing"),
EES_Attacking UMETA(DisplayName = "Attacking")
};
UCLASS() UCLASS()
class LEGUMEMIX_API ALMEnemy : public ACharacter class LEGUMEMIX_API ALMEnemy : public ACharacter
{ {
@ -31,23 +24,12 @@ public:
protected: protected:
virtual void BeginPlay() override; virtual void BeginPlay() override;
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"), Category = "Legumix")
EEnemyState EnemyState;
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"), Category = "Legumix") UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"), Category = "Legumix")
double AttackingRadius; double AttackingRadius;
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"), Category = "Legumix") UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"), Category = "Legumix")
float AttackingDamage; float AttackingDamage;
/**
* Returns the distance between the enemy and a target.
* @param TargetedActor
* @returns the distance
*/
UFUNCTION(BlueprintCallable, Category="Legumix", meta=(ReturnDisplayName="Distance", DefaultToSelf="TargetedActor"))
double GetDistanceToTarget(const AActor* TargetedActor);
/** /**
* Performs an attack on the targeted pawn * Performs an attack on the targeted pawn
* @param TargetedPawn * @param TargetedPawn

View File

@ -17,4 +17,6 @@ public:
public: public:
ALMHealthPack(); ALMHealthPack();
virtual void ConsumePack(ALMPlayer* Player) override;
}; };

View File

@ -6,6 +6,7 @@
#include "GameFramework/Actor.h" #include "GameFramework/Actor.h"
#include "LMItemDrop.generated.h" #include "LMItemDrop.generated.h"
class ALMPlayer;
class ULMDropData; class ULMDropData;
UCLASS() UCLASS()
@ -17,16 +18,49 @@ protected:
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Legumix) UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Legumix)
float TimeBeforeDespawn = 30.f; float TimeBeforeDespawn = 30.f;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Legumix)
float MoveRate = 0.1f;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Legumix)
float MoveDuration = 1.f;
/** Distance curve from 0-1 to the player. */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Legumix, meta=(AllowPrivateAccess=true))
TObjectPtr<UCurveFloat> PositionAtTime;
FTimerHandle DespawnHandle;
FTimerHandle MoveHandle;
private: private:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true))
TObjectPtr<USceneComponent> Root;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true)) UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true))
TObjectPtr<UStaticMeshComponent> StaticMeshComponent; TObjectPtr<UStaticMeshComponent> StaticMeshComponent;
FTimerHandle DespawnHandle; UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true))
FVector SpawnLocation;
UPROPERTY()
TObjectPtr<AActor> Attractor;
float MoveTime = 0.f;
public: public:
ALMItemDrop(); ALMItemDrop();
virtual void BeginPlay() override; virtual void BeginPlay() override;
void SetAttractor(AActor* Target);
UFUNCTION()
void DoMovingTowardsTarget();
UFUNCTION(BlueprintCallable)
virtual void ConsumePack(ALMPlayer* Player);
UFUNCTION(BlueprintImplementableEvent)
void OnPackConsumed();
FVector GetSpawnLocation() const { return SpawnLocation; }
protected: protected:
UFUNCTION(BlueprintCallable) UFUNCTION(BlueprintCallable)
void Despawn(); void Despawn();

View File

@ -5,6 +5,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "LMBulletInfo.h" #include "LMBulletInfo.h"
#include "LMTeam.h" #include "LMTeam.h"
#include "Ammo/LMAmmoPack.h"
#include "Camera/CameraComponent.h" #include "Camera/CameraComponent.h"
#include "GameFramework/Character.h" #include "GameFramework/Character.h"
#include "LMPlayer.generated.h" #include "LMPlayer.generated.h"
@ -56,6 +57,9 @@ public:
virtual bool CanJumpInternal_Implementation() const override; virtual bool CanJumpInternal_Implementation() const override;
UFUNCTION(BlueprintCallable)
void AddAmmo(EAmmoType Ammo, int AmmoCount);
protected: protected:
// Called when the game starts or when spawned // Called when the game starts or when spawned
virtual void BeginPlay() override; virtual void BeginPlay() override;

View File

@ -54,7 +54,6 @@ private:
UPROPERTY(BlueprintReadOnly, meta = (AllowPrivateAccess = true)) UPROPERTY(BlueprintReadOnly, meta = (AllowPrivateAccess = true))
TObjectPtr<ALMPlayer> LegumixPlayer; TObjectPtr<ALMPlayer> LegumixPlayer;
virtual void SetupInputComponent() override; virtual void SetupInputComponent() override;
void Move(const FInputActionValue& InputValue); void Move(const FInputActionValue& InputValue);
void Jump(const FInputActionValue& InputValue); void Jump(const FInputActionValue& InputValue);
@ -69,10 +68,19 @@ private:
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true, UIMin=0.01, ClampMin=0.01, UIMax=10.0, ClampMax=10.0)) UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true, UIMin=0.01, ClampMin=0.01, UIMax=10.0, ClampMax=10.0))
float Sensitivity = 1.0f; float Sensitivity = 1.0f;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Legumix, meta = (AllowPrivateAccess = true, ClampMin = 0.f))
float SwitchWeaponDelay = 0.1f;
private: private:
UFUNCTION(BlueprintCallable, Category = Legumix) UFUNCTION(BlueprintCallable, Category = Legumix)
void TogglePause(); void TogglePause();
UFUNCTION(BlueprintCallable, Category = Legumix) UFUNCTION(BlueprintCallable, Category = Legumix)
void OnSettingsChanged(); void OnSettingsChanged();
void ScrollEnded();
FTimerHandle ScrollTimer;
bool bIsScrolling;
}; };