Add EnemyWave and EnemyWavesManager classes; implement enemy spawning system for wave-based gameplay
This commit is contained in:
28
Assets/Scripts/Data/EnemyWave.cs
Normal file
28
Assets/Scripts/Data/EnemyWave.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Sirenix.OdinInspector;
|
||||
using Sirenix.Serialization;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Data
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Game/Wave")]
|
||||
public class EnemyWave : ScriptableObject
|
||||
{
|
||||
[TableList]
|
||||
[OdinSerialize] public List<EnemySpawnInfo> spawns = new();
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class EnemySpawnInfo
|
||||
{
|
||||
[HorizontalGroup("Row", width: 80)]
|
||||
[OdinSerialize, PreviewField(80)] public GameObject enemyPrefab;
|
||||
|
||||
[HorizontalGroup("Row")]
|
||||
[OdinSerialize] public int count = 1;
|
||||
|
||||
[HorizontalGroup("Row")] [OdinSerialize]
|
||||
public float spawnInterval = 0.5f;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user