Esempio n. 1
0
    public void SetUI(TransferData data)
    {
        float time = data.GetValue <float>(ConstDefine.GameLevelPassTime);
        //lblPassTime.SetText(string.Format("通关时间:<color=#ff0000>{0}秒</color>", time.ToString("f0")), true, DG.Tweening.ScrambleMode.None);
        //lblExp.SetText(data.GetValue<int>(ConstDefine.GameLevelExp).ToString(), true, DG.Tweening.ScrambleMode.Numerals);
        //lblGold.SetText(data.GetValue<int>(ConstDefine.GameLevelGold).ToString(), true, DG.Tweening.ScrambleMode.Numerals);

        //获得的星级 1-3
        int star = data.GetValue <int>(ConstDefine.GameLevelStar);

        for (int i = 0; i < m_Stars.Length; i++)
        {
            if (i >= star)
            {
                break;
            }
            m_Stars[i].gameObject.SetActive(true);
        }

        //接收奖励的物品
        List <TransferData> lstReward = data.GetValue <List <TransferData> >(ConstDefine.GameLevelReward);

        if (lstReward.Count > 0)
        {
            for (int i = 0; i < lstReward.Count; i++)
            {
                m_RewardViews[i].gameObject.SetActive(true);
                m_RewardViews[i].SetUI(lstReward[i].GetValue <string>(ConstDefine.GoodsName), lstReward[i].GetValue <int>(ConstDefine.GoodsId), lstReward[i].GetValue <GoodsType>(ConstDefine.GoodsType));
            }
        }
    }
Esempio n. 2
0
    /// <summary>
    /// 组合完成显示组合完成的图片
    /// </summary>
    /// <param name="data"></param>
    private void SetEndIamge(TransferData data)
    {
        SeatEntity  seat       = data.GetValue <SeatEntity>("Seat");
        ROOM_STATUS roomStatus = data.GetValue <ROOM_STATUS>("RoomStatus");

        SetSeatInfo(seat, roomStatus);
    }
Esempio n. 3
0
    /// <summary>
    /// 离开房间
    /// </summary>
    /// <param name="obj"></param>
    private void OnLeaveRoom(TransferData data)
    {
        int groupId = data.GetValue <int>("GroupId");

        if (groupId != m_GroupId)
        {
            return;
        }
        int roomId   = data.GetValue <int>("RoomId");
        int playerId = data.GetValue <int>("PlayerId");

        for (int i = 0; i < m_RoomList.Count; ++i)
        {
            if (m_RoomList[i].RoomId != roomId)
            {
                continue;
            }
            UIItemChatRoom room = m_RoomList[i];
            if (room.PlayerList == null)
            {
                Debug.LogError("?????");
                break;
            }
            for (int j = 0; j < room.PlayerList.Count; ++j)
            {
                if (room.PlayerList[j].PlayerId == playerId)
                {
                    room.PlayerList[j].SetUI(groupId, roomId, 0, string.Empty, false);
                    break;
                }
            }
        }
    }
Esempio n. 4
0
    private void OnSeatInfoChanged(TransferData data)
    {
        SeatEntity seat = data.GetValue <SeatEntity>("Seat");
        RoomEntity room = data.GetValue <RoomEntity>("Room");

        roomPlay = room.roomPlay;
        bool isPlayer = data.GetValue <bool>("IsPlayer");

        if (isPlayer)
        {
            if (room.roomStatus == ROOM_STATUS.GROUPPOKER)
            {
                if (seat.seatStatus == SEAT_STATUS.GROUP)
                {
#if IS_BAODINGQIPAI
                    GroupPokerObj.SetActive(true);//显示组合界面
                    InstantiationPoker(seat, groupPokerPointArry, true);
#else
                    CombinationObj.SetActive(true);//显示组合界面
                    OpenPoker(seat, room);
                    OpenInvertedTime(seat);
                    SetGroupRoomPoker(room);//加载已经发过的牌//加载已发过的牌
#endif
                }
            }
            if (room.roomStatus == ROOM_STATUS.CUOPAI)
            {
                if (seat.isCuoPai == 2)
                {
                    seat.groupTime = room.roomUnixtime;
                    RubPoker(seat, room);
                }
            }
        }
    }
