Ejemplo n.º 1
0
    public void RspCreateRoom(GameMsg msg)
    {
        audioSvc.PlayAudioInUI(audioSvc.uiAudio);
        RspCreateRoom rspCreateRoom = msg.rspCreateRoom;

        BattleSys.Instance.SetCurrentRoleType(rspCreateRoom.roleType);
        GameRoot.Instance.SetPlayerRoleType((int)rspCreateRoom.roleType);
        GameRoot.AddTips(Constants.GetColorStr("创建房间成功", TextColor.Red));
        EnterRoomWnd();
        roomPanel.CreatePlayerInfoItem(rspCreateRoom.name, rspCreateRoom.victoryNum, false, true, true);
    }
Ejemplo n.º 2
0
    public void CreateRoomItem(RspCreateRoom rspCreateRoom)
    {
        if (rspCreateRoom == null)
        {
            return;
        }
        GameObject go = resSvc.LoadPrefab(PathDefine.RoomItemPrefab);

        go.transform.SetParent(Gride);
        go.transform.localScale = Vector3.one;
        RoomItem roomItem = go.GetComponent <RoomItem>();

        roomItem.SetRoomData(rspCreateRoom.name, rspCreateRoom.victoryNum);
        roomItem.btnJoin.onClick.AddListener(() =>
        {
            int index = rspCreateRoom.id;
            ReqJoinRoom(index);
            PECommon.Log("要加入的房间的id:" + index);
        });
    }