コード例 #1
0
ファイル: Manager_Hall.cs プロジェクト: zhaoy615/Guizhoule
    //text	title	url	imageUrl/imagePath	shareType	musicUrl	filePath
    private IEnumerator JiePingTime(float time)
    {
        yield return(new WaitForSeconds(0.5f));


        ShareContent content = new ShareContent();

        content.SetText("等你乐麻将,贵阳本土的麻将");//没显示
        //content.SetImagePath(imagePath);//显示了
        content.SetImageUrl("http://qy-imageserver.oss-cn-shenzhen.aliyuncs.com/20171219115836.jpg");
        content.SetTitle("等你乐麻将\n等你乐麻将,贵阳本土的麻将");                                //显示了
        content.SetUrl("http://download.gzqyrj.com/download/html/majhong.html"); //显示了
        //content.SetShareType(ContentType.Image);
        content.SetShareType(ContentType.Webpage);
        // FIClogin.myShareSdk.ShowPlatformList(null, content, 100, 100);

        //FIClogin.myShareSdk.ShowShareContentEditor(PlatformType.WeChat, content);
        FIClogin.myShareSdk.ShowShareContentEditor(PlatformType.WeChatMoments, content);
    }
コード例 #2
0
ファイル: UIShareWindow.cs プロジェクト: liamzhu/LePing
    private void OnFriendClick(GameObject go)
    {
        ShareInfo mShareInfo = mUIMainModel.GetShareInfo(ShareType.Friend);

        if (mShareInfo != null)
        {
            ShareContent content = new ShareContent();
            content.SetImagePath(AppConst.ImagePath);
            content.SetTitle(mShareInfo.Title);
            content.SetText(mShareInfo.Content);
            content.SetUrl(mShareInfo.Url);
            content.SetShareType(ContentType.Webpage);
            ApplicationMgr.Instance.ShareSDK.ShareContent(PlatformType.WeChatMoments, content);
        }
        else
        {
            UIDialogMgr.Instance.ShowDialog("没有找到分享的相关配置");
        }
    }
コード例 #3
0
    public void ShareWeChat(string _title, string _text, string _url, bool _isMoments)
    {
        ShareContent content = new ShareContent();

        content.SetText(_text);
        content.SetImageUrl(ABTool.ResUrl + "/thumblogo.jpg");
        content.SetTitle(_title);
        content.SetTitleUrl(_url);
        content.SetUrl(_url);
        content.SetShareType(ContentType.Webpage);
        if (_isMoments)
        {
            sdk.ShareContent(PlatformType.WeChatMoments, content);
        }
        else
        {
            sdk.ShareContent(PlatformType.WeChat, content);
        }
    }
コード例 #4
0
    void InvertPresss()
    {
        ShareContent content = new ShareContent();
        //content.SetTitle("【开心麻将馆】");
        string roomiD = GameInfo.Instance.roomId.ToString();
        string pw     = "无密码";

        if (GameInfo.Instance.roomPassWord > 0)
        {
            pw = GameInfo.Instance.roomPassWord.ToString();
        }
        string maxPoint = GameInfo.Instance.maxPoint.ToString();
        string maxRound = GameInfo.Instance.maxRound.ToString();
        string zjDouble = "";

        if (GameInfo.Instance.isZjDouble == 1)
        {
            zjDouble = "庄翻倍";
        }
        string isQiangGang = "";

        if (GameInfo.Instance.canQiangGang == 1)
        {
            isQiangGang = "可抢杠";
        }
        string isDaiGen = "";

        if (GameInfo.Instance.isDaiGen == 1)
        {
            isDaiGen = "带根";
        }
        string isZimoHu = "";

        if (GameInfo.Instance.isZiMoHu == 1)
        {
            isZimoHu = "自摸胡";
        }
        content.SetText("【房号:" + roomiD + " 密码:" + pw + "】" + maxRound + "局," + maxPoint + "封顶," + zjDouble + "," + isQiangGang + "," + isDaiGen + "," + isZimoHu + "■■■四川大众麻将■■■");
        //content.SetComment("快来人,三缺一啦");
        content.SetShareType(ContentType.Text);
        //ssdk.ShowPlatformList(null, content, 100, 100);
        ssdk.ShowShareContentEditor(PlatformType.WeChat, content);
    }
コード例 #5
0
    public void OnShareButtonDown()
    {
        Application.CaptureScreenshot("Icon.png");
        ShareContent content = new ShareContent();

        content.SetText("随风疾行,触摸天空,飞跃高山大海,身后已是星辰——触摸天空下载链接https://www.taptap.com/app/64704");
        //content.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
        content.SetImagePath(Application.persistentDataPath + "/" + "Icon.png");
        content.SetImageUrl("https://www.taptap.com/app/64704");
        content.SetTitle("触摸天空");
        content.SetTitleUrl("https://www.taptap.com/app/64704");
        content.SetSite("触摸天空");
        content.SetSiteUrl("https://www.taptap.com/app/64704");
        content.SetUrl("https://www.taptap.com/app/64704");
        //content.SetComment("test description");
        //content.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
        content.SetShareType(ContentType.Image);

        ssdk.ShowPlatformList(null, content, 100, 100);
    }
コード例 #6
0
ファイル: ShareDemo.cs プロジェクト: mengtest/wh
    //分享
    public void OnShareClick()
    {
        ShareContent content = new ShareContent();

        //这个地方要参考不同平台需要的参数    可以看ShareSDK提供的   分享内容参数表.docx
        content.SetText("快来和我一起玩这个游戏吧!");                                       //分享文字
        content.SetImageUrl("https://f1.webshare.mob.com/code/demo/img/4.jpg"); //分享图片
        content.SetTitle("标题title");                                            //分享标题
        content.SetTitleUrl("http://www.qq.com");
        content.SetSite("Mob-ShareSDK");
        content.SetSiteUrl("http://www.mob.com");
        content.SetUrl("http://www.sina.com");                                     //分享网址
        content.SetComment("描述");
        content.SetMusicUrl("http://up.mcyt.net/md5/53/OTg1NjA5OQ_Qq4329912.mp3"); //分享类型为音乐时用
        content.SetShareType(ContentType.Webpage);


        //shareSdk.ShowPlatformList(null, content, 100, 100);                      //弹出分享菜单选择列表
        ssdk.ShowShareContentEditor(PlatformType.QQ, content);                 //指定平台直接分享
    }
コード例 #7
0
    // 分享图文信息
    public void OnShareButtonClick()
    {
        // 创建屏幕截图
        Application.CaptureScreenshot("Screenshot.png");

        // 分享前先创建content对象
        ShareContent content = new ShareContent();

        // 设置分享的正文字
        content.SetText("金游房卡麻将");
        // 设置分享的图片
        // SetImagePath用于本地图片,参数为图片路径
        // SetImageUrl 用于网络图片,参数为图片网址
        // SetImageArray 用于多图分享,参数为图片网址的string数组,仅支持网络图片,仅支持Android
        content.SetImagePath(Application.persistentDataPath + "/Screenshot.png");
        // 设置分享的标题与标题的url
        content.SetTitle("标题");
        content.SetTitleUrl("http://d.51v.cn/");
        content.SetSite("站点");
        content.SetSiteUrl("http://d.51v.cn/");
        //content.SetMusicUrl();
        content.SetUrl("http://d.51v.cn/");
        // 设定分享类型的主要类型
        content.SetShareType(ContentType.Webpage);

        // 平台特异性分享内容的设置
        //ShareContent sinaWeiBoContent = new ShareContent();
        //sinaWeiBoContent.SetText(resultText.text + "\n via 微信");

        // 在指定平台上,使用第二个参数的内容去覆盖主内容的值
        //content.SetShareContentCustomize(PlatformType.WeChatMoments, sinaWeiBoContent);

        // 显示分享框
        //PlatformType[] platforms = {PlatformType.SinaWeibo,PlatformType.QQ, PlatformType.WeChat};
        //ssdk.ShowPlatformList(platforms, content, 100, 100);
        string[] platformList =
        { "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54" };
        content.SetHidePlatforms(platformList);
        ssdk.ShowPlatformList(null, content, 100, 100);
    }
コード例 #8
0
    public static void ShareToPlatfrom(string text, string imageUrl, string Title)
    {
#if UNITY_EDITOR
        PlayerDataManager.Instance.SetFlag(559);
        var list = new Int32Array();
        list.Items.Add(559);
        PlayerDataManager.Instance.SetFlagNet(list);
        return;
#endif

        if (!File.Exists(imageUrl))
        {
            Logger.Error("share error! cant find screenshot!");
            return;
        }
        ShareContent content = new ShareContent();
        content.SetText(text);
        content.SetImageUrl(imageUrl);
        content.SetTitle(Title);
        content.SetShareType(ContentType.Image);
        ssdk.ShowPlatformList(null, content, 100, 100);
    }
コード例 #9
0
        public void ShowShareMenu()
        {
            ShareContent content = new ShareContent();

            content.SetText("视觉美景+智能呈现  只留精彩,不留遗憾");
            content.SetImageUrl("https://gitee.com/visizencom/ar_game/raw/054c0ae483c0b9a65319815d5d76b92aea4668fc/Images/Logo.png");
            content.SetTitle("AR游");
            content.SetShareType(ContentType.Webpage);
            content.SetTitleUrl("http://download.vszapp.com");
            content.SetUrl("http://download.vszapp.com");

            ShareContent SinaShareParams = new ShareContent();

            SinaShareParams.SetText("视觉美景+智能呈现  只留精彩,不留遗憾");
            SinaShareParams.SetImageUrl("https://gitee.com/visizencom/ar_game/raw/054c0ae483c0b9a65319815d5d76b92aea4668fc/Images/Logo.png");
            SinaShareParams.SetShareType(ContentType.Webpage);
            SinaShareParams.SetObjectID("SinaID");
            content.SetShareContentCustomize(PlatformType.SinaWeibo, SinaShareParams);
            ssdk = GameObject.Find("Root").GetComponent <ShareSDK>();
            //通过分享菜单分享
            ssdk.ShowPlatformList(null, content, 100, 100);
        }
コード例 #10
0
        /// <summary>
        /// 分享
        /// </summary>
        private void ShareButtonHandle()
        {
            ShareContent content = new ShareContent();

            if (iconName != null)
            {
                content.SetImagePath(Application.persistentDataPath + iconName);
            }
            content.SetTitle(" GitHub分享 ");
            content.SetTitleUrl("https://github.com/Iamdevelope");
            content.SetText(" wecome my github ");
            content.SetUrl("https://www.cnblogs.com/mufei/");
            content.SetComment("test description");
            content.SetMusicUrl("http://fjdx.sc.chinaz.com/Files/DownLoad/sound1/201807/10300.mp3");
            content.SetShareType(ContentType.Webpage);

            Debug.Log(" ******* 001 ");
            ssdk.shareHandler = ShareHandler;
            //ssdk.ShareContent(new PlatformType[] { PlatformType.QQ,PlatformType.QZone,PlatformType.WeChat,PlatformType.WechatPlatform}, content);
            ssdk.ShowPlatformList(null, content);
            //ssdk.ShowShareContentEditor(PlatformType.WeChat, content);
            //ssdk.ShowPlatformList(null, content, 100, 100);
        }
コード例 #11
0
    public void inviteFriend()
    {
        if (GlobalDataScript.roomVo != null)
        {
            RoomCreateVo roomvo = GlobalDataScript.roomVo;
            GlobalDataScript.totalTimes   = roomvo.roundNumber;
            GlobalDataScript.surplusTimes = roomvo.roundNumber;
            string str = MyMahjongScript.getRoomInfoString(roomvo);
            str += "有胆,你就来!";

            string       title = "正宗亳州麻将    房间号:" + roomvo.roomId;
            ShareContent customizeShareParams = new ShareContent();
            customizeShareParams.SetTitle(title);
            customizeShareParams.SetText(str);
            //配置下载地址
            customizeShareParams.SetUrl("http://119.23.128.56:8080/download/index.html");
            //配置分享logo
            customizeShareParams.SetImageUrl("http://119.23.128.56:8080/download/logo.png");
            customizeShareParams.SetShareType(ContentType.Webpage);
            customizeShareParams.SetObjectID("");
            shareSdk.ShareContent(PlatformType.WeChat, customizeShareParams);
        }
    }
