private static void SetCandy(MatchThree_Cell firstCell, MatchThree_Types types) { MatchThree_Cell cell = firstCell; MatchThree_Candy newCandy = types.GetRandomCandy(); while (!IsFreeCandyPlacement(cell, newCandy.CandyData.Id)) { Destroy(newCandy.gameObject); newCandy = types.GetRandomCandy(); } cell.Candy = newCandy; cell.Candy.transform.position = cell.transform.position; }