예제 #1
0
    public void SetUp(Item currentItem, LevelScrollList currentList)
    {
        Debug.Log(currentItem);
        Debug.Log(currentList);
        item = currentItem;
        levelNameLabel.text = currentItem.itemName;

        scrollList = currentList;
    }
예제 #2
0
    /* 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());
            }
        }
    }
예제 #3
0
 void Start()
 {
     scrollList = GetComponentInParent<LevelScrollList> ();
 }