コード例 #12
0
    private void ShareRoomId()
    {
        StringBuilder textContent = new StringBuilder();

        if (GameInfo.GroupID != 0)
        {
            textContent.Append("朋友圈:【" + GameInfo.GroupID + "】");
        }
        textContent.Append("房间号:【" + Room_Id.text + "】");
        switch (GameInfo.room_peo)
        {
        case 2:
            textContent.Append(",二丁拐");
            break;

        case 3:
            textContent.Append(",三丁拐");
            break;

        case 4:
            textContent.Append(",四人局");
            break;
        }
        textContent.Append(GameInfo.gameCount + ",局房");
        textContent.Append(GameInfo.roomRlue);

        ShareContent content = new ShareContent();

        content.SetText(textContent.ToString());                                                      //显示了
        content.SetTitle("【等你乐麻将】");                                                                  //显示了
        content.SetImageUrl("http://qy-imageserver.oss-cn-shenzhen.aliyuncs.com/20171219115836.jpg"); //没显示
        content.SetUrl("http://download.gzqyrj.com/download/html/majhong.html");
        content.SetShareType(ContentType.Webpage);
        //content.SetShareType(ContentType.Webpage);
        // FIClogin.myShareSdk.ShowPlatformList(null, content, 100, 100);
        FIClogin.myShareSdk.ShowShareContentEditor(PlatformType.WeChat, content);
    }
コード例 #13
0
ファイル: WechatOperateScript.cs プロジェクト: YLancer/DN
    public void inviteFriend()
    {
        //if(GlobalDataScript.roomVo != null){
        //	RoomCreateVo roomvo = GlobalDataScript.roomVo;
        //	GlobalDataScript.totalTimes = roomvo.roundNumber;
        //	GlobalDataScript.surplusTimes = roomvo.roundNumber;
        string str = "快来和我一起牛起来吧!"
                     + "房间类型:"
                     + (GlobalDataScript.roomVo.gameType == 4 ? "德州扑克" :
                        GlobalDataScript.roomVo.gameType == 1 ? "跑得快" :
                        (GlobalDataScript.roomVo.ruleType == 1 ? "看牌抢庄" :
                         GlobalDataScript.roomVo.ruleType == 3 ? "牛牛换庄" :
                         GlobalDataScript.roomVo.ruleType == 4 ? "轮流当庄" :
                         GlobalDataScript.roomVo.ruleType == 5 ? "房主霸王庄" : "最大牌为庄"))
                     + "\n房间号:" + GlobalDataScript.roomVo.roomId;
        string title = "金牛王——绝无外挂公平公正的游戏!";

        //         string title;
        //if (roomvo.goldType) {
        //	title ="【" + Application.productName + "】" + "  房间号:训练场";
        //} else {
        //	title ="【" + Application.productName + "】" + "  房间号:"+roomvo.roomId;
        //}
        ShareContent customizeShareParams = new ShareContent();

        customizeShareParams.SetTitle(title);
        customizeShareParams.SetText(str);
        //配置下载地址
        customizeShareParams.SetUrl("https://dafuvip.com/bY73q2");
        //配置分享logo
        // customizeShareParams.SetImageUrl(APIS.baseUrl + "/download/logo.png");
        customizeShareParams.SetShareType(ContentType.Webpage); //ContentType.Webpage
                                                                //customizeShareParams.SetObjectID("");
        shareSdk.ShowShareContentEditor(PlatformType.WeChat, customizeShareParams);
        //}
    }
コード例 #14
0
    private void OnWeChatClick(GameObject go)
    {
        if (GameMgr.Instance.isFromRecord)
        {
            return;
        }

        ShareInfo mShareInfo = mUIMainModel.GetShareInfo(ShareType.Room);

        if (mShareInfo != null)
        {
            ShareContent content = new ShareContent();
            content.SetImagePath(AppConst.ImagePath);
            content.SetTitle(mShareInfo.Title);
            content.SetText(string.Format(mShareInfo.Content, mUIGameModel.RoomInfo.RoomsNo, mUIGameModel.RoomInfo.Setting.ToString()));
            content.SetUrl(mShareInfo.Url);
            content.SetShareType(ContentType.Webpage);
            ApplicationMgr.Instance.ShareSDK.ShowShareContentEditor(PlatformType.WeChat, content);
        }
        else
        {
            UIDialogMgr.Instance.ShowDialog("没有找到分享的相关配置");
        }
    }
コード例 #15
0
    public void Share(int type)
    {
        ssdk = gameObject.GetComponent <ShareSDK>();
        ssdk.shareHandler = ShareResultHandler;

        ShareContent content = new ShareContent();

        content.SetText("Play Pusoy online with me! Click to join my table! ");
        content.SetUrl("https://www.unlipoker.com");
        content.SetTitle("Unlipoker");
        content.SetShareType(ContentType.Auto);
        ssdk.GetUserInfo(PlatformType.FacebookMessenger);

        switch (type)
        {
        case 0:
            ShareFacebook(content);
            break;

        case 1:
            ShareMessenger(content);
            break;
        }
    }
コード例 #16
0
ファイル: Demo.cs プロジェクト: shareSdk20181120/ShareSdk
    void OnGUI()
    {
        GUI.skin = demoSkin;

        float scale = 1.0f;

        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            scale = Screen.width / 320;
        }

        //float btnWidth = 165 * scale;
        float btnWidth  = Screen.width / 5 * 2;
        float btnHeight = Screen.height / 25;
        float btnTop    = 30 * scale;
        float btnGap    = 20 * scale;

        GUI.skin.button.fontSize = Convert.ToInt32(13 * scale);

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 - btnWidth, btnTop, btnWidth, btnHeight), "Authorize"))
        {
            print(ssdk == null);
            ssdk.Authorize(PlatformType.QQ);
        }

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Get User Info"))
        {
            ssdk.GetUserInfo(PlatformType.QQ);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 - btnWidth, btnTop, btnWidth, btnHeight), "Show Share Menu"))
        {
            ShareContent content = new ShareContent();

            //(Android only) 隐藏九宫格里面不需要用到的平台(仅仅是不显示平台)
            //(Android only) 也可以把jar包删除或者把Enabl属性e改成false(对应平台的全部功能将用不了)
            String[] platfsList = { ((int)PlatformType.QQ).ToString(), ((int)PlatformType.Facebook).ToString(), ((int)PlatformType.TencentWeibo).ToString() };
            content.SetHidePlatforms(platfsList);

            content.SetText("this is a test string.");
            content.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
            content.SetTitle("test title");

            //(Android only) 针对Android绕过审核的多图分享,传图片String数组
            String[] imageArray = { "/sdcard/test.jpg", "http://f1.webshare.mob.com/dimgs/1c950a7b02087bf41bc56f07f7d3572c11dfcf36.jpg", "/sdcard/test.jpg" };
            content.SetImageArray(imageArray);

            content.SetTitleUrl("http://www.mob.com");
            content.SetSite("Mob-ShareSDK");
            content.SetSiteUrl("http://www.mob.com");
            content.SetUrl("http://www.mob.com");
            content.SetComment("test description");
            content.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
            content.SetShareType(ContentType.Image);

            //不同平台分享不同内容
            ShareContent customizeShareParams = new ShareContent();
            customizeShareParams.SetText("Sina share content");
            customizeShareParams.SetImageUrl("http://git.oschina.net/alexyu.yxj/MyTmpFiles/raw/master/kmk_pic_fld/small/107.JPG");
            customizeShareParams.SetShareType(ContentType.Text);
            customizeShareParams.SetObjectID("SinaID");
            content.SetShareContentCustomize(PlatformType.SinaWeibo, customizeShareParams);
            //优先客户端分享
            // content.SetEnableClientShare(true);

            //使用微博API接口应用内分享 iOS only
            // content.SetEnableSinaWeiboAPIShare(true);

            //通过分享菜单分享
            ssdk.ShowPlatformList(null, content, 100, 100);
        }

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Show Share View"))
        {
            ShareContent content = new ShareContent();
            content.SetText("this is a test string.");
            content.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
            content.SetTitle("test title");
            content.SetTitleUrl("http://www.mob.com");
            content.SetSite("Mob-ShareSDK");
            content.SetSiteUrl("http://www.mob.com");
            content.SetUrl("http://www.mob.com");
            content.SetComment("test description");
            content.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
            content.SetShareType(ContentType.Image);

            ssdk.ShowShareContentEditor(PlatformType.SinaWeibo, content);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 - btnWidth, btnTop, btnWidth, btnHeight), "Share Content"))
        {
            ShareContent content = new ShareContent();
            content.SetText("this is a test string.");
            content.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
            content.SetTitle("test title");
//			content.SetTitleUrl("http://www.mob.com");
//			content.SetSite("Mob-ShareSDK");
            // content.SetSiteUrl("http://www.mob.com");
            content.SetUrl("http://qjsj.youzu.com/jycs/");
//			content.SetComment("test description");
//			content.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
            content.SetShareType(ContentType.Webpage);
            ssdk.ShareContent(PlatformType.WeChat, content);
        }

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Get Friends SinaWeibo "))
        {
            //获取新浪微博好友,第一页,每页15条数据
            print("Click Btn Of Get Friends SinaWeibo");
            ssdk.GetFriendList(PlatformType.SinaWeibo, 15, 0);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 - btnWidth, btnTop, btnWidth, btnHeight), "Get Token SinaWeibo "))
        {
            Hashtable authInfo = ssdk.GetAuthInfo(PlatformType.SinaWeibo);
            print("share result :");
            print(MiniJSON.jsonEncode(authInfo));
        }

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Close SSO Auth"))
        {
            ssdk.DisableSSO(true);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 - btnWidth, btnTop, btnWidth, btnHeight), "Remove Authorize "))
        {
            ssdk.CancelAuthorize(PlatformType.SinaWeibo);
        }

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Add Friend "))
        {
            //关注新浪微博
            ssdk.AddFriend(PlatformType.SinaWeibo, "3189087725");
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "ShareWithContentName"))
        {
            Hashtable customFields = new Hashtable();
            customFields["imgUrl"] = "http://ww1.sinaimg.cn/mw690/006dJESWgw1f6iyb8bzraj31kw0v67a2.jpg";
            //根据配置文件分享【本接口功能仅暂时支持iOS】
            ssdk.ShareWithContentName(PlatformType.SinaWeibo, "ShareSDK", customFields);
        }

        btnWidth += 80 * scale;
        btnTop   += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "ShowShareMenuWithContentName"))
        {
            Hashtable customFields = new Hashtable();
            customFields["imgUrl"] = "http://ww1.sinaimg.cn/mw690/006dJESWgw1f6iyb8bzraj31kw0v67a2.jpg";
            //根据配置文件展示分享菜单分享【本接口功能仅暂时支持iOS】
            ssdk.ShowPlatformListWithContentName("ShareSDK", customFields, null, 100, 100);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "ShowShareViewWithContentName"))
        {
            Hashtable customFields = new Hashtable();
            //根据配置文件展示编辑界面分享【本接口功能仅暂时支持iOS】
            customFields["imgUrl"] = "http://ww1.sinaimg.cn/mw690/006dJESWgw1f6iyb8bzraj31kw0v67a2.jpg";
            ssdk.ShowShareContentEditorWithContentName(PlatformType.SinaWeibo, "ShareSDK", customFields);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "SMS Authorize"))
        {
            ssdk.Authorize(PlatformType.SMS);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "Share wxMiniProgram (ios only)"))
        {
            ShareContent content = new ShareContent();
            content.SetTitle("MiniProgram");
            content.SetText("test MiniProgram");
            content.SetUrl("http://www.mob.com");
            content.SetMiniProgramPath("pages/index/index");
            content.SetThumbImageUrl("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1527484508213&di=d993c2ca41fec50717d137718511120f&imgtype=0&src=http%3A%2F%2Fimg5.2345.com%2Fduoteimg%2FzixunImg%2Flocal%2F2017%2F05%2F03%2F14938009295612.jpg");
            content.SetMiniProgramHdThumbImage("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1522154322305&di=7f4bf3d0803fe8c2c66c140f0a6ea0b4&imgtype=0&src=http%3A%2F%2Fa4.topitme.com%2Fo%2F201007%2F29%2F12803876734174.jpg");
            content.SetMiniProgramUserName("gh_afb25ac019c9");
            content.SetMiniProgramWithShareTicket(true);
            content.SetMiniProgramType(0);
            content.SetShareType(ContentType.MiniProgram);

            ShareContent shareContent = new ShareContent();
            shareContent.SetShareContentCustomize(PlatformType.WeChat, content);
            ssdk.ShareContent(PlatformType.WeChat, shareContent);
        }
    }
