Beispiel #1
0
        IEnumerator GETTexture(string webRes)
        {
            WWW wwwTexture = new WWW(webRes);

            yield return(wwwTexture);

            if (wwwTexture.error != null)
            {
                //GET请求失败
            }
            else
            {
                string ver = wwwTexture.text;
                if (ver == VersionID)
                {
                    if (PlayerPrefs.HasKey("access_token") && PlayerPrefs.HasKey("refresh_token"))
                    {
                        OnLogin();
                    }
                }
                else
                {
                    NUMessageBox.Show("有新版本,请更新", NUMessageCallBack, NUMessageNOCallBack);
                }
            }
        }
Beispiel #2
0
    private void OnBuyDiamondBtnDown(Button btn)
    {
        string name = btn.name;

        string butName = btn.transform.FindChild("Text2").gameObject.GetComponent <Text>().text;

        int        index = int.Parse((name.Replace("Button", "")));
        List <int> money = new List <int> {
            20000, 38000, 90000, 170000
        };
        List <int> diam = new List <int> {
            1, 2, 5, 10
        };

        if (money[index] > MainManager.Instance.playerSelfInfo.goldNum)
        {
            NUMessageBox.Show("余额不足!");
        }
        else
        {
            _exchange = money[index];

            string str = string.Format("是否用{0}兑换{1}钻石?", butName, diam[index]);

            NUMessageBox.Show(str, NUMessageCallBack);
        }
    }
        public void JoinRoom(Int64 room_id)
        {
            Int64 index;

            //  hubName = roomList[(int)index-1];
            // roomID = room_id;
            if (room_id < 100000)
            {
                NUMessageBox.Show("输入的房间号应该是6位");
            }
            else
            {
                index = room_id / 100000;
                if (index <= roomList.Count)
                {
                    hubName = roomList[(int)index - 1];
                    roomID  = room_id;
                    MainManager.Instance.dontDestroyOnLoad.SetLoading(true);
                    NetHandle.call_hub(hubName, "room", "enter_mj_huanghuang_room", roomID);
                }
                else
                {
                    NUMessageBox.Show("输入的房间号不存在");
                }
            }
        }
Beispiel #4
0
        public void snatch_redpackets_ok(ArrayList data)
        {
            Int64     num  = (Int64)data[0];
            ArrayList list = (ArrayList)data[1];

            if (num != 0)
            {
                NUMessageBox.Show("抢了" + num.ToString() + "金币,运气不错哦!");
            }
            EventDispatcher.GetInstance().MainEventManager.TriggerEvent <ArrayList>(EventId.Sever_red_Player_List, list);
        }
 private void Fenxiang(Button btn)
 {
     if (isShotComplete)
     {
         OnShareToWX(accountImgRes);
     }
     else
     {
         NUMessageBox.Show("正在保存战绩!请稍后");
     }
 }
Beispiel #6
0
 private void OnBind(string msg)
 {
     if (msg == "ok")
     {
         NUMessageBox.Show("绑定成功");
     }
     else
     {
         NUMessageBox.Show(msg);
     }
 }
Beispiel #7
0
 public void OnCreateGame(GameObject obj)
 {
     OnChangeCreatRoomInfo();
     TableController.Instance.creatRoomInfo = _creatRoomdata;
     if (_creatRoomdata.needMoney > MainManager.Instance.playerSelfInfo.diamondNum)
     {
         NUMessageBox.Show("钻石不足!");
     }
     else
     {
         SocketClient.Instance.CreateRoom(_creatRoomdata.playerNum, _creatRoomdata.playState, _creatRoomdata.baseScore, _creatRoomdata.jushu, _creatRoomdata.payState);
     }
 }
Beispiel #8
0
        public void exist_room(ArrayList data)
        {
            MainManager.Instance.dontDestroyOnLoad.SetLoading(false);

            if (MainManager.Instance.nowSceneName == SceneName.NUMainWindow)
            {
                NUMessageBox.Show("房间号不存在");
            }
            else
            {
                MainManager.Instance.dontDestroyOnLoad.StartLoadingScene("NUMainWindow");
            }
        }
Beispiel #9
0
        public void red_packet_error(ArrayList data)
        {
            Int64 info = (Int64)data[0];

            if (info == 2)
            {
                NUMessageBox.Show("发送红包有5秒间隔!");
            }
            else
            {
                NUMessageBox.Show("ERROR  编号:" + info.ToString());
            }
        }
Beispiel #10
0
    public void recharge_diamond_ok(ArrayList data)
    {
        bool  flag    = (bool)data[0];
        Int64 gold    = (Int64)data[1];
        Int64 diamond = (Int64)data[2];

        if (flag)
        {
            NUMessageBox.Show("恭喜兑换成功,已存入库存!");
        }
        else
        {
            NUMessageBox.Show("兑换失败!");
        }
    }
