33 lines
1001 B
C#
33 lines
1001 B
C#
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));
|
|
}
|
|
}
|
|
}
|