private IEnumerator GameOverSequence(GameController controller, GameOverData gameOverData) { if (controller != null) { controller.HideMenus(); controller.BlockPlayerActions(); } sequence.SetGameOverData(gameOverData); sequence.StartSequence(); yield return(null); inputEnabled = true; yield return(new WaitUntil(() => sequence.completed)); }
public void SetGameOverData(GameOverData gameOverData) { if (gameOverData.defeatedPlayer == 1) { victoryPlayerText.text = gameOverData.player1.name; defeatPlayerText.text = gameOverData.player2.name; elementsToInvert.ToList().ForEach(t => { t.localScale = new Vector3(1, 1, 1); }); } else { // TODO: invert all containers!! victoryPlayerText.text = gameOverData.player2.name; defeatPlayerText.text = gameOverData.player1.name; elementsToInvert.ToList().ForEach(t => { t.localScale = new Vector3(-1, 1, 1); }); } }
public void StartSequence(GameController controller, GameOverData gameOverData) { StartCoroutine(GameOverSequence(controller, gameOverData)); }