private void playerDies(Global.typeOfPlayer player) { Debug.Log("Executando o OnHealthGoesToZero no LevelManager"); if (OnRespaw != null) { foreach (PlayerControl scriptPlayer in listOfPlayers) { if (scriptPlayer.tipo.Equals(player)) { if (canRespaw) { OnRespaw(player); } else { InputController.instance.changePlayer(true); OnKillPlayer(player); qtdMortos++; Debug.Log("Jogador Morreu--> " + player.ToString() + " Posicao->" + qtdMortos); if (qtdMortos == listOfPlayers.Count) { Debug.Log("GAME OVER"); } } } } } }
private void updateHealth(int damage, Global.typeOfPlayer player) { Debug.Log("Executando o OnHurt no ScoreController"); switch (player) { case Global.typeOfPlayer.Player_None: return; default: currentHealth[player] -= damage; Debug.Log("Life " + player.ToString() + " ->" + currentHealth[player]); if (currentHealth[player] <= 0) { if (OnHealthGoesToZero != null) { Debug.Log("Player->" + player.ToString() + " morreu executando OnHealthGoesToZero"); OnHealthGoesToZero(player); } } return; } }