private int[] IdsOfNeededItems(int countOfNeededItems) { List <int> allIds = itemsKeeper.GetIdsOfItems(); int[] ids = new int[countOfNeededItems]; for (int i = 0; i < ids.Length; i++) { ids[i] = allIds[Random.Range(0, allIds.Count)]; allIds.Remove(ids[i]); } return(ids); }