blaster/Source/Blaster/Pickups/Pickup.h

59 lines
1.2 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Blaster/Character/BlasterCharacter.h"
#include "GameFramework/Actor.h"
#include "Pickup.generated.h"
UCLASS()
class BLASTER_API APickup : public AActor
{
GENERATED_BODY()
public:
APickup();
virtual void Tick(float DeltaTime) override;
virtual void Destroyed() override;
protected:
virtual void BeginPlay() override;
UFUNCTION()
virtual void OnSphereOverlap(
UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
UPrimitiveComponent* OtherComp,
int32 OtherBodyIndex,
bool bFromSweep,
const FHitResult& SweepResult
);
virtual void OnOverlap(ABlasterCharacter* BlasterCharacter);
UPROPERTY(EditAnywhere)
float BaseTurnRate = 45.f;
FTimerHandle BindOverlapTimer;
float BindOverlapTime = 0.25f;
void BindOverlapTimerFinished();
private:
UPROPERTY(EditAnywhere)
class USphereComponent* OverlapSphere;
UPROPERTY(EditAnywhere)
class USoundCue* PickupSound;
UPROPERTY(EditAnywhere)
UStaticMeshComponent* PickupMesh;
UPROPERTY(VisibleAnywhere)
class UNiagaraComponent* PickupEffectComponent;
UPROPERTY(EditAnywhere)
class UNiagaraSystem* PickupEffect;
};