-
Notifications
You must be signed in to change notification settings - Fork 0
/
WaveConfig.cs
41 lines (32 loc) · 1.03 KB
/
WaveConfig.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(menuName = "Enemy Wave Config")]
public class WaveConfig : ScriptableObject
{
[SerializeField] GameObject enemyPrefab;
[SerializeField] GameObject pathPrefab;
[SerializeField] float spawnDelay = 0.5f;
[SerializeField] float spawnRandomFactor = 0.2f;
[SerializeField] int numberOfEnemies = 5;
[SerializeField] float moveSpeed = 2f;
public GameObject GetEnemyPrefab()
{ return enemyPrefab; }
public List<Transform> GetWaypoints()
{
var waveWaypoints = new List<Transform>();
foreach (Transform child in pathPrefab.transform)
{
waveWaypoints.Add(child);
}
return waveWaypoints;
}
public float GetSpawnDelay()
{ return spawnDelay; }
public float GetSpawnRandomFactor()
{ return spawnRandomFactor; }
public int GetNumberofEnemies()
{ return numberOfEnemies; }
public float GetMoveSpeed()
{ return moveSpeed; }
}