enemy spawner
This commit is contained in:
32
Game/Scripts/Runtime/Data/BossSchedule.cs
Normal file
32
Game/Scripts/Runtime/Data/BossSchedule.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Game.Scripts.Runtime.Data
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Game/Spawning/Boss Schedule", fileName = "BossSchedule")]
|
||||
public class BossSchedule : ScriptableObject
|
||||
{
|
||||
[Serializable]
|
||||
public class BossEvent
|
||||
{
|
||||
[Min(0f)] public float TimeSinceStart;
|
||||
public EnemyDefinition Boss;
|
||||
public int Count = 1;
|
||||
[SerializeField] private bool useSpawnRadiusOverride;
|
||||
[SerializeField] private float spawnRadiusOverride = 10f;
|
||||
|
||||
public bool HasSpawnRadiusOverride => useSpawnRadiusOverride;
|
||||
public float SpawnRadiusOverride => spawnRadiusOverride;
|
||||
}
|
||||
|
||||
[SerializeField] private List<BossEvent> events = new();
|
||||
|
||||
public IReadOnlyList<BossEvent> Events => events;
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
events.Sort((a, b) => a.TimeSinceStart.CompareTo(b.TimeSinceStart));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user