/// <summary>
 /// 支付
 /// </summary>
 public static void Pay(string SDKName, string goodsID, string tag, GoodsType goodsType = GoodsType.NORMAL, string orderID = null)
 {
     if (s_useNewSDKManager)
     {
         SDKManagerNew.Pay(SDKName, goodsID, tag, goodsType, orderID);
     }
     else
     {
         try
         {
             GetPayService(SDKName).Pay(goodsID, tag);
         }
         catch (Exception e)
         {
             Debug.LogError("SDKManager Pay Exception: " + e.ToString());
         }
     }
 }
Beispiel #2
0
 /// <summary>
 /// 隐藏广告
 /// </summary>
 /// <param name="adType"></param>
 public static void CloseAD(string SDKName, ADType adType, string tag = "")
 {
     if (s_useNewSDKManager)
     {
         SDKManagerNew.CloseAD(SDKName, adType, tag);
     }
     else
     {
         try
         {
             GetADService(SDKName).CloseAD(adType, tag);
         }
         catch (Exception e)
         {
             Debug.LogError("SDKManager CloseAD Exception: " + e.ToString());
         }
     }
 }
 /// <summary>
 /// 登陆
 /// </summary>
 public static void Login(string SDKName, string tag = "")
 {
     if (s_useNewSDKManager)
     {
         SDKManagerNew.Login(SDKName, tag);
     }
     else
     {
         try
         {
             GetLoginService(SDKName).Login(tag);
         }
         catch (Exception e)
         {
             Debug.LogError("SDKManager Login Exception: " + e.ToString());
         }
     }
 }
Beispiel #4
0
 /// <summary>
 /// 显示广告
 /// </summary>
 public static void PlayAD(ADType adType, string tag = "")
 {
     if (s_useNewSDKManager)
     {
         SDKManagerNew.PlayAD(adType, tag);
     }
     else
     {
         try
         {
             GetADService(0).PlayAD(adType, tag);
         }
         catch (Exception e)
         {
             Debug.LogError("SDKManager PlayAD Exception: " + e.ToString());
         }
     }
 }
Beispiel #5
0
        public static void LogUseItem(string goodsID, int num)
        {
            CheckInit();
            if (s_useNewSDKManager)
            {
                SDKManagerNew.LogUseItem(goodsID, num);
            }

            for (int i = 0; i < s_logServiceList.Count; i++)
            {
                try
                {
                    s_logServiceList[i].LogUseItem(goodsID, num);
                }
                catch (Exception e)
                {
                    Debug.LogError("SDKManager LogUseItem Exception: " + e.ToString());
                }
            }
        }
Beispiel #6
0
        public static void LogPurchaseVirtualCurrency(string goodsID, int num, float price)
        {
            CheckInit();
            if (s_useNewSDKManager)
            {
                SDKManagerNew.LogPurchaseVirtualCurrency(goodsID, num, price);
            }

            for (int i = 0; i < s_logServiceList.Count; i++)
            {
                try
                {
                    s_logServiceList[i].LogPurchaseVirtualCurrency(goodsID, num, price);
                }
                catch (Exception e)
                {
                    Debug.LogError("SDKManager PurchaseVirtualCurrency Exception: " + e.ToString());
                }
            }
        }
Beispiel #7
0
        public static void LogPaySuccess(string orderID)
        {
            CheckInit();
            if (s_useNewSDKManager)
            {
                SDKManagerNew.LogPaySuccess(orderID);
            }

            for (int i = 0; i < s_logServiceList.Count; i++)
            {
                try
                {
                    s_logServiceList[i].LogPaySuccess(orderID);
                }
                catch (Exception e)
                {
                    Debug.LogError("SDKManager LogPaySuccess Exception: " + e.ToString());
                }
            }
        }
