Exemple #1
0
    public void UpdateResult(IMessage message)
    {
        string data = (string)message.Body;

        GUID = Util.GetGUID(); //生成新的GUID
        string result = "";

        if (data == "成功")
        {
            //上传guid
            result = PostGUID(appId, meachineId, GUID, 0.4f);
        }
        else if (data == "失败")
        {
            result = PostGUID(appId, meachineId, GUID, 0f);
        }
        ServerManager.SendMessageClient("退出"); //关闭游戏
        if (result != string.Empty)
        {
            PostGUID post = JsonMapper.ToObject <PostGUID>(result);
            //生成二维码
            if (post.errCode == 0)
            {
                Texture t = CreateQR(GUID, true);
                GoodsPic.texture = t;
            }
        }
    }
Exemple #2
0
    /// <summary>
    /// 接受游戏反馈消息,并上传id到服务器获取游戏金额
    /// </summary>
    /// <param name="message"></param>
    public void UpdateResult(IMessage message)
    {
        string data = (string)message.Body;

        if (data == "连接到客户端")
        {
            PanelWaiting.gameObject.SetActive(false);
        }
        else
        {
            GUID = Util.GetGUID(); //生成新的GUID
            string result    = "";
            float  sendPrice = 0;
            if (data == "成功")
            {
                sendPrice = goldPrice;
                result    = PostGUID(appId, meachineId, GUID, goldPrice);
            }
            else if (data == "失败")
            {
                sendPrice = 0;
                result    = PostGUID(appId, meachineId, GUID, 0f);
            }
            ServerManager.SendMessageClient("退出"); //关闭游戏
            MediaPlayerMgr.SetVolume(1);
            if (result != string.Empty)
            {
                PostGUID post = JsonMapper.ToObject <PostGUID>(result);
                //生成二维码
                if (post.errCode == 0)
                {
                    UIManager.ShowPanel(PanelType.PanelPay, GUID, sendPrice, true);
                    Close();
                }
            }
        }
    }