Beispiel #1
0
    public override void initState(ResponseBase res)
    {
        base.initState(res);
        this.gameObject.SetActive(true);
        // if(res != null)
        // {
        //     updateRoomList(res);
        // }
        // else
        // {
        //     RequestRoomList req = new RequestRoomList(1, Common.LIST_COUNT);
        //     SocketManager.Instance().sendMessage(req);
        // }

        for (int i = 0; i < Common.LIST_COUNT; i++)
        {
            GameObject item       = Instantiate(roomItem) as GameObject;
            RoomItem   itemSource = item.GetComponent <RoomItem>();
            itemSource.delegateClick += onClick;
            itemSource.setIndex(i);
            item.SetActive(false);
            listItem.Add(item);
            item.transform.parent = content.transform;
        }
        //updateRoomList();

        RequestRoomList req = new RequestRoomList(current, Common.LIST_COUNT);

        SocketManager.Instance().sendMessage(req);
    }
Beispiel #2
0
 public void onBefore()
 {
     if (current <= 1)
     {
         Debug.Log("start point");
     }
     else
     {
         RequestRoomList list = new RequestRoomList(current - 1, Common.LIST_COUNT);
         SocketManager.Instance().sendMessage(list);
     }
 }
Beispiel #3
0
    public void onNext()
    {
        // string req = "http://" + Common.getIp()+":8895"+"?gameRoomList";
        //Debug.Log("req ip : " + req);
        //httpManager.sendRequest(req);
        int currentCount = current * Common.LIST_COUNT;

        if (currentCount >= maxCount)
        {
            Debug.Log("end count");
        }
        else
        {
            RequestRoomList list = new RequestRoomList(current + 1, Common.LIST_COUNT);
            SocketManager.Instance().sendMessage(list);
        }
    }
Beispiel #4
0
    public void onReflush()
    {
        RequestRoomList req = new RequestRoomList(current, Common.LIST_COUNT);

        SocketManager.Instance().sendMessage(req);
    }