コード例 #1
0
        /// <summary>
        /// 准备
        /// </summary>
        /// <param name="pbSeat"></param>
        public void Ready(NN_SEAT_READY proto)
        {
            NiuNiu.Seat seat = GetSeatBySeatPos(proto.nn_seat.pos);
            if (seat == null)
            {
                return;
            }
            seat.IsReady = true;

            //--------------设置开始按钮遮罩---------------
            bool isEnable = false;

            for (int i = 0; i < CurrentRoom.SeatList.Count; i++)
            {
                NiuNiu.Seat readySeat = GetSeatBySeatIndex(i);

                if (readySeat != null && readySeat.PlayerId > 0)
                {
                    Debug.Log(string.Format("座位{0} 玩家是否准备{1}", readySeat.Pos, readySeat.IsReady));
                    if (readySeat.IsReady == false)
                    {
                        isEnable = true;
                        break;
                    }
                }
            }
            Debug.Log("bool isEnable:" + isEnable);
            Debug.Log("bool isEnable设置开始按钮遮罩");
            TransferData dataMask = new TransferData();

            dataMask.SetValue <bool>("OnOff", isEnable);
            ModelDispatcher.Instance.Dispatch(ConstDefine_NiuNiu.ObKey_EnableAllowStartBtn, dataMask);//设置开始游戏按钮遮罩

            //刷新座位UI
            SendRoomInfoChangeNotify();
        }
コード例 #2
0
        /// <summary>
        /// 服务器广播某人准备
        /// </summary>
        /// <param name="obj"></param>
        public void RadioReady(byte[] obj)
        {
            NN_SEAT_READY proto = NN_SEAT_READY.decode(obj);

            RoomNiuNiuProxy.Instance.Ready(proto);
        }