예제 #1
0
 /// <summary>
 /// 回调外发传接来的GetInfo回调接口
 /// </summary>
 ///
 /// <param name="type">Type.</param>
 /// <param name="result">Result.</param>
 public void MidasGetInfoFinishCallback(string type, int retCode, string json)
 {
     if (mMidasGetInfoCallback != null)
     {
         mMidasGetInfoCallback.GetInfoFinished(type, retCode, json);
         // 用完即废,防止影响后续逻辑
         mMidasGetInfoCallback = null;
     }
 }
예제 #2
0
        public void GetInfo(string reqType, APMidasBaseRequest req, MidasGetInfoCallback callback)
        {
            if (!mHasInited)
            {
                Debug.LogError("you should call Initialize first");
                return;
            }
            try {
                mMidasGetInfoCallback = callback;
//				mAPMidasBasePayRequest = req;
                string bizType = req.GetType().Name;
                ULog.Log("PayType = " + bizType);
                string reqString = req.ToString();
                ULog.Log("GetInfo with json : " + reqString);

#if UNITY_EDITOR
                ULog.Log("Simulator GetInfo");
#elif UNITY_ANDROID
                helper = new AndroidJavaClass(helperClass);
                if (helper == null)
                {
                    ULog.Log("Cannot get Java helper class");
                }
                else
                {
                    helper.CallStatic("GetInfo", reqType, bizType, reqString);
                }
#elif UNITY_IOS
                // IOS bizTy=APMidasGameRequest
                midasSdkGetInfo(reqType, bizType, reqString);
#endif
            }
            catch (System.Exception e) {
                ULog.LogError("catch exception : " + e.Message);
            }
        }