Esempio n. 5
0
    public override void SetUI(TransferData data)
    {
        base.SetUI(data);
        int loop = data.GetValue <int>("Loop");

        m_Number.SafeSetText(string.Format("第{0}局", loop));

        List <TransferData> lstPlayer = data.GetValue <List <TransferData> >("Player");

        Close();
        for (int i = 0; i < m_TextScores.Length; i++)
        {
            if (i < lstPlayer.Count)
            {
                m_TextScores[i].gameObject.SetActive(true);
                m_TextScores[i].SafeSetText(lstPlayer[i].GetValue <int>("Gold").ToString());
                for (int j = 0; j < lstPlayer[i].GetValue <List <TransferData> >("Pokers").Count; j++)
                {
                    GameObject go = ZJHPrefabManager.Instance.RecordLoadPoker(lstPlayer[i].GetValue <List <TransferData> >("Pokers")[j].GetValue <int>("Size"), lstPlayer[i].GetValue <List <TransferData> >("Pokers")[j].GetValue <int>("Color"), null, "normalpoker");
                    go.transform.SetParent(pokerTran[i]);
                    go.transform.localPosition = Vector3.zero;
                    go.transform.localScale    = new Vector3(0.5f, 0.5f, 0.5f);
                }
            }
            else
            {
                m_TextScores[i].gameObject.SetActive(false);
            }
        }
    }
Esempio n. 6
0
    /// <summary>
    /// 移除房间
    /// </summary>
    /// <param name="data"></param>
    private void OnRemoveRoom(TransferData data)
    {
        int groupId = data.GetValue <int>("GroupId");

        if (groupId != m_GroupId)
        {
            return;
        }
        int roomId = data.GetValue <int>("RoomId");

        for (int i = 0; i < m_RoomList.Count; ++i)
        {
            if (roomId == m_RoomList[i].RoomId)
            {
                UIItemChatRoom item = m_RoomList[i];
                UIPoolManager.Instance.Despawn(item.transform);
                m_RoomList.Remove(item);

                for (int j = 0; j < item.PlayerList.Count; ++j)
                {
                    UIPoolManager.Instance.Despawn(item.PlayerList[j].transform);
                    m_RoomPlayerList.Remove(item.PlayerList[j]);
                }
                break;
            }
        }
    }
Esempio n. 7
0
    /// <summary>
    /// 打开大转盘旋转开关
    /// </summary>
    /// <param name="data"></param>
    public void StartTurn(TransferData data)
    {
        int giftIndex   = data.GetValue <int>("giftIndex");
        int surPlusTime = data.GetValue <int>("time");
        int totalTime   = data.GetValue <int>("timeTotal");

        //string message = data.GetValue<string>("message");
        //int giftCallBackNum = data.GetValue<int>("giftCallBackNum");
        //GiftType giftType = data.GetValue<GiftType>("giftType");

        //GetComponent<UILotteryWheelInfo>().SetGiftCallBackData(giftIndex, message, surPlusTime, totalTime, giftCallBackNum, giftType);
        //GetComponent<UILotteryWheelInfo>().SetGiftCallBackData(giftIndex, message, surPlusTime, totalTime);
        GetComponent <UILotteryWheelInfo>().SetGiftCallBackData(giftIndex, surPlusTime, totalTime);

        //surPlusTimeText.SafeSetText(surPlusTime.ToString());
        //surPlusTotalTimeText.SafeSetText(totalTime.ToString());

        for (int i = 0; i < giftRawImage.Length; ++i)
        {
            UIGiftInfo info = giftRawImage[i].gameObject.GetComponent <UIGiftInfo>();
            if (info.GetUIGiftIndex() == giftIndex)
            {
                choiceTargetIndex = info.GetUIGiftIndex();
                choiceTargetNum   = i + 1;
                if (choiceTargetNum == 12)
                {
                    choiceTargetNum = 0;
                }
            }
        }
        if (!isStartTurn)
        {
            isStartTurn = true;
        }
    }
