#pragma once #include "CoreMinimal.h" #include "GameFramework/GameModeBase.h" #include "SpaceShooterGameMode.generated.h" UCLASS() class MYPROJECT3_API ASpaceShooterGameMode : public AGameModeBase { GENERATED_BODY() public: ASpaceShooterGameMode(); virtual void StartPlay() override; virtual void Tick(float DeltaTime) override; protected: UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning") TSubclassOf EnemyClass; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning") float EnemySpawnInterval = 2.0f; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning") int32 MaxEnemies = 10; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning") float MinSpawnRadius = 1000.0f; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning") float MaxSpawnRadius = 2000.0f; private: FTimerHandle EnemySpawnTimer; void SpawnEnemy(); FVector GetRandomSpawnLocation(); };