Exemple #1
0
        // Update is called once per frame
        void Update()
        {
            // 队列中有值,则取出并在UnityMain线程回调到游戏
            string jsonStr = "";

            lock (queueLock) {
                if (resultQueue.Count > 0)
                {
                    jsonStr = (String)resultQueue.Dequeue();
                }
            }
            if (String.IsNullOrEmpty(jsonStr))
            {
                return;
            }
            JsonData data = null;

            try {
                data = JsonMapper.ToObject(jsonStr);
                String methodName = (string)data["MsdkMethod"];
                if (String.IsNullOrEmpty(methodName))
                {
                    MsdkUtil.Log("Process message error! MsdkMethod is null.");
                    MsdkUtil.Log(jsonStr);
                    return;
                }
                MsdkUtil.Log("MessageCenter receive : " + jsonStr);
                MethodInfo methodInfo = Instance.GetType().GetMethod(methodName, new [] { typeof(string) });
                methodInfo.Invoke(Instance, new object[] { jsonStr });
            } catch (Exception e) {
                MsdkUtil.Log("update json parse exception");
                MsdkUtil.Log(jsonStr);
                MsdkUtil.Log(e.Message);
            }
        }
Exemple #2
0
        public void Init()
        {
            string logVersion = "MSDK Unity Version : " + WGPlatform.Version;

            MsdkUtil.Log(logVersion);
            WGPlatform.Instance.WGBuglyLog(eBuglyLogLevel.eBuglyLogLevel_D, logVersion);

            MessageCenter.Instance.Init();
            WGPlatform.Instance.WGSetPermission(ePermission.eOPEN_ALL);
            BuglyAgent.ConfigCrashReporter(2, 4);
            // NOT Required. Enable debug log print, please set false for release version
            BuglyAgent.ConfigDebugMode(false);
            // Setting report level
            BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogException);
            // Required. If you do not need call 'InitWithAppId(string)' to initialize the sdk(may be you has initialized the sdk it associated Android or iOS project),
            // please call this method to enable c# exception handler only.
            BuglyAgent.EnableExceptionHandler();
            // NOT Required. If you need to report extra data with exception, you can set the extra handler
            // 只在iOS的C#异常时会触发
            //BuglyAgent.SetLogCallbackExtrasHandler (MyLogCallbackExtrasHandler);
        }
Exemple #3
0
//        public void WGQueryQQGroupKey(string cGroupOpenid)
//        {
//            MsdkUtil.Log("Error : This interface is only use in Android!");
//            throw new NotImplementedException();
//        }

        public void WGAddCardToWXCardPackage(string cardId, string timestamp, string sign)
        {
            MsdkUtil.Log("Error : This interface is only use in Android!");
            throw new NotImplementedException();
        }
Exemple #4
0
 public void WGUnbindQQGroup(string cGroupOpenid, string cUnionid)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
Exemple #5
0
 public int WGCheckYYBInstalled()
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
Exemple #6
0
 public void WGStartSaveUpdate(bool isUseYYB)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
Exemple #7
0
 public void WGSendToQQWithVideo(string summary, string videoPath)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
Exemple #8
0
 public void WGSendToQQWithPhoto(eQQScene scene, string imgFilePath)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
 public void WGOpenMSDKLog(bool enabled)
 {
     MsdkUtil.Log("Error : This interface is only use in iOS!");
     throw new NotImplementedException();
 }
 public void WGClearLocalNotification(LocalMessageIOS localMessage)
 {
     MsdkUtil.Log("Error : This interface is only use in iOS!");
     throw new NotImplementedException();
 }
 public long WGAddLocalNotificationAtFront(LocalMessageIOS localMessage)
 {
     MsdkUtil.Log("Error : This interface is only use in iOS!");
     throw new NotImplementedException();
 }
 public void WGSendToQQWithPhoto(eQQScene scene, byte[] imgData, int imgDataLen)
 {
     MsdkUtil.Log("Error : This interface is only use in iOS!");
     throw new NotImplementedException();
 }
 public void WGSendToQQ(eQQScene scene, string title, string desc, string url, byte[] imgData, int imgDataLen)
 {
     MsdkUtil.Log("Error : This interface is only use in iOS!");
     throw new NotImplementedException();
 }
Exemple #14
0
 void OnDestroy()
 {
     MsdkUtil.Log(bridgeGameObject.name + " OnDestroy");
 }
Exemple #15
0
 public void WGSendToWeixinWithPhotoPath(eWechatScene scene, string mediaTagName, string imgPath, string messageExt, string messageAction)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
Exemple #16
0
 public void WGSendToQQ(eQQScene scene, string title, string desc, string url, string imgUrl, int imgUrlLen)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
 public void WGResetGuestID()
 {
     MsdkUtil.Log("Error : This interface is only use in iOS!");
     throw new NotImplementedException();
 }
Exemple #18
0
 public void WGSendToQQWithRichPhoto(string summary, ArrayList imgs)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
Exemple #19
0
 public void WGOpenUrl(string openUrl, eMSDK_SCREENDIR screendir)
 {
     MsdkUtil.Log("Warnning : This api was deprecated. Please use 'WGOpenUrl(string openUrl)' instead.");
     iOSConnector.OpenUrlWithScreenDir(openUrl, (int)screendir);
 }
Exemple #20
0
 public bool WGCheckApiSupport(eApiName apiName)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
Exemple #21
0
 public void WGJoinQQGroup(string qqGroupKey)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
Exemple #22
0
 public void WGCheckNeedUpdate()
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
Exemple #23
0
 public void WGQueryQQGroupInfo(string cUnionid, string cZoneid)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
Exemple #24
0
 public long WGAddLocalNotification(LocalMessageAndroid msg)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
Exemple #25
0
 public void Init()
 {
     MsdkUtil.Log("Init MSDKCallbackBridge");
 }