Esempio n. 8
0
    private void TellCutPoker(TransferData data)
    {
        bool       isCut    = data.GetValue <bool>("isCut");
        bool       isWait   = data.GetValue <bool>("isWait");
        bool       IsPlayer = data.GetValue <bool>("IsPlayer");
        long       unixtime = data.GetValue <long>("Unixtime");
        SeatEntity seat     = data.GetValue <SeatEntity>("Seat");

        OpenInvertedTime(unixtime);
        if (IsPlayer)
        {
            onComplete       = OnCutPokerEnd;//添加委托
            isSendNoCutPoker = true;
            if (m_CutPokerObj)
            {
                m_CutPokerObj.SetActive(isCut);
            }
            m_CutPokerImage.SetActive(false);
        }
        else
        {
            if (isCut && isWait)
            {
                m_CutPokerImage.SetActive(isWait || isCut);
                string cutPokerText = string.Format("{0} 切牌中...", seat.Nickname);
                m_CutPokerText.text = cutPokerText;
            }
        }
    }
Esempio n. 9
0
    public void SetUI(TransferData data)
    {
        m_GameLevelId = data.GetValue <int>(ConstDefine.GameLevelId);

        AssetBundleMgr.Instance.LoadOrDownload <Sprite>(string.Format("Download/Source/UISource/GameLevel/GameLevelDetail/{0}.assetbundle", data.GetValue <string>(ConstDefine.GameLevelDlgPic)), data.GetValue <string>(ConstDefine.GameLevelDlgPic), (Sprite obj) =>
        {
            imgDetail.overrideSprite = obj;
        }, type: 1);
        lblGameLevelName.SetText(data.GetValue <string>(ConstDefine.GameLevelName));

        //lblExp.SetText(data.GetValue<int>(ConstDefine.GameLevelExp).ToString(), true, DG.Tweening.ScrambleMode.Numerals);
        //lblGold.SetText(data.GetValue<int>(ConstDefine.GameLevelGold).ToString(), true, DG.Tweening.ScrambleMode.Numerals);
        lblDescription.SetText(data.GetValue <string>(ConstDefine.GameLevelDesc), true);
        lblCondition.SetText(data.GetValue <string>(ConstDefine.GameLevelConditionDesc), true);
        //lblCommendFighting.SetText(data.GetValue<int>(ConstDefine.GameLevelCommendFighting).ToString(), true, DG.Tweening.ScrambleMode.Numerals);

        //接收奖励的物品
        List <TransferData> lstReward = data.GetValue <List <TransferData> >(ConstDefine.GameLevelReward);

        for (int i = 0; i < rewards.Length; i++)
        {
            rewards[i].gameObject.SetActive(false);
        }

        if (lstReward.Count > 0)
        {
            for (int i = 0; i < lstReward.Count; i++)
            {
                rewards[i].gameObject.SetActive(true);

                rewards[i].SetUI(lstReward[i].GetValue <string>(ConstDefine.GoodsName), lstReward[i].GetValue <int>(ConstDefine.GoodsId), lstReward[i].GetValue <GoodsType>(ConstDefine.GoodsType));
            }
        }
    }
Esempio n. 10
0
    private void OnApplyInfoChanged(TransferData obj)
    {
        int currentPlayerCount = obj.GetValue <int>("CurrentPlayerCount");
        int maxPlayerCount     = obj.GetValue <int>("MaxPlayerCount");

        SetUI(currentPlayerCount, maxPlayerCount);
    }
Esempio n. 11
0
    public void SetUI(TransferData data)
    {
        List <TransferData> lstRanking  = data.GetValue <List <TransferData> >("Ranking");
        RankingListType     rankingType = data.GetValue <RankingListType>("RankingType");

        for (int i = 0; i < m_Cache.Count; ++i)
        {
            UIPoolManager.Instance.Despawn(m_Cache[i].transform);
        }
        m_Cache.Clear();
        for (int i = 0; i < lstRanking.Count; ++i)
        {
            string        nickname = lstRanking[i].GetValue <string>("NickName");
            string        avatar   = lstRanking[i].GetValue <string>("Avatar");
            int           score    = lstRanking[i].GetValue <int>("Score");
            UIItemRanking item     = UIPoolManager.Instance.Spawn("UIItemRanking").GetComponent <UIItemRanking>();
            m_Cache.Add(item);
            item.gameObject.SetParent(m_Container);
            item.SetUI(i + 1, nickname, avatar, score, rankingType);
        }

        if (m_Description != null)
        {
            m_Description.SafeSetText(string.Format(m_Content, rankingType == RankingListType.Count? "局数" : "积分"));
        }
    }