Beispiel #8
0
        //以下三个配合使用,用于追踪虚拟物品的产出消耗
        public static void LogRewardVirtualCurrency(float count, string reason)
        {
            CheckInit();
            if (s_useNewSDKManager)
            {
                SDKManagerNew.LogRewardVirtualCurrency(count, reason);
            }

            for (int i = 0; i < s_logServiceList.Count; i++)
            {
                try
                {
                    s_logServiceList[i].LogRewardVirtualCurrency(count, reason);
                }
                catch (Exception e)
                {
                    Debug.LogError("SDKManager RewardVirtualCurrency Exception: " + e.ToString());
                }
            }
        }
Beispiel #9
0
        public static void LogLoginOut(string accountID)
        {
            CheckInit();
            if (s_useNewSDKManager)
            {
                SDKManagerNew.LogLoginOut(accountID);
            }

            for (int i = 0; i < s_logServiceList.Count; i++)
            {
                try
                {
                    s_logServiceList[i].LogLoginOut(accountID);
                }
                catch (Exception e)
                {
                    Debug.LogError("SDKManager LogLoginOut Exception: " + e.ToString());
                }
            }
        }
Beispiel #10
0
        public static void LogPay(string orderID, string goodsID, int count, float price, string currency, string payment)
        {
            CheckInit();
            if (s_useNewSDKManager)
            {
                SDKManagerNew.LogPay(orderID, goodsID, count, price, currency, payment);
            }

            for (int i = 0; i < s_logServiceList.Count; i++)
            {
                try
                {
                    s_logServiceList[i].LogPay(orderID, goodsID, count, price, currency, payment);
                }
                catch (Exception e)
                {
                    Debug.LogError("SDKManager LogPay Exception: " + e.ToString());
                }
            }
        }
Beispiel #11
0
        public static void LogLogin(string accountID, Dictionary <string, string> data = null)
        {
            CheckInit();
            if (s_useNewSDKManager)
            {
                SDKManagerNew.LogLogin(accountID, data);
            }

            for (int i = 0; i < s_logServiceList.Count; i++)
            {
                try
                {
                    s_logServiceList[i].LogLogin(accountID, data);
                }
                catch (Exception e)
                {
                    Debug.LogError("SDKManager LogLogin Exception: " + e.ToString());
                }
            }
        }
        public static List <LoginPlatform> GetSupportLoginPlatform()
        {
            List <LoginPlatform> platforms = new List <LoginPlatform>();

            try
            {
                foreach (var item in s_loginServiceList)
                {
                    if (item.GetPlatform().Contains(Application.platform))
                    {
                        platforms.Add(item.GetLoginPlatform());
                    }
                }

                if (s_useNewSDKManager)
                {
                    List <LoginPlatform> newList = SDKManagerNew.GetSupportLoginPlatform();

                    for (int i = 0; i < newList.Count; i++)
                    {
                        if (!platforms.Contains(newList[i]))
                        {
                            platforms.Add(newList[i]);
                        }
                    }
                }

                if (platforms.Count == 0)
                {
                    Debug.LogError("SDKManager Login dont find class by platform:" + Application.platform + " please check config");
                }
            }
            catch (Exception e)
            {
                Debug.LogError("SDKManager Login Exception: " + e.ToString());
            }



            return(platforms);
        }
Beispiel #13
0
        /// <summary>
        /// 支付
        /// </summary>
        public static void Pay(string SDKName, PayInfo payInfo)
        {
            Debug.Log("Pay  SDKname " + SDKName + " GetHasSDKService " + GetHasSDKService(s_payServiceList, SDKName));

            //优先使用本地配置的SDK
            if (GetHasSDKService(s_payServiceList, SDKName))
            {
                try
                {
                    GetPayService(SDKName).Pay(payInfo);
                }
                catch (Exception e)
                {
                    Debug.LogError("SDKManager Pay Exception: " + e.ToString());
                }
            }

            else if (s_useNewSDKManager)
            {
                if (GetPrePay(SDKName))
                {
                    try
                    {
                        GetPayService("PublicPayClass").Pay(payInfo);
                    }
                    catch (Exception e)
                    {
                        Debug.LogError("SDKManager PublicPayClass Exception: " + e.ToString());
                    }
                }
                else
                {
                    SDKManagerNew.Pay(SDKName, payInfo);
                }
            }
            else
            {
                Debug.LogError("支付SDK 没有配置! ");
            }
        }
