示例#1
0
        /// <summary>
        /// 打开指定网页
        /// </summary>
        /// <param name="url">网络链接</param>
        /// <param name="screenType">1 默认 2 竖屏 3 横屏 </param>
        /// <param name="isFullScreen">是否全屏</param>
        /// <param name="isUseURLEcode">使用 URL 编码方式,处理非 UTF-8 的字符</param>
        /// <param name="extraJson">扩展字段</param>
        /// <param name="isBrowser">使用系统自带的浏览器打开链接</param>
        public static void OpenUrl(string url, MSDKWebViewOrientation screenType = MSDKWebViewOrientation.Auto, bool isFullScreen = false,
                                   bool isUseURLEcode = true, string extraJson = "", bool isBrowser = false)
        {
            try
            {
                MSDKLog.Log("OpenUrl url=" + url + " screenType=" + screenType + " isFullScreen=" + isFullScreen + " isUseURLEcode=" + isUseURLEcode
                            + " extraJson=" + extraJson + " extraJson=" + extraJson + " isBrowser=" + isBrowser);
#if UNITY_EDITOR
#else
                openUrlAdapter(url, (int)screenType, isFullScreen, isUseURLEcode, extraJson, isBrowser);
#endif
            }
            catch (Exception ex)
            {
                MSDKLog.LogError("OpenUrl with unknown error = \n" + ex.Message + "\n" + ex.StackTrace);
            }
        }
示例#2
0
        /// <summary>
        /// 打开 ams 活动中心
        /// </summary>
        /// <param name="gameName"> 业务代码缩写,每个业务不同,各业务在接入AMS平台时由系统分配。 </param>
        /// <param name="actChannelId">活动渠道ID,由活动管理端后台分配,各业务登录[互娱AMS]管理端自行获取。</param>
        /// <param name="zoneId">用户区服信息,大区 1手Q,2微信</param>
        /// <param name="platformId">平台ID:iOS(0),安卓(1)</param>
        /// <param name="partitionId">小区ID</param>
        /// <param name="roleId">角色ID</param>
        /// <param name="screenType">屏幕方向:1 默认 2 竖屏 3 横屏</param>
        /// <param name="extraJson">扩展字段,默认为空</param>

        public static void OpenAmsCenter(string gameName,
                                         string actChannelId,
                                         string zoneId,
                                         string platformId,
                                         string partitionId,
                                         string roleId,
                                         MSDKWebViewOrientation screenType = MSDKWebViewOrientation.Auto,
                                         string extraJson = "")
        {
            try
            {
                MSDKLog.Log("OpenAmsCenter gameName=" + gameName + " actChannelId=" + actChannelId + " zoneId=" + zoneId + " platformId=" + platformId
                            + " roleId=" + roleId + " screenType=" + screenType + " extraJson=" + extraJson);
#if UNITY_EDITOR
#else
                openAmsCenterAdapter(gameName, actChannelId, zoneId, platformId, partitionId, roleId, (int)screenType, extraJson);
#endif
            }
            catch (Exception ex)
            {
                MSDKLog.LogError("OpenAmsCenter with unknown error = \n" + ex.Message + "\n" + ex.StackTrace);
            }
        }