예제 #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);
            }
        }
예제 #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);
        }
예제 #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();
        }
예제 #4
0
 public void WGUnbindQQGroup(string cGroupOpenid, string cUnionid)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
예제 #5
0
 public int WGCheckYYBInstalled()
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
예제 #6
0
 public void WGStartSaveUpdate(bool isUseYYB)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
예제 #7
0
 public void WGSendToQQWithVideo(string summary, string videoPath)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
예제 #8
0
 public void WGSendToQQWithPhoto(eQQScene scene, string imgFilePath)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
예제 #9
0
 public void WGOpenMSDKLog(bool enabled)
 {
     MsdkUtil.Log("Error : This interface is only use in iOS!");
     throw new NotImplementedException();
 }
예제 #10
0
 public void WGClearLocalNotification(LocalMessageIOS localMessage)
 {
     MsdkUtil.Log("Error : This interface is only use in iOS!");
     throw new NotImplementedException();
 }
예제 #11
0
 public long WGAddLocalNotificationAtFront(LocalMessageIOS localMessage)
 {
     MsdkUtil.Log("Error : This interface is only use in iOS!");
     throw new NotImplementedException();
 }
예제 #12
0
 public void WGSendToQQWithPhoto(eQQScene scene, byte[] imgData, int imgDataLen)
 {
     MsdkUtil.Log("Error : This interface is only use in iOS!");
     throw new NotImplementedException();
 }
예제 #13
0
 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();
 }
예제 #14
0
 void OnDestroy()
 {
     MsdkUtil.Log(bridgeGameObject.name + " OnDestroy");
 }
예제 #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();
 }
예제 #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();
 }
예제 #17
0
 public void WGResetGuestID()
 {
     MsdkUtil.Log("Error : This interface is only use in iOS!");
     throw new NotImplementedException();
 }
예제 #18
0
 public void WGSendToQQWithRichPhoto(string summary, ArrayList imgs)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
예제 #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);
 }
예제 #20
0
 public bool WGCheckApiSupport(eApiName apiName)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
예제 #21
0
 public void WGJoinQQGroup(string qqGroupKey)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
예제 #22
0
 public void WGCheckNeedUpdate()
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
예제 #23
0
 public void WGQueryQQGroupInfo(string cUnionid, string cZoneid)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
예제 #24
0
 public long WGAddLocalNotification(LocalMessageAndroid msg)
 {
     MsdkUtil.Log("Error : This interface is only use in Android!");
     throw new NotImplementedException();
 }
예제 #25
0
 public void Init()
 {
     MsdkUtil.Log("Init MSDKCallbackBridge");
 }