コード例 #17
0
ファイル: Demo.cs プロジェクト: Fransice/ShareSDK
    void OnGUI()
    {
        GUI.skin = demoSkin;

        float scale = 1.0f;

        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            scale = Screen.width / 320;
        }

        //float btnWidth = 165 * scale;
        float btnWidth  = Screen.width / 5 * 2;
        float btnHeight = Screen.height / 25;
        float btnTop    = 30 * scale;
        float btnGap    = 20 * scale;

        GUI.skin.button.fontSize = Convert.ToInt32(13 * scale);

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 - btnWidth, btnTop, btnWidth, btnHeight), "Authorize"))
        {
            print(ssdk == null);
            ssdk.Authorize(PlatformType.Douyin);
        }

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Get User Info"))
        {
            ssdk.GetUserInfo(PlatformType.Douyin);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 - btnWidth, btnTop, btnWidth, btnHeight),
                       "Show Share Menu"))
        {
            ShareContent content = new ShareContent();

            //	//(Android only) 隐藏九宫格里面不需要用到的平台(仅仅是不显示平台)
            //	//(Android only) 也可以把jar包删除或者把Enabl属性e改成false(对应平台的全部功能将用不了)
            String[] platfsList =
            {
                ((int)PlatformType.QQ).ToString(), ((int)PlatformType.Facebook).ToString(),
                ((int)PlatformType.TencentWeibo).ToString()
            };
            content.SetHidePlatforms(platfsList);

            content.SetText("this is a test string.");
            content.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
            content.SetTitle("test title");

            //(Android only) 针对Android绕过审核的多图分享,传图片String数组
            String[] imageArray =
            {
                "/sdcard/test.jpg", "http://f1.webshare.mob.com/dimgs/1c950a7b02087bf41bc56f07f7d3572c11dfcf36.jpg",
                "/sdcard/test.jpg"
            };
            content.SetImageArray(imageArray);

            content.SetTitleUrl("http://www.mob.com");
            content.SetSite("Mob-ShareSDK");
            content.SetSiteUrl("http://www.mob.com");
            content.SetUrl("http://www.mob.com");
            content.SetComment("test description");
            content.SetMusicUrl(
                "http://i.y.qq.com/v8/playsong.html?hostuin=0&songid=&songmid=002x5Jje3eUkXT&_wv=1&source=qq&appshare=iphone&media_mid=002x5Jje3eUkXT");
            content.SetShareType(ContentType.Image);

            //不同平台分享不同内容
            ShareContent customizeShareParams = new ShareContent();
            customizeShareParams.SetText("Sina share content");
            customizeShareParams.SetImageUrl(
                "http://git.oschina.net/alexyu.yxj/MyTmpFiles/raw/master/kmk_pic_fld/small/107.JPG");
            customizeShareParams.SetShareType(ContentType.Text);
            customizeShareParams.SetObjectID("SinaID");
            content.SetShareContentCustomize(PlatformType.SinaWeibo, customizeShareParams);
            //优先客户端分享
            content.SetEnableClientShare(true);

            //使用微博API接口应用内分享 iOS only
            content.SetEnableSinaWeiboAPIShare(true);

            //通过分享菜单分享
            ssdk.ShowPlatformList(null, content, 100, 100);
        }

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Show Share View"))
        {
            ShareContent content = new ShareContent();
            content.SetText("this is a test string.");
            content.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
            content.SetTitle("test title");
            content.SetTitleUrl("http://www.mob.com");
            content.SetSite("Mob-ShareSDK");
            content.SetSiteUrl("http://www.mob.com");
            content.SetUrl("http://www.mob.com");
            content.SetComment("test description");
            content.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
            content.SetShareType(ContentType.Image);

            ssdk.ShowShareContentEditor(PlatformType.SinaWeibo, content);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 - btnWidth, btnTop, btnWidth, btnHeight), "Share Content"))
        {
            ShareContent content = new ShareContent();
            content.SetText("this is a test string.");
            content.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
            content.SetTitle("test title");
            //content.SetTitleUrl("http://www.mob.com");
            //content.SetSite("Mob-ShareSDK");
            //content.SetSiteUrl("http://www.mob.com");
            content.SetUrl("http://qjsj.youzu.com/jycs/");
            //content.SetComment("test description");
            //content.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
            content.SetShareType(ContentType.Image);
            ssdk.ShareContent(PlatformType.QQ, content);


//            //  开发者要自己传入Activity 在9.0及其以上的系统
//            //  AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
//            //  AndroidJavaObject jo = jc.GetStatic<AndroidJavaObject>("currentActivity");
//            //  content.SetActivity(jo);
//            //  Debug.Log("QQQ 测试传入的activity  ==================>>> " + jo);

//                ShareContent content = new ShareContent();
//                content.SetFilePath("/storage/emulated/0/douyin.mp4");
//                content.SetShareType(ContentType.Video);
//                ssdk.ShareContent (PlatformType.Douyin, content);
        }

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight),
                       "Get Friends SinaWeibo "))
        {
            //获取新浪微博好友,第一页,每页15条数据
            print("Click Btn Of Get Friends SinaWeibo");
//			ssdk.GetFriendList (PlatformType.SinaWeibo, 15, 0);
            ssdk.openMiniProgram("gh_afb25ac019c9", "pages/index/index", 0);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 - btnWidth, btnTop, btnWidth, btnHeight),
                       "Get Token SinaWeibo "))
        {
            Hashtable authInfo = ssdk.GetAuthInfo(PlatformType.SinaWeibo);
            print("share result :");
            print(MiniJSON.jsonEncode(authInfo));
        }

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Close SSO Auth"))
        {
            ssdk.DisableSSO(true);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 - btnWidth, btnTop, btnWidth, btnHeight),
                       "Remove Authorize "))
        {
            ssdk.CancelAuthorize(PlatformType.SinaWeibo);
        }

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Add Friend "))
        {
            //关注新浪微博
            ssdk.AddFriend(PlatformType.SinaWeibo, "3189087725");
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "ShareWithContentName"))
        {
            Hashtable customFields = new Hashtable();
            customFields["imgUrl"] = "http://ww1.sinaimg.cn/mw690/006dJESWgw1f6iyb8bzraj31kw0v67a2.jpg";
            //根据配置文件分享【本接口功能仅暂时支持iOS】
            ssdk.ShareWithContentName(PlatformType.SinaWeibo, "ShareSDK", customFields);
        }

        btnWidth += 80 * scale;
        btnTop   += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight),
                       "ShowShareMenuWithContentName"))
        {
            Hashtable customFields = new Hashtable();
            customFields["imgUrl"] = "http://ww1.sinaimg.cn/mw690/006dJESWgw1f6iyb8bzraj31kw0v67a2.jpg";
            //根据配置文件展示分享菜单分享【本接口功能仅暂时支持iOS】
            ssdk.ShowPlatformListWithContentName("ShareSDK", customFields, null, 100, 100);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight),
                       "ShowShareViewWithContentName"))
        {
            Hashtable customFields = new Hashtable();
            //根据配置文件展示编辑界面分享【本接口功能仅暂时支持iOS】
            customFields["imgUrl"] = "http://ww1.sinaimg.cn/mw690/006dJESWgw1f6iyb8bzraj31kw0v67a2.jpg";
            ssdk.ShowShareContentEditorWithContentName(PlatformType.SinaWeibo, "ShareSDK", customFields);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "SMS Authorize"))
        {
            ssdk.Authorize(PlatformType.SMS);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight),
                       "Share wxMiniProgram (ios only)"))
        {
            ShareContent content = new ShareContent();
            content.SetTitle("MiniProgram");
            content.SetText("test MiniProgram");
            content.SetUrl("http://www.mob.com");
            content.SetMiniProgramPath("pages/index/index");
            content.SetThumbImageUrl(
                "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1527484508213&di=d993c2ca41fec50717d137718511120f&imgtype=0&src=http%3A%2F%2Fimg5.2345.com%2Fduoteimg%2FzixunImg%2Flocal%2F2017%2F05%2F03%2F14938009295612.jpg");
            content.SetMiniProgramHdThumbImage(
                "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1522154322305&di=7f4bf3d0803fe8c2c66c140f0a6ea0b4&imgtype=0&src=http%3A%2F%2Fa4.topitme.com%2Fo%2F201007%2F29%2F12803876734174.jpg");
            content.SetMiniProgramUserName("gh_afb25ac019c9");
            content.SetMiniProgramWithShareTicket(true);
            content.SetMiniProgramType(0);
            content.SetShareType(ContentType.MiniProgram);

            ShareContent shareContent = new ShareContent();
            shareContent.SetShareContentCustomize(PlatformType.WeChat, content);
            ssdk.ShareContent(PlatformType.WeChat, shareContent);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "Share Sina LinkCard"))
        {
#if UNITY_IPHONE
            ShareContent content = new ShareContent();
            content.SetText("sina LinkCard");
            content.SetUrl("http://www.mob.com");
            content.SetImageUrl("http://www.mob.com/assets/images/ShareSDK_pic_1-09d293a6.png");//必须为网络图片
            content.SetSinaLinkCard(true);
            content.SetSinaCardTitle("这是Title");
            content.SetSinaCardSummary("这是Summary");
            content.SetShareType(ContentType.Webpage);

            ShareContent shareContent = new ShareContent();
            shareContent.SetShareContentCustomize(PlatformType.SinaWeibo, content);
            ssdk.ShareContent(PlatformType.SinaWeibo, shareContent);
#elif UNITY_ANDROID
            JsonData jsonData = new JsonData();
            jsonData["url"]    = "http://wx4.sinaimg.cn/large/006WfoFPly1fq0jo9svnaj30dw0dwdhv.jpg";
            jsonData["width"]  = "120";
            jsonData["height"] = "120";


            ShareContent content = new ShareContent();
            content.SetText("sina LinkCard");
            content.SetSinaCardCreateAtAndroid("2019-01-24");
            content.SetSinaCardDisplayNameAndroid("displayName");
            content.SetSinaCardSummary("Summary");
            content.SetSinaCardURLAndroid("http://www.mob.com/");
            content.SetSinaCardTypeAndroid("webpage");
            content.SetSinaCardImageAndroid(jsonData);
            content.SetEnableClientShare(true);

            ShareContent shareContent = new ShareContent();
            shareContent.SetShareContentCustomize(PlatformType.SinaWeibo, content);

            ssdk.ShareContent(PlatformType.SinaWeibo, shareContent);
#endif
        }
    }
