Пример #1
0
    IEnumerator StartNewGame()
    {
        _uiManager.ToggleLoadingScreen(true);
        yield return(new WaitForSeconds(1f));

        LeftBoard.TogglePlayer(false);
        RightBoard.TogglePlayer(false);
        _uiManager.PreGameScreen.SetActive(false);
        _uiManager.GameBoardScreen.SetActive(true);
        LeftBoard.ResetValues(true);
        RightBoard.ResetValues(true);
        List <PlayCard_script> pcs = new List <PlayCard_script>();

        pcs.AddRange(LeftBoard.DiscardPile.GetComponentsInChildren <PlayCard_script>());
        pcs.AddRange(LeftBoard._mainCardBoard.GetComponentsInChildren <PlayCard_script>());
        pcs.AddRange(LeftBoard._handCardBoard.GetComponentsInChildren <PlayCard_script>());
        pcs.AddRange(RightBoard._mainCardBoard.GetComponentsInChildren <PlayCard_script>());
        pcs.AddRange(RightBoard._handCardBoard.GetComponentsInChildren <PlayCard_script>());
        foreach (PlayCard_script pc in pcs)
        {
            pc.DestroyCard();
        }
        //screen transition etc
        yield return(new WaitForSeconds(1f));

        GenerateDecks();
        yield return(new WaitForSeconds(1f));

        DetermingStartingPlayer();
        _uiManager.ToggleEndScreen(false, false);
        _uiManager.ResetUI();
        GameStage = 1;
        StartGame();
        _uiManager.ToggleLoadingScreen(false);
    }
Пример #2
0
    IEnumerator CheckLoadingDone()
    {
        if (!PlayerdLoadingDone || !_csvImporter.CSVLoadingDone) //wait for all AI images to load
        {
            yield return(new WaitForSeconds(1f));

            yield return(null);
        }
        _uiManager.ToggleLoadingScreen(false);
    }