private IEnumerator WaveSwitchRoutine() { while (!nextWaveTimer.Count()) { //waveText.text = "Next wave in " + Mathf.Ceil(nextWaveTimer.Countdown); yield return(null); } SwitchWave(); }
private IEnumerator SpawnRoutine() { while (mobsSpawned < tMobsAmount) { if (spawnTimer.Count(T_SPAWN_ROUTINE)) { PickRandomSpawner().Spawn().transform.parent = transform; mobsSpawned++; spawnTimer.Reset(); } yield return(new WaitForSeconds(T_SPAWN_ROUTINE)); } }
public void CaptureDash() { if (dashState == DashStates.ALLOWED) { if (Input.GetKeyDown(rightKey)) { prevPress = rightKey; dashState = DashStates.WAITING_INPUT; } else if (Input.GetKeyDown(leftKey)) { prevPress = leftKey; dashState = DashStates.WAITING_INPUT; } } else if (dashState == DashStates.WAITING_INPUT) { if (waitInputTimer.Count()) { dashState = DashStates.ALLOWED; } else if (Input.GetKeyDown(rightKey) && prevPress == rightKey) { dashState = DashStates.DASHING; direction = 1f; } else if (Input.GetKeyDown(leftKey) && prevPress == leftKey) { dashState = DashStates.DASHING; direction = -1f; } else if (Input.GetKeyDown(rightKey) && prevPress == leftKey) { dashState = DashStates.ALLOWED; } else if (Input.GetKeyDown(leftKey) && prevPress == rightKey) { dashState = DashStates.ALLOWED; } } else if (dashState == DashStates.BLOCKED) { if (blockTimer.Count()) { dashState = DashStates.ALLOWED; } } }