コード例 #18
0
ファイル: WechatOperateScript.cs プロジェクト: iuvei/AMH
    public void inviteFriend()
    {
        if (GlobalDataScript.roomVo != null)
        {
            RoomCreateVo roomvo = GlobalDataScript.roomVo;
            GlobalDataScript.totalTimes   = roomvo.roundNumber;
            GlobalDataScript.surplusTimes = roomvo.roundNumber;
            string str = "";
            if (roomvo.gameType == 0)
            {
                str += "【小麻将 大战场】";
            }
            else if (roomvo.gameType == 1)
            {
            }
            else if (roomvo.gameType == 3)
            {
                str += "【累了困了就牛牛】";
            }
            else if (roomvo.gameType == 4)
            {
                str += "【德州扑克】";
            }

            if (roomvo.hong)
            {
                str += "红中麻将,";
            }
            else
            {
                if (roomvo.roomType == 1)
                {
                    str += "转转麻将,";
                }
                else if (roomvo.roomType == 2)
                {
                    str += "划水麻将,";
                }
                else if (roomvo.roomType == 3)
                {
                    str += "长沙麻将,";
                }
                else if (roomvo.roomType == 4)
                {
                    str += "广东麻将,";
                }
                else if (roomvo.roomType == 5)
                {
                    str += "赣州冲关,";
                }
                else if (roomvo.roomType == 6)
                {
                    str += "瑞金麻将,";
                }
                else if (roomvo.gameType == 1)
                {
                    str += "跑得快,";
                }
                else if (roomvo.gameType == 3)
                {
                    str += "欢乐斗牛,";
                }
                else if (roomvo.gameType == 10)
                {
                    str += "潮汕麻将,";
                }
            }

            if (roomvo.gameType == 0)
            {
                str += "一缺三,";
            }
            else if (roomvo.gameType == 1)
            {
                str += "一缺二,";
            }
            else if (roomvo.gameType == 3)
            {
                str += "一缺四,";
            }
            else if (roomvo.gameType == 4)
            {
                str += "一缺五,";
            }

            if (!roomvo.goldType)
            {
                str += roomvo.roundNumber + "局,";
            }

            if (roomvo.roomType == 5)
            {
                if (roomvo.shangxiaFanType == 1)
                {
                    str += "上下翻埋地雷,";
                }
                else
                {
                    str += "上下左右翻精,";
                }

                if (roomvo.diFen == 1)
                {
                    str += "底分1分,";
                }
                else
                {
                    str += "底分2分,";
                }

                if (roomvo.tongZhuang)
                {
                    str += "通庄,";
                }
                else
                {
                    str += "分庄闲,";
                }

                if (roomvo.pingHu == 1)
                {
                    str += "可平胡,";
                }
                else if (roomvo.pingHu == 2)
                {
                    str += "有精点炮不能平胡,";
                }
                else
                {
                    str += "只可精钓,";
                }
            }
            else if (roomvo.roomType == 6)
            {
                if (roomvo.keDianPao)
                {
                    str += "可点炮胡,";
                }

                if (roomvo.diFen == 1)
                {
                    str += "底分1分,";
                }
                else if (roomvo.diFen == 2)
                {
                    str += "底分2分,";
                }
                else
                {
                    str += "底分5分,";
                }

                if (roomvo.tongZhuang)
                {
                    str += "通庄,";
                }
                else
                {
                    str += "分庄闲,";
                }
                if (roomvo.lunZhuang)
                {
                    str += "轮庄,";
                }
                else
                {
                    str += "霸王庄,";
                }
            }
            else if (roomvo.roomType == 10)
            {
                if (roomvo.gangHu)
                {
                    str += "可接炮胡,";
                }

                if (roomvo.genZhuang)
                {
                    str += "跟庄,";
                }

                if (roomvo.pengpengHu)
                {
                    str += "碰碰胡2倍,";
                }

                if (roomvo.qiDui)
                {
                    str += "七对2倍,";
                }

                if (roomvo.qiangGangHu)
                {
                    str += "抢杠胡2倍,";
                }

                if (roomvo.hunYiSe)
                {
                    str += "混一色2倍,";
                }

                if (roomvo.qingYiSe)
                {
                    str += "清一色2倍,";
                }

                if (roomvo.gangShangKaiHua)
                {
                    str += "杠上开花2倍,";
                }

                if (roomvo.haoHuaQiDui)
                {
                    str += "豪华7对4倍,";
                }

                if (roomvo.shiSanYao)
                {
                    str += "十三幺10倍,";
                }

                if (roomvo.tianDiHu)
                {
                    str += "天地胡10倍,";
                }

                if (roomvo.shuangHaoHua)
                {
                    str += "双豪华6倍,";
                }

                if (roomvo.sanHaoHua)
                {
                    str += "三豪华8倍,";
                }

                if (roomvo.shiBaLuoHan)
                {
                    str += "十八罗汉10倍,";
                }

                if (roomvo.xiaoSanYuan)
                {
                    str += "小三元4倍,";
                }

                if (roomvo.xiaoSanYuan)
                {
                    str += "小四喜4倍,";
                }

                if (roomvo.daSanYuan)
                {
                    str += "大三元6倍,";
                }

                if (roomvo.daSiXi)
                {
                    str += "大四喜6倍,";
                }

                if (roomvo.huaYaoJiu)
                {
                    str += "花幺九6倍,";
                }

                if (roomvo.fengDing == 5)
                {
                    str += "封顶5倍,";
                }
                else if (roomvo.fengDing == 10)
                {
                    str += "封顶10倍,";
                }
                else
                {
                    str += "不封顶,";
                }



                if (roomvo.gui == 0)
                {
                    str += "无鬼,";
                }
                else if (roomvo.gui == 1)
                {
                    str += "白板做鬼,";
                }
                else if (roomvo.gui == 2)
                {
                    str += "翻鬼,";
                }
                else if (roomvo.gui == 3)
                {
                    str += "翻鬼(双鬼),";
                }

                if (roomvo.wuGuiX2)
                {
                    str += "无鬼加翻,";
                }

                if (roomvo.ma > 0)
                {
                    str += "抓码数" + roomvo.ma + "个,";
                    if (roomvo.maGenDifen)
                    {
                        str += "马跟底分,";
                    }
                    if (roomvo.maGenGang)
                    {
                        str += "马跟杠,";
                    }
                }

                if (roomvo.jiejiegao)
                {
                    str += "节节高,";
                }
            }
            else if (roomvo.gameType == 1)
            {
                if (GlobalDataScript.roomVo.zhang16)
                {
                    str += "每人16张,";
                }
                else
                {
                    str += "每人15张,";
                }

                if (GlobalDataScript.roomVo.showPai)
                {
                    str += "显示牌,";
                }
                else
                {
                    str += "不显示牌,";
                }

                if (GlobalDataScript.roomVo.xian3)
                {
                    str += "首轮先出黑桃3,";
                }
            }
            else if (roomvo.gameType == 3)
            {
                if (!roomvo.goldType)
                {
                    str += roomvo.AA ? "AA制," : "房主付费,";
                }
                str += roomvo.qiang ? "抢庄," : "轮庄,";
                str += "底分" + roomvo.diFen + "分,";
            }
            else if (roomvo.gameType == 4)
            {
                str += "初始分:" + roomvo.initFen_dzpk;
            }
            else
            {
                if (roomvo.roomType == 4)
                {
                    if (roomvo.gangHu)
                    {
                        str += "可抢杠胡,";
                    }
                }
                else
                {
                    if (roomvo.ziMo == 1)
                    {
                        str += "只能自摸,";
                    }
                    else
                    {
                        str += "可抢杠胡,";
                    }
                }

                if (roomvo.sevenDouble)
                {
                    str += "可胡七对,";
                }

                if (roomvo.addWordCard)
                {
                    str += "有风牌,";
                }
                else
                {
                    str += "无风牌,";
                }

                if (roomvo.gui == 0)
                {
                    str += "无鬼,";
                }
                else if (roomvo.gui == 1)
                {
                    str += "白板做鬼,";
                }
                else if (roomvo.gui == 2)
                {
                    str += "翻鬼,";
                }
                else if (roomvo.gui == 3)
                {
                    str += "翻鬼,双鬼,";
                }

                if (roomvo.gangHuQuanBao)
                {
                    str += "杠爆全包,";
                }

                if (roomvo.wuGuiX2)
                {
                    str += "无鬼加翻,";
                }

                if (roomvo.xiaYu > 0)
                {
                    str += "下鱼" + roomvo.xiaYu + "条,";
                }

                if (roomvo.ma > 0)
                {
                    str += "抓" + roomvo.ma + "个码,";

                    if (roomvo.maGenDifen)
                    {
                        str += "马跟底分,";
                    }
                    if (roomvo.maGenGang)
                    {
                        str += "马跟杠,";
                    }
                }
                if (roomvo.magnification > 0)
                {
                    str += "倍率" + roomvo.magnification;
                }
            }
            if (roomvo.gameType == 0)
            {
                str += "兵贵神速,痛快大战300局!";
            }
            else if (roomvo.gameType == 1)
            {
                str += "有胆,你就来!";
            }
            else if (roomvo.gameType == 3)
            {
                str += "决战千里,牛气冲天!";
            }
            else if (roomvo.gameType == 4)
            {
                str += "有胆,你就来!";
            }

            string title;
            if (roomvo.goldType)
            {
                title = "【" + Application.productName + "】" + "  房间号:训练场";
            }
            else
            {
                title = "【" + Application.productName + "】" + "  房间号:" + roomvo.roomId;
            }
            ShareContent customizeShareParams = new ShareContent();
            customizeShareParams.SetTitle(title);
            customizeShareParams.SetText(str);
            //配置下载地址
            customizeShareParams.SetUrl(APIS.baseUrl + "/download/index.html");
            //配置分享logo
            customizeShareParams.SetImageUrl(APIS.baseUrl + "/download/logo.png");
            customizeShareParams.SetShareType(ContentType.Webpage);            //ContentType.Webpage
            customizeShareParams.SetObjectID("");
            shareSdk.ShareContent(PlatformType.WeChat, customizeShareParams);
        }
    }
コード例 #19
0
    public void inviteFriend()
    {
        if (GlobalDataScript.roomVo != null)
        {
            RoomCreateVo roomvo = GlobalDataScript.roomVo;
            GlobalDataScript.totalTimes   = roomvo.roundNumber;
            GlobalDataScript.surplusTimes = roomvo.roundNumber;
            string str = "";

            if (roomvo.hong)
            {
                str += "红中麻将,";
            }
            else
            {
                if (roomvo.roomType == 1)
                {
                    str += "转转麻将,";
                }
                else if (roomvo.roomType == 2)
                {
                    str += "划水麻将,";
                }
                else if (roomvo.roomType == 3)
                {
                    str += "长沙麻将,";
                }
            }

            str += "大战" + roomvo.roundNumber + "局,";
            if (roomvo.ziMo == 1)
            {
                str += "只能自摸,";
            }
            else
            {
                str += "可抢杠胡,";
            }
            if (roomvo.addWordCard)
            {
                str += "有风牌,";
            }

            if (roomvo.xiaYu > 0)
            {
                str += "下鱼" + roomvo.xiaYu + "条,";
            }

            if (roomvo.ma > 0)
            {
                str += "抓" + roomvo.ma + "个码,";
            }
            if (roomvo.magnification > 0)
            {
                str += "倍率" + roomvo.magnification;
            }
            str += "有胆,你就来!";

            string       title = "微牌    " + "房间号:" + roomvo.roomId;
            ShareContent customizeShareParams = new ShareContent();
            customizeShareParams.SetTitle(title);
            customizeShareParams.SetText(str);
            customizeShareParams.SetUrl("http://www.weipaigame.com/downLoad/index.html");
            customizeShareParams.SetImageUrl(APIS.ImgUrl + "icon96.png");
            customizeShareParams.SetShareType(ContentType.Webpage);
            customizeShareParams.SetObjectID("");
            shareSdk.ShowShareContentEditor(PlatformType.WeChat, customizeShareParams);
        }
    }
