blaster/Source/Blaster/Pickups/PickupSpawnPoint.h

42 lines
789 B
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "PickupSpawnPoint.generated.h"
UCLASS()
class BLASTER_API APickupSpawnPoint : public AActor
{
GENERATED_BODY()
public:
APickupSpawnPoint();
virtual void Tick(float DeltaTime) override;
protected:
virtual void BeginPlay() override;
UPROPERTY(EditAnywhere)
TArray<TSubclassOf<class APickup>> PickupClasses;
UPROPERTY()
APickup* SpawnedPickup;
UPROPERTY(EditAnywhere)
float SpawnPickupTimeMin;
UPROPERTY(EditAnywhere)
float SpawnPickupTimeMax;
void SpawnPickup();
UFUNCTION()
void StartSpawnPickupTimer(AActor* Destroyed);
void SpawnPickupTimerFinished();
private:
FTimerHandle SpawnPickupTimer;
};