51 lines
1.2 KiB
C++
51 lines
1.2 KiB
C++
// 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);
|
|
};
|