コード例 #20
0
    public void OnClickCallBack()
    {
        GetComponent <AudioSource> ().Play();
        switch (_extraButtonType)
        {
        case ExtraButtonType.EBT_HELP:
        {
            Debug.Log("call help layer");
            _mask.gameObject.SetActive(true);
        }
        break;

        case ExtraButtonType.EBT_LIKE:
        {
            Debug.Log("call like api");
                                #if UNITY_IPHONE
            Hashtable userData = new Hashtable();
            //ShareREC.editLastingRecording ("我天籁般的的叫声,是时候让你们听到了!", userData, null);
            ShareREC.openSocial("我天籁般的的叫声,是时候让你们听到了!", userData, SocialPageType.Share, null);
                                #endif
        }
        break;

        case ExtraButtonType.EBT_MUSIC:
        {
            Debug.Log("call music on/off");
//				JsonData jd = LoadJson.LoadSavedUserInfo ();
//				int music = (int)(jd["Music"]);
//				if (music == 1) {
//					//PlayerPrefs.SetInt ("Music", 0);
//					jd["Music"] = new JsonData(0);
//					GetComponent<Image> ().sprite = _musicOff;
//				} else {
//					//PlayerPrefs.SetInt ("Music", 1);
//					jd["Music"] = new JsonData(1);
//					GetComponent<Image> ().sprite = _musicOn;
//				}
//				//PlayerPrefs.Save ();
//				LoadJson.SaveUserInfo(jd);
        }
        break;

        case ExtraButtonType.EBT_RANK:
        {
            Debug.Log("call rank layer");
            _mask.gameObject.SetActive(true);
        }
        break;

        case ExtraButtonType.EBT_SHARE:
        {
                                #if UNITY_IPHONE
            Debug.Log("call share api");
            Hashtable userData = new Hashtable();
            ShareREC.openSocial("我天籁般的的叫声,是时候让你们听到了!", userData, SocialPageType.Share, null);
                                #endif
        }
        break;

        case ExtraButtonType.EBT_WX:
        {
            Debug.Log("call weixin api");
            _mask.gameObject.SetActive(true);
        }
        break;

        case ExtraButtonType.EBT_GAMESHARE:
        {
            Debug.Log("call url share api");
            string shareTitle = "这游戏有毒,我已中毒至深,尖叫根本停不下来!";
            string shareDesc  = "与全世界一起尖叫!谁才是声控之王?是你吗?";

            string shareTitleEn = "This game is poisonous and i have been poisoned deeply! I can't stop playing and screaming!";
            string shareDescEn  = "Scream with people around the world! Who is the king of voice control? Is that you?";

            string shareSite = "尖叫鸟";
            string shareUrl  = "https://api.shaojishiduo.com/GameScream/share?s=" + PlayerPrefs.GetString("ShareID");
            string shareImg  = "http://liteapp-1252384896.costj.myqcloud.com/scream/images/bird_icon_256.png";

            ShareContent content = new ShareContent();
            content.SetText(shareDesc);
            content.SetImageUrl(shareImg);
            content.SetTitle(shareTitle);
            content.SetTitleUrl(shareUrl);
            content.SetSite(shareSite);
            content.SetSiteUrl(shareUrl);
            content.SetUrl(shareUrl);
            content.SetComment(shareDesc);
            content.SetShareType(ContentType.Webpage);

            //不同平台分享不同内容
            //				ShareContent customizeShareParams = new ShareContent();
            //				customizeShareParams.SetText(shareDesc);
            //				customizeShareParams.SetImageUrl(shareImg);
            //				customizeShareParams.SetShareType(ContentType.Webpage);
            //				customizeShareParams.SetObjectID("SinaID");
            //				content.SetShareContentCustomize(PlatformType.SinaWeibo, customizeShareParams);

            //Instagram
            //				ShareContent sInstagram = new ShareContent();
            //				sInstagram.SetText(shareDesc);
            //				sInstagram.SetImageUrl(shareImg);
            //				sInstagram.SetShareType(ContentType.Image);
            //				content.SetShareContentCustomize(PlatformType.Instagram, sInstagram);

            //fbfb
            ShareContent sFacebook = new ShareContent();
            sFacebook.SetText(shareTitleEn);
            sFacebook.SetTitle(shareDescEn);
            sFacebook.SetImageUrl(shareImg);
            sFacebook.SetShareType(ContentType.Webpage);
            content.SetShareContentCustomize(PlatformType.Facebook, sFacebook);

            //Twitter
            ShareContent sTwitter = new ShareContent();
            sTwitter.SetText(shareDescEn + " Download:" + shareUrl);
            sTwitter.SetImageUrl(shareImg);
            sTwitter.SetUrl(shareUrl);
            sTwitter.SetShareType(ContentType.Auto);
            content.SetShareContentCustomize(PlatformType.Twitter, sTwitter);

            PlatformType[] pfs = { PlatformType.WeChat,   PlatformType.WeChatMoments,
                                   PlatformType.Facebook,
                                   PlatformType.QQ,       PlatformType.QZone, PlatformType.Twitter };

            //通过分享菜单分享
            ssdk.ShowPlatformList(pfs, content, 100, 100);
        }
        break;

        case ExtraButtonType.EBT_MONEYINFO:
        {
            Debug.Log("Money Info Mask");
            _mask.gameObject.SetActive(true);
        }
        break;

        case ExtraButtonType.EBT_SETTING:
        {
            Debug.Log("Setting Mask");
            _mask.gameObject.SetActive(true);
        }
        break;

        case ExtraButtonType.EBT_REBIRTH:
        {
            Debug.Log("Rebirth");
            if (PlayerPrefs.GetInt("Money") > 0)
            {
//					Dictionary<string,string> dic = new Dictionary<string,string> ();
//					dic.Add ("amount", "1");
//					JsonData jd = NetUtil.RequestMsg (NetUtil.MsgConsumeMoney, dic);
                ssdk.gameObject.GetComponent <PlayerManager>().ConsumeMoney(1);
                ssdk.gameObject.GetComponent <CameraMove> ().RebirthPlayer();
                DataManager._waitForRebirth = false;
                DataManager._isUsedRebirth  = true;
                _mask.gameObject.SetActive(false);
            }
            else
            {
                Debug.Log("playerprefs not enough money");
                Debug.Log("Show Get money mask");
//					DataManager._waitOperate = true;
//					transform.parent.gameObject.GetComponent<RebirthMask> ()._lessMoneyTip.gameObject.SetActive (true);
                gameObject.GetComponentInParent <RebirthMask>().setLessMoneyTipMask(true);
            }
        }
        break;

        case ExtraButtonType.EBT_APPSCORE:
        {
            Debug.Log("Link to AppStore");
                                #if UNITY_IPHONE || UNITY_EDITOR
            //Debug.Log ("aaaaaaaaaaa");
            const string APP_ID = "1211127073";                    //1211127073
            var          url    = string.Format(
                "https://itunes.apple.com/app/viewContentsUserReviews/id{0}",
                APP_ID);                        //itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=
            Application.OpenURL(url);
                                #endif
        }
        break;

        case ExtraButtonType.EBT_SKIN:
        {
            _mask.gameObject.SetActive(true);
        }
        break;
        }
    }
コード例 #21
0
    void OnGUI()
    {
        GUI.skin = demoSkin;

        float scale = 1.0f;

        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            scale = Screen.width / 320;
        }

        //float btnWidth = 165 * scale;
        float btnWidth  = Screen.width / 5 * 2;
        float btnWidth2 = btnWidth + 80 * scale;

        float btnHeight = Screen.height / 25;
        float btnTop    = 30 * scale;
        float btnGap    = 20 * scale;

        GUI.skin.button.fontSize = Convert.ToInt32(13 * scale);

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 - btnWidth, btnTop, btnWidth, btnHeight), "Authorize"))
        {
            print(ssdk == null);

#if UNITY_ANDROID
            ssdk.Authorize(PlatformType.SinaWeibo);
#elif UNITY_IPHONE
            ssdk.Authorize(PlatformType.Facebook);
#endif
        }

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Get User Info"))
        {
            //ssdk.GetUserInfo(PlatformType.Douyin);

            print("share result :" + ssdk.GetUserInfo(PlatformType.QQ));
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 - btnWidth, btnTop, btnWidth, btnHeight), "Show Share Menu"))
        {
            ShareContent content = new ShareContent();

            //	//(Android only) 隐藏九宫格里面不需要用到的平台(仅仅是不显示平台)
            //	//(Android only) 也可以把jar包删除或者把Enabl属性e改成false(对应平台的全部功能将用不了)
            String[] platfsList = { ((int)PlatformType.Facebook).ToString(), ((int)PlatformType.TencentWeibo).ToString() };
            content.SetHidePlatforms(platfsList);

            content.SetText("this is a test string.");
            content.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
            content.SetTitle("test title");

            //(Android only) 针对Android绕过审核的多图分享,传图片String数组
            String[] imageArray = { "/sdcard/test.jpg", "http://f1.webshare.mob.com/dimgs/1c950a7b02087bf41bc56f07f7d3572c11dfcf36.jpg", "/sdcard/test.jpg" };
            content.SetImageArray(imageArray);

            content.SetTitleUrl("http://www.mob.com");
            content.SetSite("Mob-ShareSDK");
            content.SetSiteUrl("http://www.mob.com");
            content.SetUrl("http://www.mob.com");
            content.SetComment("test description");
            content.SetMusicUrl("http://i.y.qq.com/v8/playsong.html?hostuin=0&songid=&songmid=002x5Jje3eUkXT&_wv=1&source=qq&appshare=iphone&media_mid=002x5Jje3eUkXT");
            content.SetShareType(ContentType.Image);

            //不同平台分享不同内容
            ShareContent customizeShareParams = new ShareContent();
            customizeShareParams.SetText("Sina share content");
            customizeShareParams.SetImageUrl("http://git.oschina.net/alexyu.yxj/MyTmpFiles/raw/master/kmk_pic_fld/small/107.JPG");
            customizeShareParams.SetShareType(ContentType.Text);
            customizeShareParams.SetObjectID("SinaID");
            content.SetShareContentCustomize(PlatformType.SinaWeibo, customizeShareParams);
            //优先客户端分享
            content.SetEnableClientShare(true);

            //使用微博API接口应用内分享 iOS only
            content.SetEnableSinaWeiboAPIShare(true);

            //通过分享菜单分享
            ssdk.ShowPlatformList(null, content, 100, 100);
        }

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Show Share View"))
        {
            ShareContent content = new ShareContent();
            content.SetText("this is a test string.");
            content.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
            content.SetTitle("test title");
            content.SetTitleUrl("http://www.mob.com");
            content.SetSite("Mob-ShareSDK");
            content.SetSiteUrl("http://www.mob.com");
            content.SetUrl("http://www.mob.com");
            content.SetComment("test description");
            content.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
            content.SetShareType(ContentType.Image);

            ssdk.ShowShareContentEditor(PlatformType.SinaWeibo, content);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth2) / 2, btnTop, btnWidth2, btnHeight), "Share Content"))
        {
            ShareContent content = new ShareContent();
            content.SetText("this is a test string.");
            content.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
            content.SetTitle("test title");
            //content.SetTitleUrl("http://www.mob.com");
            //content.SetSite("Mob-ShareSDK");
            //content.SetSiteUrl("http://www.mob.com");
            content.SetUrl("http://qjsj.youzu.com/jycs/");
            //content.SetComment("test description");
            //content.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
            content.SetShareType(ContentType.Image);
            ssdk.ShareContent(PlatformType.Oasis, content);


//            //  开发者要自己传入Activity 在9.0及其以上的系统
//            //  AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
//            //  AndroidJavaObject jo = jc.GetStatic<AndroidJavaObject>("currentActivity");
//            //  content.SetActivity(jo);
//            //  Debug.Log("QQQ 测试传入的activity  ==================>>> " + jo);

//                ShareContent content = new ShareContent();
//                content.SetFilePath("/storage/emulated/0/douyin.mp4");
//                content.SetShareType(ContentType.Video);
//                ssdk.ShareContent (PlatformType.Douyin, content);
        }

        //if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Get Friends SinaWeibo "))
        //{
        //获取新浪微博好友,第一页,每页15条数据
        //print ("Click Btn Of Get Friends SinaWeibo");