Esempio n. 12
0
    public void SetUI(TransferData data)
    {
        ExchangeRecordEntity exchangeRecordEntity = data.GetValue <ExchangeRecordEntity>("ExchangeRecordEntity");

        prizeType = data.GetValue <PrizeType>("PrizeType");
        index     = exchangeRecordEntity.id;
        exchangeDateText.SafeSetText(exchangeRecordEntity.date.ToString());
        exchangeTimeText.SafeSetText(exchangeRecordEntity.add_time.ToString());
        exchangeGoodsText.SafeSetText(exchangeRecordEntity.name.ToString());
        status = exchangeRecordEntity.status;
        SortSilbing();
        if (status == 0)
        {
            btn_exchangeState.gameObject.SetActive(true);
        }
        else if (status == 1)
        {
            GiftReceived();
            exchangeFictitiousStateObj.SetActive(true);
            exchangeActualStateObj.SetActive(false);
        }
        else
        {
            GiftReceived();
            exchangeFictitiousStateObj.SetActive(false);
            exchangeActualStateObj.SetActive(true);
        }
    }
Esempio n. 13
0
    /// <summary>
    /// 座位信息变更回调
    /// </summary>
    /// <param name="obj"></param>
    private void OnSeatInfoChanged(TransferData data)
    {
        if (seatMask.activeSelf)
        {
            seatMask.GetComponent <ItemSeatMask>().OnBtnClik();
        }
        SeatEntity       seat       = data.GetValue <SeatEntity>("Seat");
        RoomEntity       room       = data.GetValue <RoomEntity>("Room");
        bool             isPlayer   = data.GetValue <bool>("IsPlayer");
        ENUM_ROOM_STATUS roomStatus = data.GetValue <ENUM_ROOM_STATUS>("RoomStatus");

        if (isPlayer || RoomZhaJHProxy.Instance.PlayerSeat == seat)
        {
            if (seat.pos == 7)
            {
                m_ButtonLicensing.gameObject.SetActive(false);
                m_ButtonReady.gameObject.SetActive(false);
                //检查手机上是否有微信,如果有的话打开微信邀请按钮
                if (!SystemProxy.Instance.IsInstallWeChat || !SystemProxy.Instance.IsOpenWXLogin)
                {
                    if (m_ButtonShare != null)
                    {
                        m_ButtonShare.gameObject.SetActive(false);
                    }
                }
                else
                {
                    m_ButtonShare.gameObject.SetActive(true);
                }
            }
            else
            {
                m_ButtonReady.gameObject.SetActive(room.currentLoop != room.maxLoop && (seat.seatStatus == ENUM_SEAT_STATUS.IDLE || seat.seatStatus == ENUM_SEAT_STATUS.SETTLEMENT) && (roomStatus == ENUM_ROOM_STATUS.MATCH_STATUS_RESULT || roomStatus == ENUM_ROOM_STATUS.IDLE || roomStatus == ENUM_ROOM_STATUS.SETTLEMENT));
                if (room.roomSettingId == RoomMode.Senior)
                {
                    m_ButtonLicensing.gameObject.SetActive(false);
                }
                else
                {
                    m_ButtonLicensing.gameObject.SetActive(room.currentLoop == 0 && seat.homeLorder && (roomStatus == ENUM_ROOM_STATUS.IDLE || roomStatus == ENUM_ROOM_STATUS.ROOMDISSOLUTION)); //&& seat.LicensingButton == true  if (seat.pos == 1)
                    if (roomStatus == ENUM_ROOM_STATUS.IDLE)
                    {
                        m_ButtonLightPoker.gameObject.SetActive(false);
                    }
                    //else m_ButtonLicensing.gameObject.SetActive(false);
                }
                if (!SystemProxy.Instance.IsInstallWeChat || !SystemProxy.Instance.IsOpenWXLogin)
                {
                    if (m_ButtonShare != null)
                    {
                        m_ButtonShare.gameObject.SetActive(false);
                    }
                }
                else
                {
                    m_ButtonShare.gameObject.SetActive((seat.seatStatus == ENUM_SEAT_STATUS.IDLE || seat.seatStatus == ENUM_SEAT_STATUS.READY) && seat.homeLorder && roomStatus == ENUM_ROOM_STATUS.IDLE && room.roomSettingId != RoomMode.Senior);
                }
            }
        }
    }
