Ejemplo n.º 1
0
 public void StartWaves()
 {
     waveNumber   = 0;
     currentPhase = WaveManagerPhase.Rest;
     Debug.Log("Start waves");
     if (gameStartEvent != null)
     {
         gameStartEvent.Invoke(Waves.Length);
     }
     FinanceManager.AddCoin(startMoney);
     StartCoroutine("WaveQueueRoutine");
 }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
    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();
        }
    }
Ejemplo n.º 4
0
    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();
        }
    }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
 public void GameStartEventCall()
 {
     GameStartEvent?.Invoke();
 }
Ejemplo n.º 7
0
 public void GetGameStarted()
 {
     GameStartEvent?.Invoke();
 }
Ejemplo n.º 8
0
 public void OnGameStart()
 {
     IsWorking   = true;
     State.value = PlayState.Playing;
     GameStartEvent?.Invoke();
 }
Ejemplo n.º 9
0
 public void Start()
 {
     GameStartEvent.Invoke();
 }
Ejemplo n.º 10
0
 public static void GameStartEventInvoke()
 {
     GameStartEvent.Invoke();
 }
Ejemplo n.º 11
0
 public void OnGameStartEvent(object sender, GameStartArgs e)
 {
     GameStartEvent?.Invoke(sender, e);
 }