public void SetUp(Item currentItem, LevelScrollList currentList) { Debug.Log(currentItem); Debug.Log(currentList); item = currentItem; levelNameLabel.text = currentItem.itemName; scrollList = currentList; }
/* request levels to server and add to a list of levels */ private void loadLevels() { ServerHandler server = GameManager.instance.serverManager; Dictionary <string, object> dic; if (GameManager.instance.gameType == GameType.MULTI) { dic = server.request("/sessions/levels/" + GameManager.instance.userAgainst.id); } else { dic = server.request("/levels/"); } if (dic != null) { List <Dictionary <string, object> > information = ((List <Dictionary <string, object> >)dic["content"]); LevelScrollList list = new LevelScrollList(); for (int i = 0; i < information.Count; i++) { levelList.Add(information[i]["nome"].ToString()); } } }
void Start() { scrollList = GetComponentInParent<LevelScrollList> (); }