Esempio n. 14
0
    /// <summary>
    /// 当玩家处于下注时,重连的显示按钮
    /// </summary>
    /// <param name="data"></param>
    public void SetSeatInfoOperation(TransferData data)
    {
        SeatEntity       seat        = data.GetValue <SeatEntity>("Seat");
        ENUM_ROOM_STATUS roomStatus  = data.GetValue <ENUM_ROOM_STATUS>("RoomStatus");
        bool             IsPlayer    = data.GetValue <bool>("IsPlayer");
        RoomEntity       CurrentRoom = data.GetValue <RoomEntity>("Room");

        if (m_nSeatIndex == seat.Index)
        {
            if (seat.seatStatus == ENUM_SEAT_STATUS.BET && seat.seatToperateStatus != ENUM_SEATOPERATE_STATUS.Discard)
            {
                //if (seat.pos==RoomZhaJHProxy.Instance.PlayerSeat.pos)
                //{
                guangshu.SetActive(true);
                TransferData data1 = new TransferData();
                data1.SetValue("round", CurrentRoom.round);
                data1.SetValue("totalRound", CurrentRoom.totalRound);
                data1.SetValue("Fen", CurrentRoom.roomPour);
                data1.SetValue("Seat", seat);
                ModelDispatcher.Instance.Dispatch(ZhaJHMethodname.OnZJHBtnShow, data1);
                ModelDispatcher.Instance.Dispatch(ZhaJHMethodname.OnZJHHidFen, data1);
                if (RoomZhaJHProxy.Instance.btnGDD)
                {
                    ZhaJHGameCtrl.Instance.WithNotes(null);
                }
                //}
            }
        }
    }
 public void SetUI(TransferData data)
 {
     m_roleModelJobId   = (int)data.GetValue <byte>(ConstDefine.JobId);
     m_nickName.text    = data.GetValue <string>(ConstDefine.NickName);
     m_lblFighting.text = string.Format("综合战斗力: <color='#FD254DFF'>{0}</color>", data.GetValue <int>(ConstDefine.Fighting));
     m_lblLevel.text    = string.Format("LV.{0}", data.GetValue <int>(ConstDefine.Level));
 }
Esempio n. 16
0
    private void OnSeatGameInfoChanged(TransferData data)
    {
        SeatEntity  seat       = data.GetValue <SeatEntity>("Seat");
        ROOM_STATUS roomStatus = data.GetValue <ROOM_STATUS>("RoomStatus");

        SetSeatInfo(seat, roomStatus);
    }
Esempio n. 17
0
    /// <summary>
    /// 中途加入实例化牌
    /// </summary>
    /// <param name="data"></param>
    private void HairPoker(TransferData data)
    {
        SeatEntity seat = data.GetValue <SeatEntity>("Seat");
        //int index = data.GetValue<int>("index");
        int    index      = seat.Index;
        string spriteName = data.GetValue <string>("spriteName");

        for (int j = 0; j < m_itemSeat.Length; j++)
        {
            if (index == m_itemSeat[j].m_nSeatIndex)
            {
                if (m_itemSeat[j].gameObject.activeSelf)
                {
                    for (int z = 0; z < m_itemSeat[j].pokerMounts.Length; z++)
                    {
                        if (m_itemSeat[j].pokerMounts[z].transform.childCount > 0)
                        {
                            Destroy(m_itemSeat[j].pokerMounts[z].transform.GetChild(0).gameObject);
                        }
                    }
                }
                Vector3 pokerScale = m_itemSeat[j].m_nSeatIndex == 0 ? new Vector3(0.8f, 0.8f, 0.8f) : new Vector3(0.7f, 0.7f, 0.7f);
                for (int k = 0; k < 3; k++)
                {
                    GameObject go = ZJHPrefabManager.Instance.LoadPoker(null, null, spriteName);
                    go.transform.SetParent(m_itemSeat[j].pokerMounts[k].transform);
                    go.transform.localPosition = Vector3.zero;
                    go.transform.localScale    = pokerScale;
                }
            }
        }
    }
