Esempio n. 1
0
    /// <summary>
    /// 头像点击
    /// </summary>
    /// <param name="seatPos"></param>
    private void OnHeadZJHClick(object[] obj)
    {
        int seatPos = (int)obj[0];

        m_SelectSeatPos = seatPos;
        SeatEntity seat = RoomZhaJHProxy.Instance.GetSeatBySeatId(seatPos);

        if (seat == RoomZhaJHProxy.Instance.PlayerSeat && AccountProxy.Instance.CurrentAccountEntity.identity > 0)
        {
            UIViewManager.Instance.OpenWindow(UIWindowType.PlayerInfo);
            return;
        }

        List <SeatEntityBase> lstSeat = new List <SeatEntityBase>();

        for (int i = 0; i < RoomZhaJHProxy.Instance.CurrentRoom.seatList.Count; ++i)
        {
            if (RoomZhaJHProxy.Instance.CurrentRoom.seatList[i].pos != seatPos)
            {
                lstSeat.Add(RoomZhaJHProxy.Instance.CurrentRoom.seatList[i]);
            }
        }

        UIViewUtil.Instance.LoadWindowAsync(UIWindowType.SeatInfo, (GameObject go) =>
        {
            m_UISeatInfoView = go.GetComponent <UISeatInfoView>();
            m_UISeatInfoView.SetUI(seat, lstSeat);
            m_UISeatInfoView.SetEmoji(cfg_interactiveExpressionDBModel.Instance.GetList(), OnBtnInteractiveExpressionClick);
        });
    }
Esempio n. 2
0
    //#region OnDisConnectCallBack 网络连接中断回调
    ///// <summary>
    ///// 网络连接中断回调
    ///// </summary>
    //private void OnDisConnectCallBack(bool isActiveClose)
    //{
    //    if (SceneMgr.Instance.CurrentSceneType != SceneType.NiuNiu2D) return;
    //    if (isActiveClose)
    //    {
    //        if (this != null)
    //        {
    //            RebuildRoom();
    //        }
    //    }
    //    else
    //    {
    //        RebuildRoom();
    //    }
    //}
    //#endregion



    //#region ConnectServer 连接服务器
    ///// <summary>
    ///// 连接服务器
    ///// </summary>
    ///// <param name="type"></param>
    ///// <param name="ip"></param>
    ///// <param name="port"></param>
    //public void ConnectServer(EnterRoomType type, string ip, int port)
    //{
    //    Debug.Log("niuniu连接服务器");
    //    UIViewManager.Instance.ShowWait();
    //    m_CurrentType = type;

    //    NetWorkSocket.Instance.BeginConnect(ip, port, OnConnectedCallBack);
    //}
    //#endregion


    //#region OnConnectedCallBack 连接服务器回调
    ///// <summary>
    ///// 连接服务器回调
    ///// </summary>
    ///// <param name="obj"></param>
    //private void OnConnectedCallBack(bool isSuccess)
    //{
    //    UIViewManager.Instance.CloseWait();
    //    if (isSuccess)
    //    {
    //        if (m_CurrentType == EnterRoomType.Create)
    //        {
    //            ClientSendCreateRoom();
    //        }
    //        else if (m_CurrentType == EnterRoomType.Join)
    //        {
    //            ClientSendJoinRoom(m_nCurrentJoinRoomId);
    //        }
    //        else
    //        {
    //            ClientSendRebuild();
    //        }
    //    }
    //    else
    //    {
    //        UIViewManager.Instance.ShowMessage("错误提示", "网络连接失败", MessageViewType.Ok, ExitGame);
    //    }

    //}
    //#endregion

    #region OnHeadClick 头像点击
    /// <summary>
    /// 头像点击
    /// </summary>
    /// <param name="seatPos"></param>
    private void OnHeadClick(object[] param)
    {
        int  seatPos = (int)param[0];
        Seat seat    = RoomNiuNiuProxy.Instance.GetSeatBySeatPos(seatPos);

        if (seat == RoomNiuNiuProxy.Instance.PlayerSeat && AccountProxy.Instance.CurrentAccountEntity.identity > 0)
        {
            UIViewManager.Instance.OpenWindow(UIWindowType.PlayerInfo);
            return;
        }

        List <SeatEntityBase> lstSeat = new List <SeatEntityBase>();

        for (int i = 0; i < RoomNiuNiuProxy.Instance.CurrentRoom.SeatList.Count; ++i)
        {
            if (RoomNiuNiuProxy.Instance.CurrentRoom.SeatList[i].Pos != seatPos && RoomNiuNiuProxy.Instance.CurrentRoom.SeatList[i].PlayerId > 0)
            {
                lstSeat.Add(RoomNiuNiuProxy.Instance.CurrentRoom.SeatList[i]);
            }
        }

        UIViewUtil.Instance.LoadWindowAsync(UIWindowType.SeatInfo, (GameObject go) =>
        {
            m_UISeatInfoView = go.GetComponent <UISeatInfoView>();
            m_UISeatInfoView.SetUI(seat, lstSeat);
#if IS_LAOGUI
            if (seat != RoomNiuNiuProxy.Instance.PlayerSeat)
#endif
            {
                m_UISeatInfoView.SetEmoji(cfg_interactiveExpressionDBModel.Instance.GetList(), OnBtnInteractiveExpressionClick);
            }
        });
    }