// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "GameFramework/Actor.h" #include "Weapon.generated.h" UENUM(BlueprintType) enum class EWeaponState : uint8 { EWS_Initial UMETA(DisplayName = "Initial State"), EWS_Equipped UMETA(DisplayName = "Equipped"), EWS_Dropped UMETA(DisplayName = "Dropped"), EWS_MAX UMETA(DisplayName = "DefaultMAX") }; UCLASS() class BLASTER_API AWeapon : public AActor { GENERATED_BODY() public: AWeapon(); void ShowPickupWidget(bool bShowWidget); protected: virtual void BeginPlay() override; UFUNCTION() virtual void OnSphereOverlap( UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult ); UFUNCTION() virtual void OnSphereEndOverlap( UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex ); private: UPROPERTY(VisibleAnywhere, Category="Weapon Properties") USkeletalMeshComponent* WeaponMesh; UPROPERTY(VisibleAnywhere, Category="Weapon Properties") class USphereComponent* AreaSphere; UPROPERTY(VisibleAnywhere) EWeaponState WeaponState; UPROPERTY(VisibleAnywhere, Category="Weapon Properties") class UWidgetComponent* PickupWidget; public: FORCEINLINE void SetWeaponState(EWeaponState State) { WeaponState = State; }; };