//			ssdk.GetFriendList (PlatformType.SinaWeibo, 15, 0);
        //ssdk.openMiniProgram("gh_afb25ac019c9","pages/index/index",0);
        //}

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth2) / 2, btnTop, btnWidth2, btnHeight), "Get Token "))
        {
            Hashtable authInfo = ssdk.GetAuthInfo(PlatformType.QQ);
            print("share result :");
            print(MiniJSON.jsonEncode(authInfo));
        }

        //if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap , btnTop, btnWidth, btnHeight), "Close SSO Auth"))
        //{
        //ssdk.DisableSSO (true);
        //}

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth2) / 2, btnTop, btnWidth2, btnHeight), "Remove Authorize "))
        {
            ssdk.CancelAuthorize(PlatformType.QQ);
        }

        //if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Add Friend "))
        //{
        //关注新浪微博
        //ssdk.AddFriend (PlatformType.SinaWeibo, "3189087725");
        //}

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth2) / 2, btnTop, btnWidth2, btnHeight), "ShareWithContentName(IOS only)"))
        {
            Hashtable customFields = new Hashtable();
            customFields["imgUrl"] = "http://ww1.sinaimg.cn/mw690/006dJESWgw1f6iyb8bzraj31kw0v67a2.jpg";
            //根据配置文件分享【本接口功能仅暂时支持iOS】
            ssdk.ShareWithContentName(PlatformType.SinaWeibo, "ShareSDK", customFields);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth2) / 2, btnTop, btnWidth2, btnHeight), "ShowShareMenuWithContentName(IOS only)"))
        {
            Hashtable customFields = new Hashtable();
            customFields["imgUrl"] = "http://ww1.sinaimg.cn/mw690/006dJESWgw1f6iyb8bzraj31kw0v67a2.jpg";
            //根据配置文件展示分享菜单分享【本接口功能仅暂时支持iOS】
            ssdk.ShowPlatformListWithContentName("ShareSDK", customFields, null, 100, 100);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth2) / 2, btnTop, btnWidth2, btnHeight), "ShowShareViewWithContentName(IOS only)"))
        {
            Hashtable customFields = new Hashtable();
            //根据配置文件展示编辑界面分享【本接口功能仅暂时支持iOS】
            customFields["imgUrl"] = "http://ww1.sinaimg.cn/mw690/006dJESWgw1f6iyb8bzraj31kw0v67a2.jpg";
            ssdk.ShowShareContentEditorWithContentName(PlatformType.SinaWeibo, "ShareSDK", customFields);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth2) / 2, btnTop, btnWidth2, btnHeight), "SMS Authorize"))
        {
            ssdk.Authorize(PlatformType.SMS);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth2) / 2, btnTop, btnWidth2, btnHeight), "submitPolicyGrantResult"))
        {
            Debug.Log("ssdk ======> " + ssdk);
            Debug.Log("mobsdk ======> " + mobsdk);

            mobsdk.submitPolicyGrantResult(true);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth2) / 2, btnTop, btnWidth2, btnHeight), "getPrivacyPolicy"))
        {
            Debug.Log("ssdk ======> " + ssdk);
            Debug.Log("mobsdk ======> " + mobsdk);
                        #if UNITY_IPHONE
            mobsdk.getPrivacyPolicy(true);
#elif UNITY_ANDROID
            mobsdk.getPrivacyPolicy(true);
            Debug.Log("mobsdk getPrivacyPolicy======> " + mobsdk.getPrivacyPolicy(true));
#endif
        }


        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 - btnWidth, btnTop, btnWidth, btnHeight), "Share wxMiniProgram"))
        {
#if UNITY_IPHONE
            ShareContent content = new ShareContent();
            content.SetTitle("MiniProgram");
            content.SetText("test MiniProgram");
            content.SetUrl("http://www.mob.com");
            content.SetMiniProgramPath("pages/index/index");
            content.SetThumbImageUrl("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1527484508213&di=d993c2ca41fec50717d137718511120f&imgtype=0&src=http%3A%2F%2Fimg5.2345.com%2Fduoteimg%2FzixunImg%2Flocal%2F2017%2F05%2F03%2F14938009295612.jpg");
            content.SetMiniProgramHdThumbImage("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1522154322305&di=7f4bf3d0803fe8c2c66c140f0a6ea0b4&imgtype=0&src=http%3A%2F%2Fa4.topitme.com%2Fo%2F201007%2F29%2F12803876734174.jpg");
            content.SetMiniProgramUserName("gh_afb25ac019c9");
            content.SetMiniProgramWithShareTicket(true);
            // iOS/Android 微信小程序的版本(0-正式,1-开发,2-体验)
            content.SetMiniProgramType(0);
            //content.SetShareType (ContentType.MiniProgram);

            ShareContent shareContent = new ShareContent();
            shareContent.SetShareContentCustomize(PlatformType.WeChat, content);
            ssdk.ShareContent(PlatformType.WeChat, shareContent);
#elif UNITY_ANDROID
            ShareContent content = new ShareContent();
            content.SetTitle("MiniProgram");
            content.SetText("test MiniProgram");
            content.SetUrl("http://www.mob.com");
            content.SetMiniProgramType(0);
            content.SetMiniProgramUserName("gh_52568203455c");
            content.SetImageUrl("http://pic28.photophoto.cn/20130818/0020033143720852_b.jpg");
            content.SetShareType(ContentType.MiniProgram);

            ShareContent shareContent = new ShareContent();
            shareContent.SetShareContentCustomize(PlatformType.WeChat, content);
            ssdk.ShareContent(PlatformType.WeChat, shareContent);
#endif
        }



        //
        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Share qqMiniProgram(IOS only)"))
        {
#if UNITY_IPHONE
            ShareContent content = new ShareContent();
            content.SetTitle("MiniProgram");
            content.SetText("test MiniProgram");
            content.SetUrl("http://www.mob.com");
            content.SetThumbImageUrl("http://download.sdk.mob.com/web/images/2019/07/30/14/1564468183056/750_750_65.12.png");
            content.SetMiniProgramPath("pages/index/index");
            content.SetMiniProgramHdThumbImage("http://download.sdk.mob.com/web/images/2019/07/30/14/1564468183056/750_750_65.12.png");
            content.SetMiniProgramAppID("1108318575");
            content.SetMiniProgramWebpageUrl("www.qq.com");
            //iOS/Android QQ小程序的类型,默认正式版(3),可选测试版(1)、预览版(4)
            content.SetMiniProgramType(3);
            content.SetShareType(ContentType.MiniProgram);

            ShareContent shareContent = new ShareContent();
            shareContent.SetShareContentCustomize(PlatformType.QQ, content);
            ssdk.ShareContent(PlatformType.QQ, shareContent);
#elif UNITY_ANDROID
            //===============================================================
            //when you test QQ miniprogram, you should use this params
            //At the same time, the package name and signature should
            //correspond to the package name signature of the specific
            //QQ sharing small program applied in the background of tencent
            //===============================================================
            //ShareContent content = new ShareContent();
            //content.SetTitle("MiniProgram");
            //content.SetText("test MiniProgram");
            //content.SetTitleUrl("http://www.mob.com");
            //content.SetImageUrl("http://www.3wyu.com/wp-content/uploads/6e0eaf15gy1fvr5tnm2dfj20f108gtad.jpg");//必须为网络图片
            //content.SetShareType(ContentType.QQ_MINI_PROGRAM);
            //content.SetMiniProgramAppID("1108318575");
            //content.SetMiniProgramPath("page/share/index.html?share_name=QQ%E9%9F%B3%E4%B9%90&share_key=5aIqFGg&from=disk");
            //content.SetQQMiniProgramType("");

            //ShareContent shareContent = new ShareContent();
            //shareContent.SetShareContentCustomize(PlatformType.QQ, content);
            //ssdk.ShareContent(PlatformType.QQ, shareContent);
#endif
        }

        //btnTop += btnHeight + 20 * scale;
        //if (GUI.Button(new Rect((Screen.width - btnWidth2) / 2, btnTop, btnWidth2, btnHeight), "Share Sina LinkCard"))
        //{
        //#if UNITY_IPHONE
        //ShareContent content = new ShareContent();
        //content.SetText("sina LinkCard");
        //content.SetUrl("http://www.mob.com");
        //content.SetImageUrl("http://www.mob.com/assets/images/ShareSDK_pic_1-09d293a6.png");//必须为网络图片
        //content.SetSinaLinkCard(true);
        //content.SetSinaCardTitle("这是Title");
        //content.SetSinaCardSummary("这是Summary");
        //content.SetShareType(ContentType.Webpage);

        //ShareContent shareContent = new ShareContent();
        //shareContent.SetShareContentCustomize(PlatformType.SinaWeibo, content);
        //ssdk.ShareContent(PlatformType.SinaWeibo, shareContent);


        //#elif UNITY_ANDROID
        //JsonData jsonData = new JsonData();
        //jsonData["url"] = "http://wx4.sinaimg.cn/large/006WfoFPly1fq0jo9svnaj30dw0dwdhv.jpg";
        //jsonData["width"] = "120";
        //jsonData["height"] = "120";


        //ShareContent content = new ShareContent();
        //content.SetText("sina LinkCard");
        //content.SetSinaCardCreateAtAndroid("2019-01-24");
        //content.SetSinaCardDisplayNameAndroid("displayName");
        //content.SetSinaCardSummary("Summary");
        //content.SetSinaCardURLAndroid("http://www.mob.com/");
        //content.SetSinaCardTypeAndroid("webpage");
        //content.SetSinaCardImageAndroid(jsonData);
        //content.SetEnableClientShare(true);

        //ShareContent shareContent = new ShareContent();
        //shareContent.SetShareContentCustomize(PlatformType.SinaWeibo, content);

        //ssdk.ShareContent(PlatformType.SinaWeibo, shareContent);
        //#endif
        //}
    }
