private void GenerateNextCharacters() { int emptyCount = characterProvider.GetAllEmptyPosition().Count; if (emptyCount == 0) { StartCoroutine(GameOver()); return; } int countNextCharacters = emptyCount > 3 ? 3 : emptyCount == 1 ? 1 : emptyCount - 1; var prefabIndexs = new int[countNextCharacters]; for (int i = 0; i < countNextCharacters; i++) { prefabIndexs[i] = characterProvider.GetRandomPrefabIndex(); } SetNextCharacters(prefabIndexs); }