コード例 #1
0
ファイル: Main.cs プロジェクト: seeLuck/demo-chat
    public void EnterRoomBack(Proto.EnterRoomRsp msg)
    {
        SocketClient.OnClose(Svr_onClose);
        var trsm = transform.Find("chatPanel");

        trsm.gameObject.SetActive(true);
        trsm.GetComponent <Chat>().Init(msg);
    }
コード例 #2
0
    public void Init(Proto.EnterRoomRsp msg)
    {
        meUid = msg.uid;
        transform.Find("top/roomName").GetComponent <Text>().text = msg.roomName;

        foreach (var one in msg.players)
        {
            NewPlayer(one);
        }

        SocketClient.AddHandler(Cmd.onNewPlayer, Svr_onNewPlayer);
        SocketClient.AddHandler(Cmd.onOneLeave, Svr_onOneLeave);
        SocketClient.AddHandler(Cmd.onChat, Svr_onChat);
    }