Esempio n. 18
0
        public void SetUI(TransferData data)
        {
            //int sum= data.GetValue<int>("SetADHWindowSum");//人数

            //显示人数
            SetADHWindowSum(data);



            countdownNoOff = data.GetValue <bool>("IsCountdownNoOff");//是否显示倒计时

            if (countdownNoOff)
            {
                long time = data.GetValue <long>("SetSvrTime");//倒计时SetSvrTime

                if (time < 0)
                {
                    Close();
                    return;
                }
                //计算倒计时
                long currTime = TimeUtil.GetTimestamp();
                countdownTime = (time - currTime) + GlobalInit.Instance.TimeDistance * 0.001f;
                countdownTime = Mathf.Clamp(countdownTime, 0, countdownTimeMax);

                countdownNoOff   = true;
                intCountdownTime = (int)countdownTime;
                SetCountdownSprite(intCountdownTime);
            }
        }
Esempio n. 19
0
    private void LookPoker(TransferData data)
    {
        List <Poker> pokerList  = data.GetValue <List <Poker> >("pokerList");
        int          index      = data.GetValue <int>("index");
        string       spriteName = data.GetValue <string>("spriteName");

        for (int j = 0; j < m_itemSeat.Length; j++)
        {
            if (index == m_itemSeat[j].m_nSeatIndex)
            {
                if (pokerList.Count != 0)
                {
                    if (m_itemSeat[j].gameObject.activeSelf)
                    {
                        for (int z = 0; z < m_itemSeat[j].pokerMounts.Length; z++)
                        {
                            for (int k = 0; k < m_itemSeat[j].pokerMounts[z].transform.childCount; k++)
                            {
                                Destroy(m_itemSeat[j].pokerMounts[z].transform.GetChild(k).gameObject);
                            }
                        }
                    }
                    Vector3 pokerScale = m_itemSeat[j].m_nSeatIndex == 0 ? new Vector3(0.8f, 0.8f, 0.8f):new Vector3(0.7f, 0.7f, 0.7f);
                    for (int i = 0; i < pokerList.Count; i++)
                    {
                        GameObject go = ZJHPrefabManager.Instance.LoadPoker(pokerList[i], null, spriteName);
                        go.transform.SetParent(m_itemSeat[j].pokerMounts[i].transform);
                        go.transform.localPosition = Vector3.zero;
                        go.transform.localScale    = pokerScale;
                    }
                }
            }
        }
    }
Esempio n. 20
0
    /// <summary>
    /// 添加成员
    /// </summary>
    /// <param name="obj"></param>
    private void OnAddMember(TransferData data)
    {
        ChatGroupEntity group = data.GetValue <ChatGroupEntity>("GroupEntity");

        if (group.id != m_GroupId)
        {
            return;
        }

        PlayerEntity     playerEntity  = data.GetValue <PlayerEntity>("PlayerEntity");
        PlayerEntity     oneselfEntity = data.GetValue <PlayerEntity>("OneselfEntity");
        int              index         = data.GetValue <int>("Index");
        UIItemChatMember item          = UIPoolManager.Instance.Spawn("UIItemChatMember").GetComponent <UIItemChatMember>();

        item.SetUI(group.id, playerEntity.id, playerEntity.nickname, playerEntity.online > 0, playerEntity.avatar, playerEntity.isOwner, playerEntity.isManager, oneselfEntity.isOwner, oneselfEntity.isManager);
        item.gameObject.SetParent(m_MemberContainer, true);
        item.transform.SetSiblingIndex(index);
        m_MemberList.Add(item);

        bool isPlayer = data.GetValue <bool>("IsPlayer");

        if (isPlayer)
        {
            m_BtnManage.gameObject.SetActive(playerEntity.isManager || playerEntity.isOwner);
        }
    }