コード例 #22
0
ファイル: Demo.cs プロジェクト: whztt07/mobahero_src
    private void OnGUI()
    {
        GUI.skin = this.demoSkin;
        float num = 1f;

        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            num = (float)(Screen.width / 320);
        }
        float num2 = 165f * num;
        float num3 = 30f * num;
        float num4 = 20f * num;
        float num5 = 20f * num;

        GUI.skin.button.fontSize = Convert.ToInt32(14f * num);
        if (GUI.Button(new Rect(((float)Screen.width - num5) / 2f - num2, num4, num2, num3), "Authorize"))
        {
            Debug.Log(this.ssdk == null);
            this.ssdk.Authorize(PlatformType.SinaWeibo);
        }
        if (GUI.Button(new Rect(((float)Screen.width - num5) / 2f + num5, num4, num2, num3), "Get User Info"))
        {
            this.ssdk.GetUserInfo(PlatformType.SinaWeibo);
        }
        num4 += num3 + 20f * num;
        if (GUI.Button(new Rect(((float)Screen.width - num5) / 2f - num2, num4, num2, num3), "Show Share Menu"))
        {
            ShareContent shareContent = new ShareContent();
            shareContent.SetText("this is a test string.");
            shareContent.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
            shareContent.SetTitle("test title");
            shareContent.SetTitleUrl("http://www.mob.com");
            shareContent.SetSite("Mob-ShareSDK");
            shareContent.SetSiteUrl("http://www.mob.com");
            shareContent.SetUrl("http://www.mob.com");
            shareContent.SetComment("test description");
            shareContent.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
            shareContent.SetShareType(2);
            ShareContent shareContent2 = new ShareContent();
            shareContent2.SetText("Sina share content");
            shareContent2.SetImageUrl("http://git.oschina.net/alexyu.yxj/MyTmpFiles/raw/master/kmk_pic_fld/small/107.JPG");
            shareContent2.SetShareType(2);
            shareContent2.SetObjectID("SinaID");
            shareContent.SetShareContentCustomize(PlatformType.SinaWeibo, shareContent2);
            this.ssdk.ShowPlatformList(null, shareContent, 100, 100);
        }
        if (GUI.Button(new Rect(((float)Screen.width - num5) / 2f + num5, num4, num2, num3), "Show Share View"))
        {
            ShareContent shareContent3 = new ShareContent();
            shareContent3.SetText("this is a test string.");
            shareContent3.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
            shareContent3.SetTitle("test title");
            shareContent3.SetTitleUrl("http://www.mob.com");
            shareContent3.SetSite("Mob-ShareSDK");
            shareContent3.SetSiteUrl("http://www.mob.com");
            shareContent3.SetUrl("http://www.mob.com");
            shareContent3.SetComment("test description");
            shareContent3.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
            shareContent3.SetShareType(2);
            this.ssdk.ShowShareContentEditor(PlatformType.SinaWeibo, shareContent3);
        }
        num4 += num3 + 20f * num;
        if (GUI.Button(new Rect(((float)Screen.width - num5) / 2f - num2, num4, num2, num3), "Share Content"))
        {
            ShareContent shareContent4 = new ShareContent();
            shareContent4.SetText("this is a test string.");
            shareContent4.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
            shareContent4.SetTitle("test title");
            shareContent4.SetTitleUrl("http://www.mob.com");
            shareContent4.SetSite("Mob-ShareSDK");
            shareContent4.SetSiteUrl("http://www.mob.com");
            shareContent4.SetUrl("http://www.mob.com");
            shareContent4.SetComment("test description");
            shareContent4.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
            shareContent4.SetShareType(2);
            this.ssdk.ShareContent(PlatformType.SinaWeibo, shareContent4);
        }
        if (GUI.Button(new Rect(((float)Screen.width - num5) / 2f + num5, num4, num2, num3), "Get Friends SinaWeibo "))
        {
            Debug.Log("Click Btn Of Get Friends SinaWeibo");
            this.ssdk.GetFriendList(PlatformType.SinaWeibo, 15, 0);
        }
        num4 += num3 + 20f * num;
        if (GUI.Button(new Rect(((float)Screen.width - num5) / 2f - num2, num4, num2, num3), "Get Token SinaWeibo "))
        {
            Hashtable authInfo = this.ssdk.GetAuthInfo(PlatformType.SinaWeibo);
            Debug.Log("share result :");
            Debug.Log(MiniJSON.jsonEncode(authInfo));
        }
        if (GUI.Button(new Rect(((float)Screen.width - num5) / 2f + num5, num4, num2, num3), "Close SSO Auth"))
        {
            this.ssdk.DisableSSO(true);
        }
        num4 += num3 + 20f * num;
        if (GUI.Button(new Rect(((float)Screen.width - num5) / 2f - num2, num4, num2, num3), "Remove Authorize "))
        {
            this.ssdk.CancelAuthorize(PlatformType.SinaWeibo);
        }
        if (GUI.Button(new Rect(((float)Screen.width - num5) / 2f + num5, num4, num2, num3), "Add Friend "))
        {
            this.ssdk.AddFriend(PlatformType.SinaWeibo, "3189087725");
        }
        num4 += num3 + 20f * num;
        if (GUI.Button(new Rect(((float)Screen.width - num2) / 2f, num4, num2, num3), "ShareWithContentName"))
        {
            Hashtable hashtable = new Hashtable();
            hashtable["imgUrl"] = "http://ww1.sinaimg.cn/mw690/006dJESWgw1f6iyb8bzraj31kw0v67a2.jpg";
            this.ssdk.ShareWithContentName(PlatformType.SinaWeibo, "ShareSDK", hashtable);
        }
        num2 += 80f * num;
        num4 += num3 + 20f * num;
        if (GUI.Button(new Rect(((float)Screen.width - num2) / 2f, num4, num2, num3), "ShowShareMenuWithContentName"))
        {
            Hashtable hashtable2 = new Hashtable();
            hashtable2["imgUrl"] = "http://ww1.sinaimg.cn/mw690/006dJESWgw1f6iyb8bzraj31kw0v67a2.jpg";
            this.ssdk.ShowPlatformListWithContentName("ShareSDK", hashtable2, null, 100, 100);
        }
        num4 += num3 + 20f * num;
        if (GUI.Button(new Rect(((float)Screen.width - num2) / 2f, num4, num2, num3), "ShowShareViewWithContentName"))
        {
            Hashtable hashtable3 = new Hashtable();
            hashtable3["imgUrl"] = "http://ww1.sinaimg.cn/mw690/006dJESWgw1f6iyb8bzraj31kw0v67a2.jpg";
            this.ssdk.ShowShareContentEditorWithContentName(PlatformType.SinaWeibo, "ShareSDK", hashtable3);
        }
    }
コード例 #23
0
    public void OnClickCallBack()
    {
        string shareUrl = "https://api.shaojishiduo.com/GameScream/share?s=" + PlayerPrefs.GetString("ShareID");

        switch (_type)
        {
        case ShareInfoButtonType.SIB_COPYLINK:
        {
            GameObject canvas = GameObject.Find("Canvas");
            GameObject tip    = GameObject.Instantiate(_copyTipPrefab, new Vector3(Screen.width / 2, Screen.height / 2, 0.0f), Quaternion.identity);
            tip.transform.SetParent(canvas.transform);
            //tip.transform.position = new Vector3 (0, 0, 0);
            ClipboardManager.CopyToClipboard("尖叫鸟!这游戏有毒,我已中毒至深,尖叫根本停不下来!你也来试试吧!" + shareUrl);
        }
        break;

        case ShareInfoButtonType.SIB_SHARELINK:
        {
            string shareTitle = "这游戏有毒,我已中毒至深,尖叫根本停不下来!";
            string shareDesc  = "与全世界一起尖叫!谁才是声控之王?是你吗?";

            string shareTitleEn = "This game is poisonous and i have been poisoned deeply! I can't stop playing and screaming!";
            string shareDescEn  = "Scream with people around the world! Who is the king of voice control? Is that you?";

            string shareSite = "尖叫鸟";
            //string shareUrl = "https://api.shaojishiduo.com/GameScream/share?s=" + PlayerPrefs.GetString("ShareID");
            string shareImg = "http://liteapp-1252384896.costj.myqcloud.com/scream/images/bird_icon_256.png";

            ShareContent content = new ShareContent();
            content.SetText(shareDesc);
            content.SetImageUrl(shareImg);
            content.SetTitle(shareTitle);
            content.SetTitleUrl(shareUrl);
            content.SetSite(shareSite);
            content.SetSiteUrl(shareUrl);
            content.SetUrl(shareUrl);
            content.SetComment(shareDesc);
            content.SetShareType(ContentType.Webpage);
            //不同平台分享不同内容
            //				ShareContent customizeShareParams = new ShareContent();
            //				customizeShareParams.SetText(shareDesc);
            //				customizeShareParams.SetImageUrl(shareImg);
            //				customizeShareParams.SetShareType(ContentType.Webpage);
            //				customizeShareParams.SetObjectID("SinaID");
            //				content.SetShareContentCustomize(PlatformType.SinaWeibo, customizeShareParams);

            //Instagram
            //				ShareContent sInstagram = new ShareContent();
            //				sInstagram.SetText(shareDesc);
            //				sInstagram.SetImageUrl(shareImg);
            //				sInstagram.SetShareType(ContentType.Image);
            //				content.SetShareContentCustomize(PlatformType.Instagram, sInstagram);

            //fbfb
            ShareContent sFacebook = new ShareContent();
            sFacebook.SetText(shareTitleEn);
            sFacebook.SetTitle(shareDescEn);
            sFacebook.SetImageUrl(shareImg);
            sFacebook.SetShareType(ContentType.Webpage);
            content.SetShareContentCustomize(PlatformType.Facebook, sFacebook);

            //Twitter
            ShareContent sTwitter = new ShareContent();
            sTwitter.SetText(shareDescEn + " Download:" + shareUrl);
            sTwitter.SetImageUrl(shareImg);
            sTwitter.SetUrl(shareUrl);
            sTwitter.SetShareType(ContentType.Auto);
            content.SetShareContentCustomize(PlatformType.Twitter, sTwitter);

            PlatformType[] pfs = { PlatformType.WeChat,   PlatformType.WeChatMoments,
                                   PlatformType.Facebook,
                                   PlatformType.QQ,       PlatformType.QZone, PlatformType.Twitter };

            //通过分享菜单分享
            ssdk.ShowPlatformList(pfs, content, 100, 100);
        }
        break;
        }
    }
コード例 #24
0
    void OnGUI()
    {
        GUI.skin = demoSkin;

        float scale = 1.0f;

        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            scale = Screen.width / 320;
        }

        float btnWidth  = 200 * scale;
        float btnHeight = 45 * scale;
        float btnTop    = 20 * scale;

        GUI.skin.button.fontSize = Convert.ToInt32(16 * scale);

        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "Authorize"))
        {
            print(ssdk == null);

            ssdk.Authorize(PlatformType.SinaWeibo);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "Get User Info"))
        {
            ssdk.GetUserInfo(PlatformType.SinaWeibo);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "Show Share Menu"))
        {
            ShareContent content = new ShareContent();
            content.SetText("this is a test string.");
            content.SetImageUrl("https://f1.webshare.mob.com/code/demo/img/1.jpg");
            content.SetTitle("test title");
            content.SetTitleUrl("http://www.mob.com");
            content.SetSite("Mob-ShareSDK");
            content.SetSiteUrl("http://www.mob.com");
            content.SetUrl("http://www.mob.com");
            content.SetComment("test description");
            content.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
            content.SetShareType(ContentType.Image);

            //不同平台分享不同内容
            ShareContent customizeShareParams = new ShareContent();
            customizeShareParams.SetText("Sina share content");
            customizeShareParams.SetImageUrl("http://git.oschina.net/alexyu.yxj/MyTmpFiles/raw/master/kmk_pic_fld/small/107.JPG");
            customizeShareParams.SetShareType(ContentType.Image);
            customizeShareParams.SetObjectID("SinaID");
            content.SetShareContentCustomize(PlatformType.SinaWeibo, customizeShareParams);

            ssdk.ShowPlatformList(null, content, 100, 100);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "Show Share View"))
        {
            ShareContent content = new ShareContent();
            content.SetText("this is a test string.");
            content.SetImageUrl("https://f1.webshare.mob.com/code/demo/img/1.jpg");
            content.SetTitle("test title");
            content.SetTitleUrl("http://www.mob.com");
            content.SetSite("Mob-ShareSDK");
            content.SetSiteUrl("http://www.mob.com");
            content.SetUrl("http://www.mob.com");
            content.SetComment("test description");
            content.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
            content.SetShareType(ContentType.Image);
            ssdk.ShowShareContentEditor(PlatformType.TencentWeibo, content);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "Share Content"))
        {
            ShareContent content = new ShareContent();
            content.SetText("this is a test string.");
            content.SetImageUrl("https://f1.webshare.mob.com/code/demo/img/1.jpg");
            content.SetTitle("test title");
            content.SetTitleUrl("http://www.mob.com");
            content.SetSite("Mob-ShareSDK");
            content.SetSiteUrl("http://www.mob.com");
            content.SetUrl("http://www.mob.com");
            content.SetComment("test description");
            content.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
            content.SetShareType(ContentType.Image);
            ssdk.ShareContent(PlatformType.SinaWeibo, content);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "Get Friends SinaWeibo "))
        {
            //获取新浪微博好友,第一页,每页15条数据
            print("Click Btn Of Get Friends SinaWeibo");
            ssdk.GetFriendList(PlatformType.SinaWeibo, 15, 0);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "Get Token SinaWeibo "))
        {
            Hashtable authInfo = ssdk.GetAuthInfo(PlatformType.SinaWeibo);
            print("share result :");
            print(MiniJSON.jsonEncode(authInfo));
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "Close SSO Auth"))
        {
            ssdk.DisableSSO(true);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "Remove Authorize "))
        {
            ssdk.CancelAuthorize(PlatformType.SinaWeibo);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "Add Friend "))
        {
            //关注新浪微博
            ssdk.AddFriend(PlatformType.SinaWeibo, "3189087725");
        }
    }
