public void OnBomBomHided() { var newPowerUps = new List <Chuzzle>(); var usualChuzzles = Gamefield.Level.Chuzzles.Where(ch => !GamefieldUtility.IsPowerUp(ch)).ToList(); for (var i = 0; i < Gamefield.GameMode.Turns; i++) { var newPowerUp = usualChuzzles[UnityEngine.Random.Range(0, usualChuzzles.Count())]; newPowerUps.Add(newPowerUp); usualChuzzles.Remove(newPowerUp); if (!usualChuzzles.Any()) { break; } } Gamefield.GameMode.Turns = 0; StartCoroutine(CreateNewPowerUps(newPowerUps.ToList())); }
public static bool IsPowerUp(this Chuzzle chuzzle) { return(GamefieldUtility.IsPowerUp(chuzzle)); }