Beispiel #11
0
    public void recharge_gold_ok(ArrayList data)
    {
        bool  flag    = (bool)data[0];
        Int64 gold    = (Int64)data[1];
        Int64 diamond = (Int64)data[2];

        if (flag)
        {
            NUMessageBox.Show("恭喜你用" + "<Color=#E7B40F><size=30>" + diamond + "</size></Color>" + "颗钻石成功兑换了" + "<Color=#E7B40F><size=30>" + gold + "</size></Color>" + "金币!");
        }
        else
        {
            NUMessageBox.Show("兑换失败!");
        }
    }
 private void ClosePanel()
 {
     if (voteState.Count == TableController.Instance.creatRoomInfo.playerNum)
     {
         Reset();
         this.CancelInvoke();
         timeCountxt.text  = "";
         isShowTimeTxtFlag = false;
         this.gameObject.SetActive(false);
         TableController.Instance.voteState.Clear();
     }
     else
     {
         NUMessageBox.Show("还有玩家没有投票");
     }
 }
Beispiel #13
0
    private void OnBuyGoldBtnDown(Button btn)
    {
        string     name  = btn.name;
        int        index = int.Parse((name.Replace("Button", "")));
        List <int> money = new List <int> {
            5, 10, 20, 50
        };

        if (money[index] > MainManager.Instance.playerSelfInfo.diamondNum)
        {
            NUMessageBox.Show("钻石不足!");
        }
        else
        {
            _exchange = money[index];
            NUMessageBox.Show("是否确定用" + money[index] + "钻石兑换\n" + money[index] * 10000 + "金币", NUMessageCallBack);
        }
    }
Beispiel #14
0
    private void SendRedBag()
    {
        int    money     = (int)MainManager.Instance.playerSelfInfo.goldNum;
        int    sendMoney = int.Parse(redBagMoney.text);
        int    sendCount = int.Parse(redBagCount.text);
        string msg;

        if (sendMoney > money)
        {
            NUMessageBox.Show("金额不足咧!");
        }
        else if (sendMoney < 30000 || sendMoney > 500000 || sendCount < 10 || sendCount > 50)
        {
            msg = "1:红包金额必须大于3万小于50万\n2:红包个数必须大于10个小于20个";
            NUMessageBox.Show(msg);
        }
        else
        {
            NUMessageBox.Show("你是否确定发红包!", SureSendRedBag);
        }
    }
Beispiel #15
0
 /// <summary>
 /// 禁止进入房间
 /// </summary>
 public void disable_game(ArrayList data)
 {
     MainManager.Instance.dontDestroyOnLoad.SetLoading(false);
     NUMessageBox.Show("服务器即将重启,禁止创建游戏和进入房间!");
 }
Beispiel #16
0
 public void mj_huanghuang_room_is_full(ArrayList data)
 {
     MainManager.Instance.dontDestroyOnLoad.SetLoading(false);
     NUMessageBox.Show("房间已满");
 }
 void Awake()
 {
     instance = this;
 }
Beispiel #18
0
        void Update()
        {
            if (iscanbuhh)
            {
                debugTxt.text = debugStr.ToString();
                iscanbuhh     = false;
            }

            if (_isShowLoading)
            {
                loadingPanel.SetActive(true);
                Loading();
            }
            else
            {
                if (loadingPanel.activeSelf)
                {
                    loadingPanel.SetActive(false);
                }
            }

            if (async_operation != null)
            {
                if (async_operation.progress == 1 && _isShowLoading)
                {
                    _isShowLoading  = false;
                    async_operation = null;
                    if (loadingCompleteFunc != null)
                    {
                        loadingCompleteFunc();
                        loadingCompleteFunc = null;
                    }
                }
            }

            if (loadOver)
            {
                if (PlayerPrefs.HasKey("MjBackColor"))
                {
                    MainManager.Instance.selfMjBackColorState = PlayerPrefs.GetString("MjBackColor");
                    loadOver = false;
                }
            }

            if (Input.GetKey(KeyCode.Escape))
            {
                #if UNITY_EDITOR
                #elif UNITY_ANDROID
                //这个地方可以写“再按一次退出”的提示
                //escapeTimes++;
                NUMessageBox.Show("确定退出游戏?", SureEndGame);
                //StartCoroutine("resetTimes");
                //if (escapeTimes > 1)
                //{
                //    Application.Quit();
                //}
                #endif
            }
            if (MainManager.Instance.m_voiceengine == null)
            {
                //  Debug.Log("m_voiceengine is null");
            }
            else
            {
                try
                {
                    MainManager.Instance.m_voiceengine.Poll();
                }
                catch (System.Exception e)
                {
                    EventDispatcher.GetInstance().UIFrameWorkEventManager.TriggerEvent <string>(EventId.UIFrameWork_Bug, e.Message);
                }
            }
            SocketClient.Instance.Update();
        }