Beispiel #14
0
        /// <summary>
        /// 支付,默认访问第一个接口
        /// </summary>
        public static void Pay(PayInfo payInfo)
        {
            //优先使用本地配置的SDK
            if (s_payServiceList.Count > 0)
            {
                try
                {
                    GetPayService(0).Pay(payInfo);
                }
                catch (Exception e)
                {
                    Debug.LogError("SDKManager Pay Exception: " + e.ToString());
                }
            }

            else if (s_useNewSDKManager)
            {
                if (GetPrePay(""))
                {
                    try
                    {
                        GetPayService("PublicPayClass").Pay(payInfo);
                    }
                    catch (Exception e)
                    {
                        Debug.LogError("SDKManager PublicPayClass Exception: " + e.ToString());
                    }
                }
                else
                {
                    SDKManagerNew.Pay(payInfo);
                }
            }
            else
            {
                Debug.Log("支付SDK 没有配置! ");
            }
        }
Beispiel #15
0
        /// <summary>
        /// 加载广告
        /// </summary>
        public static void LoadAD(string SDKName, ADType adType, string tag = "")
        {
            if (GetHasSDKService(s_ADServiceList, SDKName))
            {
                try
                {
                    GetADService(SDKName).LoadAD(adType, tag);
                }
                catch (Exception e)
                {
                    Debug.LogError("SDKManager Pay Exception: " + e.ToString());
                }
            }

            else if (s_useNewSDKManager)
            {
                SDKManagerNew.LoadAD(SDKName, adType, tag);
            }
            else
            {
                Debug.LogError("广告SDK 没有配置! ");
            }
        }
Beispiel #16
0
 /// <summary>
 /// 支付
 /// </summary>
 public static void Pay(string SDKName, string goodsID, string tag, GoodsType goodsType = GoodsType.NORMAL, string orderID = null)
 {
     //优先使用本地配置的SDK
     if (GetHasSDKService(s_payServiceList, SDKName))
     {
         try
         {
             GetPayService(SDKName).Pay(goodsID, tag);
         }
         catch (Exception e)
         {
             Debug.LogError("SDKManager Pay Exception: " + e.ToString());
         }
     }
     else if (s_useNewSDKManager)
     {
         SDKManagerNew.Pay(SDKName, goodsID, tag, goodsType, orderID);
     }
     else
     {
         Debug.LogError("支付SDK 没有配置! ");
     }
 }
 /// <summary>
 /// 支付,默认访问第一个接口
 /// </summary>
 public static void Pay(PayInfo payInfo)
 {
     //优先使用本地配置的SDK
     if (s_payServiceList.Count > 0)
     {
         try
         {
             GetPayService(0).Pay(payInfo.goodsID, payInfo.tag);
         }
         catch (Exception e)
         {
             Debug.LogError("SDKManager Pay Exception: " + e.ToString());
         }
     }
     else if (s_useNewSDKManager)
     {
         SDKManagerNew.Pay(payInfo);
     }
     else
     {
         Debug.Log("支付SDK 没有配置! ");
     }
 }
Beispiel #18
0
 /// <summary>
 /// 游戏关闭
 /// </summary>
 public static void QuitApplication()
 {
     SDKManagerNew.QuitApplication();
 }
Beispiel #19
0
 /// <summary>
 /// 读取注入配置
 /// </summary>
 public static string GetProperties(string properties, string key, string defaultValue)
 {
     return(SDKManagerNew.GetProperties(properties, key, defaultValue));
 }
Beispiel #20
0
        public static void GetAPKSize(string url = null)
        {
#if UNITY_ANDROID
            SDKManagerNew.GetAPKSize(url);
#endif
        }
Beispiel #21
0
        public static void DownloadApk(string url = null)
        {
#if UNITY_ANDROID
            SDKManagerNew.DownloadApk(url);
#endif
        }
Beispiel #22
0
 public static bool GetReSendPay(String SDKName)
 {
     return(SDKManagerNew.GetReSendPay(SDKName));
 }