38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using UnityEngine;
|
|
using UnityEngine.Playables;
|
|
|
|
namespace OctoberStudio.Timeline
|
|
{
|
|
public class BurstWave : WaveAsset
|
|
{
|
|
[Header("Burst Settings")]
|
|
[SerializeField, Min(1)] int enemiesCount = 1;
|
|
[SerializeField, Min(1)] int burstCount = 1;
|
|
|
|
public override int EnemiesCount => (int)(enemiesCount * 1.2f);
|
|
|
|
public BurstWaveBehavior template;
|
|
|
|
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
|
|
{
|
|
var wavePlayable = ScriptPlayable<BurstWaveBehavior>.Create(graph, template);
|
|
var waveData = wavePlayable.GetBehaviour();
|
|
|
|
waveData.EnemyType = EnemyType;
|
|
|
|
waveData.BurstCount = burstCount;
|
|
waveData.EnemiesCount = enemiesCount;
|
|
|
|
waveData.WaveOverride = waveOverride;
|
|
waveData.CircularSpawn = circularSpawn;
|
|
|
|
return wavePlayable;
|
|
}
|
|
|
|
private void OnValidate()
|
|
{
|
|
if (enemiesCount < 0) enemiesCount = 0;
|
|
if (burstCount < 0) burstCount = 0;
|
|
}
|
|
}
|
|
} |