Esempio n. 21
0
    public override void ShowRecord(TransferData data)
    {
        base.ShowRecord(data);
        string gameType = data.GetValue <string>("GameType");
        int    gameId   = data.GetValue <int>("GameId");

        SetShowArrGames(gameType);
        for (int i = 0; i < m_ArrGames.Length; ++i)
        {
            if (gameId == m_ArrGames[i].GameId)
            {
                m_ArrGames[i].SetIsShowToggle(true);
                break;
            }
        }

        for (int i = 0; i < m_btnGame.Length; ++i)
        {
            if (m_btnGame[i].gameObject.name.Equals(gameType, StringComparison.CurrentCultureIgnoreCase))
            {
                m_btnGame[i].isOn = true;
                break;
            }
        }
    }
Esempio n. 22
0
    /// <summary>
    /// 进入房间
    /// </summary>
    /// <param name="obj"></param>
    private void OnEnterRoom(TransferData data)
    {
        ChatGroupEntity group = data.GetValue <ChatGroupEntity>("GroupEntity");

        if (group.id != m_GroupId)
        {
            return;
        }
        int          roomId = data.GetValue <int>("RoomId");
        PlayerEntity player = data.GetValue <PlayerEntity>("PlayerEntity");

        for (int i = 0; i < m_RoomList.Count; ++i)
        {
            if (m_RoomList[i].RoomId != roomId)
            {
                continue;
            }
            UIItemChatRoom room = m_RoomList[i];
            for (int j = 0; j < room.PlayerList.Count; ++j)
            {
                if (room.PlayerList[j].PlayerId == 0)
                {
                    room.PlayerList[j].SetUI(group.id, roomId, player.id, player.avatar, group.isOwner);
                    break;
                }
            }
        }
    }
Esempio n. 23
0
        /// <summary>
        /// 调用播放牌型音乐的方法
        /// </summary>
        /// <param name="data"></param>
        private void PlayMusic(TransferData data)
        {
            RoomEntity room        = data.GetValue <RoomEntity>("Room");
            SeatEntity currentSeat = data.GetValue <SeatEntity>("PlayerSeat");

            StartCoroutine(PlayMusicTor(room, currentSeat));
        }
Esempio n. 24
0
    /// <summary>
    /// 新申请进群
    /// </summary>
    /// <param name="obj"></param>
    private void OnGroupNewApply(TransferData data)
    {
        int  groupId     = data.GetValue <int>("GroupId");
        bool hasNewApply = data.GetValue <bool>("HasNewApply");

        if (groupId != m_GroupId)
        {
            if (hasNewApply)
            {
                for (int i = 0; i < m_GroupList.Count; ++i)
                {
                    if (m_GroupList[i].GroupId == groupId)
                    {
                        m_GroupList[i].SetNewTip(true);
                    }
                }
            }
        }
        else
        {
            if (!m_GroupManagePage.gameObject.activeInHierarchy)
            {
                m_NewManageTip.gameObject.SetActive(hasNewApply);
            }
            else
            {
                SendNotification("btnChatGroupViewApply", m_GroupId);
            }
        }
    }
Esempio n. 25
0
    /// <summary>
    /// 当玩家下注结束后设置分数
    /// </summary>
    /// <param name="data"></param>
    private void SetBetPour(TransferData data)
    {
        SeatEntity  seat       = data.GetValue <SeatEntity>("Seat");
        ROOM_STATUS roomStatus = data.GetValue <ROOM_STATUS>("RoomStatus");

        SetBetPourUI(seat, roomStatus);
    }
Esempio n. 26
0
    public override void SetUI(TransferData data)
    {
        base.SetUI(data);

        int    loop = data.GetValue <int>("Loop");
        string time = data.GetValue <string>("DateTime");
        List <TransferData> lstPlayer = data.GetValue <List <TransferData> >("Player");

        for (int i = 0; i < m_ArrGold.Length; ++i)
        {
            if (i < lstPlayer.Count)
            {
                m_ArrGold[i].gameObject.SetActive(true);
                TransferData playerData = lstPlayer[i];
                int          gold       = playerData.GetValue <int>("Gold");
                m_ArrGold[i].SafeSetText(string.Format("<color={0}>{1}</color>", gold > 0 ? "red" : "green", gold.ToString()));
            }
            else
            {
                m_ArrGold[i].gameObject.SetActive(false);
            }
        }

        m_txtLoop.SafeSetText(string.Format("第{0}局", loop.ToString()));
        m_txtDateTime.SafeSetText(time);
    }
