You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
896 B
45 lines
896 B
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Wave.h"
|
|
#include "Subsystems/GameInstanceSubsystem.h"
|
|
#include "WaveSubsystem.generated.h"
|
|
|
|
/**
|
|
*
|
|
*/
|
|
UCLASS()
|
|
class SPACEBATTLER_API UWaveSubsystem : public UGameInstanceSubsystem
|
|
{
|
|
GENERATED_BODY()
|
|
public:
|
|
UFUNCTION(BlueprintCallable)
|
|
void Init(TArray<UWave*> InWaves, int32 CurrWave);
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
int32 SpawnWave(float InVerticalSpacing, float InHorizontalOffset, int InNumRows);
|
|
|
|
protected:
|
|
void SpawnUnits();
|
|
|
|
UPROPERTY()
|
|
TArray<UWave*> Waves;
|
|
|
|
UPROPERTY(BlueprintReadOnly)
|
|
int32 CurrentWave;
|
|
|
|
UPROPERTY()
|
|
TArray<UUnitInfo*> SpawnQueue;
|
|
|
|
UPROPERTY(BlueprintReadWrite)
|
|
UPrimaryDataAsset* SelectedStage;
|
|
|
|
FTimerHandle SpawnTimerHandle;
|
|
int32 NumRows;
|
|
int32 LastSpawnIndex;
|
|
float VerticalSpacing;
|
|
float HorizontalOffset;
|
|
};
|