private void SetItemToPlay(int id) { foreach (PlayListItemModel item in playListItems) { if (id == item.id) { itemToPlay = item; } } }
public void AddPlayListItem(string filepath) { GameObject item = Instantiate(playListItemPrefab); item.GetComponentInChildren <Text>().text = Path.GetFileName(filepath); item.transform.SetParent(playListContainer.transform); item.transform.localScale = Vector3.one; PlayListItemModel itemModel = new PlayListItemModel(item.GetInstanceID(), filepath); model.AddPlayListItem(itemModel); }
public void AddPlayListItem(PlayListItemModel item) { lock (playListItems) { playListItems.AddLast(item); } }