public static EnemyWaves Create() { EnemyWaves asset = ScriptableObject.CreateInstance <EnemyWaves> (); AssetDatabase.CreateAsset(asset, "Assets/Levels/Level 0.asset"); AssetDatabase.SaveAssets(); return(asset); }
void Start() { pauseMenuUI.SetActive(false); gameplayControllerUI.SetActive(true); Time.timeScale = 1f; ew = GameController.FindObjectOfType <EnemyWaves>(); ps = GameController.FindObjectOfType <PlayerStats>(); }
private void Awake() { m_EnemyPool = new GameObjectPool(25, m_Prefab, 1, new GameObject("Enemy Parent").transform); m_Vec3Start = new Vector3(mapManager.start.x * 2.0f, 0.8f, mapManager.start.y * 2.0f); if (enemyWaves == null) { enemyWaves = GetComponent <EnemyWaves>(); } enemyWaves.PrepareWaves(); StartCoroutine("SpawnTypes"); }
private IEnumerator StartNewGameInternal() { Utilities.Scene.findExactlyOne <EnemySpawnerController>().Reset(); GameObject.FindWithTag("Player").GetComponentInChildren <PlayerController>().Reset(); menuEvents.ToggleMenuHide(); EnemyWaves enemyWaves = Utilities.Scene.findExactlyOne <EnemyWaves>(); enemyWaves.Reset(); enemyWaves.ForceNextWave(); Utilities.Scene.findExactlyOne <ScoreManager>().Reset(); TogglePause(false); yield break; }
private void Shuffle(EnemyWaves[] array) { int n = array.Length; while (n > 1) { n--; int k = Random.Range(0, n + 1); EnemyWaves value = array[k]; array[k] = array[n]; array[n] = value; } }
private void Start() { GameController = GameObject.Find("GAME CONTROLLER"); wavesCode = GameController.GetComponent <EnemyWaves>(); }
void Start() { enemyWaves = EnemyWaves.Instance; nextWave = GameObject.Find("nextWave").GetComponent <TextMeshProUGUI>(); currentTime = timeUntilFirstWave; }