/// <summary> /// Startings the game handle. /// </summary> /// <returns>The game handle.</returns> IEnumerator <float> StartingGameHandle() { // TODO: waiting time. yield return(Timing.WaitForSeconds(0.5f)); // TODO: showing the dialog. Debug.Log("KLONDIKE StartingGameHandle " + GameManager.Instance.GetModeGame()); if (GameManager.Instance.GetModeGame() == Enums.ModeGame.None) { DialogSystem.Instance.ShowDialogNewGame(); } else { DialogNewGame.updateMode(GameManager.Instance.GetModeGame()); } // TODO: waiting. while (GameManager.Instance.GetStateGame() != Enums.StateGame.Start) { yield return(0f); } Debug.Log("KLONDIKE StartingGameHandle after while"); // TODO: Init the functions Init(); // TODO: Count the number cards will be used. Contains.TotalCardsAreUsing = cardsGet.Count; // TODO: Create the cards will be return to pools. var paramIn = new List <CardBehaviour> (cardsGet); // TODO: Clear all the cards to prepare add the new cards. cardsGet.Clear(); // TODO: Get the new cards. cardsGet.AddRange(Helper.SortRandom(paramIn)); yield return(0f); }