Example #1
0
    private IEnumerator GetNextGeneration()
    {
        if (!isStarted)
        {
            yield return(new WaitUntil(() => isStarted));

            controller.GameObjectMatrix(matrix);
            controller.HideObjectsWithGreyColor();
        }

        PlayLife();
        yield return(new WaitForSeconds(TIME_TO_NEXT_GENERATION));

        if (controller.CellCount == 0 || controller.CheckIfThisTheEnd())
        {
            PlayGame();
        }
        StartCoroutine(GetNextGeneration());
    }