public void StartWaves() { waveNumber = 0; currentPhase = WaveManagerPhase.Rest; Debug.Log("Start waves"); if (gameStartEvent != null) { gameStartEvent.Invoke(Waves.Length); } FinanceManager.AddCoin(startMoney); StartCoroutine("WaveQueueRoutine"); }
void Start() { itemsToInject.Add(config); itemsToInject.Add(new GameData()); systems = FindObjectsOfType <GameSystem>().ToDictionary(x => x.GetType(), x => x); ProcessInstallers(); GameData = itemsToInject.First(x => x.GetType() == typeof(GameData)) as GameData; PlayerData = itemsToInject.First(x => x.GetType() == typeof(PlayerData)) as PlayerData; GamePreStartEvent?.Invoke(); GameStartEvent?.Invoke(); LaunchStates(); }
public IEnumerator ToggleMenuDelay(bool toggle) { //MenuOpenEvent?.Invoke(toggle); if (toggle == true) { yield return(null); GameManager.Instance.GameState = GameManager.GameStates.Paused; } else { yield return(new WaitForSeconds(0.1f)); GameManager.Instance.GameState = GameManager.GameStates.LevelStarted; GameStart?.Invoke(); } }
public IEnumerator ToggleMenuDelay(bool toggle) { MenuOpenEvent?.Invoke(toggle); menuCanvas.SetActive(toggle); uiCanvas.SetActive(!toggle); if (toggle == true) { yield return(null); GameManager.Instance.GameState = GameManager.GameStates.Paused; } else { yield return(new WaitForSeconds(0.5f)); GameManager.Instance.GameState = GameManager.GameStates.Player; GameStart?.Invoke(); } }
private IEnumerator UpdateGameState() { if (this.isGameActive) { yield break; } this.isGameActive = true; GameStartEvent?.Invoke(this, null); this.remainingTime = this.maxTime; while (this.remainingTime > 0) { this.remainingTime -= Time.deltaTime; yield return(null); } this.remainingTime = 0; this.isGameActive = false; GameEndEvent?.Invoke(this, null); }
public void GameStartEventCall() { GameStartEvent?.Invoke(); }
public void GetGameStarted() { GameStartEvent?.Invoke(); }
public void OnGameStart() { IsWorking = true; State.value = PlayState.Playing; GameStartEvent?.Invoke(); }
public void Start() { GameStartEvent.Invoke(); }
public static void GameStartEventInvoke() { GameStartEvent.Invoke(); }
public void OnGameStartEvent(object sender, GameStartArgs e) { GameStartEvent?.Invoke(sender, e); }