Esempio n. 27
0
        /// <summary>
        /// 座位信息变更回调
        /// </summary>
        /// <param name="obj"></param>
        private void OnSeatInfoChanged(TransferData data)
        {
            SeatEntity seat     = data.GetValue <SeatEntity>("Seat");
            bool       isPlayer = data.GetValue <bool>("IsPlayer");

            RoomEntity.RoomStatus roomStatus = data.GetValue <RoomEntity.RoomStatus>("RoomStatus");
            if (isPlayer)
            {
                m_ButtonReady.gameObject.SetActive(seat.Status == SeatEntity.SeatStatus.Idle && roomStatus == RoomEntity.RoomStatus.Ready);
                if (m_ButtonCancelReady != null)
                {
                    m_ButtonCancelReady.gameObject.SetActive(seat.Status == SeatEntity.SeatStatus.Ready && roomStatus == RoomEntity.RoomStatus.Ready);
                }
                m_ButtonShare.gameObject.SetActive(roomStatus == RoomEntity.RoomStatus.Ready);
                if (!SystemProxy.Instance.IsInstallWeChat)
                {
                    m_ButtonShare.gameObject.SetActive(false);
                }
                if (m_CancelAuto != null)
                {
                    m_CancelAuto.gameObject.SetActive(seat.IsTrustee);
                }

                //出牌项
                if (roomStatus != RoomEntity.RoomStatus.Begin || seat.Status != SeatEntity.SeatStatus.Operate)
                {
                    m_Operator.ShowChuPaiItem(false);
                }
            }
        }
Esempio n. 28
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="data"></param>
 public void SetUI(TransferData data)
 {
     m_JobId          = data.GetValue <byte>(ConstDefine.JobId);
     lblNickName.text = data.GetValue <string>(ConstDefine.NickName);
     lblLevel.text    = string.Format("Lv.{0}", data.GetValue <int>(ConstDefine.Level));
     lblFighting.text = string.Format("综合战斗力:<color='#ff0000'>{0}</color>", data.GetValue <int>(ConstDefine.Fighting));
 }
Esempio n. 29
0
        private void OnCountDownUpdate(TransferData data)
        {
            long serverTime = data.GetValue <long>("ServerTime");
            bool isPlayer   = data.GetValue <bool>("IsPlayer");
            int  seatIndex  = data.GetValue <int>("SeatIndex");
            bool isClose    = data.GetValue <bool>("IsClose");


            if (isClose)
            {
                gameObject.SetActive(false);
                return;
            }

            if (m_CountDownContainer != null)
            {
                if (m_CountDownContainer.Length > seatIndex)
                {
                    gameObject.SetParent(m_CountDownContainer[seatIndex], true);
                }
            }

            if (serverTime == 0)
            {
                SetTime(0, isPlayer);
                return;
            }



            int countTime = (int)(serverTime + GlobalInit.Instance.TimeDistance - TimeUtil.GetTimestampMS());
            int s         = Mathf.RoundToInt(countTime / 1000f);

            SetTime(s, isPlayer);
        }
Esempio n. 30
0
 public void SetData(TransferData data)
 {
     m_Index     = data.GetValue <int>(ConstDefine.Index);
     m_Name.text = data.GetValue <string>(ConstDefine.Name);
     GameUtil.LoadStar(m_StarContainer, data.GetValue <int>(ConstDefine.CurrStar), data.GetValue <int>(ConstDefine.MaxStar), data.GetValue <int>(ConstDefine.RowStarCount));
     m_IsBoss.SetSprite("Icon", data.GetValue <bool>(ConstDefine.IsBoss)? "Button_Fightauto1" : "Button_Fightauto");
     m_CallBack = data.ActionOneIntCallBack;
 }