コード例 #25
0
ファイル: Panel_Hall.cs プロジェクト: dydlegd/DT
        private void EventInit()
        {
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_自由匹配").gameObject).onClick = delegate
            {
                //Handheld.PlayFullScreenMovie("MJ_Movie.mp4", Color.black, FullScreenMovieControlMode.Full);
                //GameApp.Instance.SetGameState(GAME_STATE.MAIN);
                DealCommand.Instance.SendJoinRoom_自由匹配();
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_创建房间").gameObject).onClick = delegate
            {
                ViewCenter.Instance.ShowPanel <UIPanelBase>(PanelType.CreateRoom);
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_加入游戏").gameObject).onClick = delegate
            {
                ViewCenter.Instance.ShowPanel <UIPanelBase>(PanelType.JoinRoom);
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_玩法介绍").gameObject).onClick = delegate
            {
                ViewCenter.Instance.ShowPanel <UIPanelBase>(PanelType.Help);
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_战绩").gameObject).onClick = delegate
            {
                ViewCenter.Instance.ShowPanel <UIPanelBase>(PanelType.Record);
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_设置").gameObject).onClick = delegate
            {
                ViewCenter.Instance.ShowPanel <UIPanelBase>(PanelType.Setting);
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_分享").gameObject).onClick = delegate
            {
                ShareContent content = new ShareContent();
                content.SetText(Tags.Title_Name + ",快来和我一起玩游戏吧!");
                content.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
                //content.SetImageUrl("http://fir.im/1946");
                content.SetTitle(Tags.Title_Name);
                content.SetTitleUrl("http://fir.im/1946");
                content.SetSite("Mob-ShareSDK");
                content.SetSiteUrl("http://fir.im/1946");
                content.SetUrl("http://fir.im/1946");
                content.SetComment("描述");
                //content.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
                content.SetShareType(ContentType.Webpage);
                WeiXinCenter.Instance.ShareWeChatMoments(content);
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_反馈").gameObject).onClick = delegate
            {
                ControlCenter.Instance.CaptureShare();
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Add_Gold").gameObject).onClick = delegate
            {
                ViewCenter.Instance.GetPanel <Panel_MessageBox>(PanelType.MessageBox).ShowMessageBox(Tags.TextPrompt.sContactAdmin + DataCenter.Instance.gamedata.AdministratorName, "", null);
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Add_Diamond").gameObject).onClick = delegate
            {
                ViewCenter.Instance.GetPanel <Panel_MessageBox>(PanelType.MessageBox).ShowMessageBox(Tags.TextPrompt.sContactAdmin + DataCenter.Instance.gamedata.AdministratorName, "", null);
            };

            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "开始录音").gameObject).onClick = delegate
            {
                GameApp.Instance.StartRecording();
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "结束录音").gameObject).onClick = delegate
            {
                GameApp.Instance.EndRecording();
            };

            NotificationCenter.Instance.AddNotificationEvent(NotificateMsgType.PLAYER_SCORE, SetLabel_Coin);
            NotificationCenter.Instance.AddNotificationEvent(NotificateMsgType.PLAYER_DIAMOND, SetLabel_Diamond);
        }
コード例 #26
0
    void OnGUI()
    {
        GUI.skin = demoSkin;

        float scale = 1.0f;

        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            scale = Screen.width / 320;
        }

        float btnWidth  = 165 * scale;
        float btnHeight = 30 * scale;
        float btnTop    = 20 * scale;
        float btnGap    = 20 * scale;

        GUI.skin.button.fontSize = Convert.ToInt32(14 * scale);

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 - btnWidth, btnTop, btnWidth, btnHeight), "Authorize"))
        {
            print(ssdk == null);

            ssdk.Authorize(PlatformType.QQ);
        }

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Get User Info"))
        {
            ssdk.GetUserInfo(PlatformType.SinaWeibo);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 - btnWidth, btnTop, btnWidth, btnHeight), "Show Share Menu"))
        {
            ShareContent content = new ShareContent();
            content.SetText("this is a test string.");
            content.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
            content.SetTitle("test title");
            content.SetTitleUrl("http://www.mob.com");
            content.SetSite("Mob-ShareSDK");
            content.SetSiteUrl("http://www.mob.com");
            content.SetUrl("http://www.mob.com");
            content.SetComment("test description");
            content.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
            content.SetShareType(ContentType.Image);

            //不同平台分享不同内容
            ShareContent customizeShareParams = new ShareContent();
            customizeShareParams.SetText("Sina share content");
            customizeShareParams.SetImageUrl("http://git.oschina.net/alexyu.yxj/MyTmpFiles/raw/master/kmk_pic_fld/small/107.JPG");
            customizeShareParams.SetShareType(ContentType.Text);
            customizeShareParams.SetObjectID("SinaID");
            content.SetShareContentCustomize(PlatformType.SinaWeibo, customizeShareParams);
            //优先客户端分享
            // content.SetEnableClientShare(true);
            //使用微博高级接口进行本地图片 文字 应用内分享 17年6月30日后需申请高级接口
            // content.SetEnableAdvancedInterfaceShare(true);
            //通过分享菜单分享
            ssdk.ShowPlatformList(null, content, 100, 100);
        }

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Show Share View"))
        {
            ShareContent content = new ShareContent();
            content.SetText("this is a test string.");
            content.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
            content.SetTitle("test title");
            content.SetTitleUrl("http://www.mob.com");
            content.SetSite("Mob-ShareSDK");
            content.SetSiteUrl("http://www.mob.com");
            content.SetUrl("http://www.mob.com");
            content.SetComment("test description");
            content.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
            content.SetShareType(ContentType.Image);

            ssdk.ShowShareContentEditor(PlatformType.SinaWeibo, content);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 - btnWidth, btnTop, btnWidth, btnHeight), "Share Content"))
        {
            ShareContent content = new ShareContent();
            content.SetText("this is a test string.");
            content.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
            content.SetTitle("test title");
//			content.SetTitleUrl("http://www.mob.com");
//			content.SetSite("Mob-ShareSDK");
            // content.SetSiteUrl("http://www.mob.com");
            content.SetUrl("http://qjsj.youzu.com/jycs/");
//			content.SetComment("test description");
//			content.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
            content.SetShareType(ContentType.Webpage);
            ssdk.ShareContent(PlatformType.WeChat, content);
        }

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Get Friends SinaWeibo "))
        {
            //获取新浪微博好友,第一页,每页15条数据
            print("Click Btn Of Get Friends SinaWeibo");
            ssdk.GetFriendList(PlatformType.SinaWeibo, 15, 0);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 - btnWidth, btnTop, btnWidth, btnHeight), "Get Token SinaWeibo "))
        {
            Hashtable authInfo = ssdk.GetAuthInfo(PlatformType.SinaWeibo);
            print("share result :");
            print(MiniJSON.jsonEncode(authInfo));
        }

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Close SSO Auth"))
        {
            ssdk.DisableSSO(true);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 - btnWidth, btnTop, btnWidth, btnHeight), "Remove Authorize "))
        {
            ssdk.CancelAuthorize(PlatformType.SinaWeibo);
        }

        if (GUI.Button(new Rect((Screen.width - btnGap) / 2 + btnGap, btnTop, btnWidth, btnHeight), "Add Friend "))
        {
            //关注新浪微博
            ssdk.AddFriend(PlatformType.SinaWeibo, "3189087725");
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "ShareWithContentName"))
        {
            Hashtable customFields = new Hashtable();
            customFields["imgUrl"] = "http://ww1.sinaimg.cn/mw690/006dJESWgw1f6iyb8bzraj31kw0v67a2.jpg";
            //根据配置文件分享【本接口功能仅暂时支持iOS】
            ssdk.ShareWithContentName(PlatformType.SinaWeibo, "ShareSDK", customFields);
        }

        btnWidth += 80 * scale;
        btnTop   += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "ShowShareMenuWithContentName"))
        {
            Hashtable customFields = new Hashtable();
            customFields["imgUrl"] = "http://ww1.sinaimg.cn/mw690/006dJESWgw1f6iyb8bzraj31kw0v67a2.jpg";
            //根据配置文件展示分享菜单分享【本接口功能仅暂时支持iOS】
            ssdk.ShowPlatformListWithContentName("ShareSDK", customFields, null, 100, 100);
        }

        btnTop += btnHeight + 20 * scale;
        if (GUI.Button(new Rect((Screen.width - btnWidth) / 2, btnTop, btnWidth, btnHeight), "ShowShareViewWithContentName"))
        {
            Hashtable customFields = new Hashtable();
            //根据配置文件展示编辑界面分享【本接口功能仅暂时支持iOS】
            customFields["imgUrl"] = "http://ww1.sinaimg.cn/mw690/006dJESWgw1f6iyb8bzraj31kw0v67a2.jpg";
            ssdk.ShowShareContentEditorWithContentName(PlatformType.SinaWeibo, "ShareSDK", customFields);
        }
    }
コード例 #27
0
ファイル: WechatOperateScript.cs プロジェクト: YLancer/client
    public void inviteFriend()
    {
        if (GlobalDataScript.roomVo != null)
        {
            RoomCreateVo roomvo = GlobalDataScript.roomVo;
            GlobalDataScript.totalTimes   = roomvo.roundNumber;
            GlobalDataScript.surplusTimes = roomvo.roundNumber;
            string str = "";

            if (roomvo.hong)
            {
                str += "红中麻将,";
            }
            else
            {
                if (roomvo.roomType == 1)
                {
                    str += "转转麻将,";
                }
                else if (roomvo.roomType == 2)
                {
                    str += "划水麻将,";
                }
                else if (roomvo.roomType == 3)
                {
                    str += "长沙麻将,";
                }
                else if (roomvo.roomType == 4)
                {
                    str += "广东麻将,";
                }
            }

            str += "大战" + roomvo.roundNumber + "局,";
            if (roomvo.roomType == 4)
            {
                if (roomvo.gangHu)
                {
                    str += "可抢杠胡,";
                }
            }
            else
            {
                if (roomvo.ziMo == 1)
                {
                    str += "只能自摸,";
                }
                else
                {
                    str += "可抢杠胡,";
                }
            }

            if (roomvo.sevenDouble)
            {
                str += "可胡七对,";
            }

            if (roomvo.addWordCard)
            {
                str += "有风牌,";
            }
            else
            {
                str += "无风牌,";
            }

            if (roomvo.xiaYu > 0)
            {
                str += "下鱼" + roomvo.xiaYu + "条,";
            }

            if (roomvo.ma > 0)
            {
                str += "抓" + roomvo.ma + "个码,";
            }
            if (roomvo.magnification > 0)
            {
                str += "倍率" + roomvo.magnification;
            }
            str += "有胆,你就来!";

            string       title = "友约麻将    " + "房间号:" + roomvo.roomId;
            ShareContent customizeShareParams = new ShareContent();
            customizeShareParams.SetTitle(title);
            customizeShareParams.SetText(str);
            //配置下载地址
            customizeShareParams.SetUrl("http://119.23.128.56:8080/download/index.html");
            //配置分享logo
            customizeShareParams.SetImageUrl("http://119.23.128.56:8080/download/logo.png");
            customizeShareParams.SetShareType(ContentType.Webpage);
            customizeShareParams.SetObjectID("");
            shareSdk.ShareContent(PlatformType.WeChat, customizeShareParams);
        }
    }