添加实现基类;添加IAP接口调用
							parent
							
								
									97b9a6cc5a
								
							
						
					
					
						commit
						88576c3231
					
				| 
						 | 
					@ -2,11 +2,11 @@ using System;
 | 
				
			||||||
using Guru;
 | 
					using Guru;
 | 
				
			||||||
using UnityEngine;
 | 
					using UnityEngine;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace GuruSDKService
 | 
					namespace GuruService
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public partial class GuruSDKService
 | 
					    public static partial class GuruSDKService
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        private void AddCallbackListener()
 | 
					        private static void AddCallbackListener()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            GuruSDK.Callbacks.App.OnAppPaused += OnAppPaused;
 | 
					            GuruSDK.Callbacks.App.OnAppPaused += OnAppPaused;
 | 
				
			||||||
            GuruSDK.Callbacks.App.OnAppQuit += OnAppQuit;
 | 
					            GuruSDK.Callbacks.App.OnAppQuit += OnAppQuit;
 | 
				
			||||||
| 
						 | 
					@ -31,13 +31,13 @@ namespace GuruSDKService
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region App Callbacks
 | 
					        #region App Callbacks
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnAppPaused(bool paused)
 | 
					        private static void OnAppPaused(bool paused)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnAppPaused] paused:{paused}");
 | 
					            Log.I($"[GuruCallback][OnAppPaused] paused:{paused}");
 | 
				
			||||||
            _serviceImp?.OnAppPaused(paused);
 | 
					            _serviceImp?.OnAppPaused(paused);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnAppQuit()
 | 
					        private static void OnAppQuit()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnAppQuit]");
 | 
					            Log.I($"[GuruCallback][OnAppQuit]");
 | 
				
			||||||
            _serviceImp?.OnAppQuit();
 | 
					            _serviceImp?.OnAppQuit();
 | 
				
			||||||
| 
						 | 
					@ -47,28 +47,28 @@ namespace GuruSDKService
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region SDK Callbacks
 | 
					        #region SDK Callbacks
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private Action _onFirebaseReady;
 | 
					        private static Action _onFirebaseReady;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnFirebaseReady(bool success)
 | 
					        private static void OnFirebaseReady(bool success)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnFirebaseReady] success:{success}");
 | 
					            Log.I($"[GuruCallback][OnFirebaseReady] success:{success}");
 | 
				
			||||||
            if (success) _onFirebaseReady?.Invoke();
 | 
					            if (success) _onFirebaseReady?.Invoke();
 | 
				
			||||||
            _serviceImp?.OnFirebaseReady(success);
 | 
					            _serviceImp?.OnFirebaseReady(success);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnGuruServiceReady()
 | 
					        private static void OnGuruServiceReady()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnGuruServiceReady]");
 | 
					            Log.I($"[GuruCallback][OnGuruServiceReady]");
 | 
				
			||||||
            _serviceImp?.OnGuruServiceReady();
 | 
					            _serviceImp?.OnGuruServiceReady();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnUserAuthResult(bool success)
 | 
					        private static void OnUserAuthResult(bool success)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnUserAuthResult] success:{success}");
 | 
					            Log.I($"[GuruCallback][OnUserAuthResult] success:{success}");
 | 
				
			||||||
            _serviceImp?.OnUserAuthResult(success);
 | 
					            _serviceImp?.OnUserAuthResult(success);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnFirebaseAuthResult(bool success)
 | 
					        private static void OnFirebaseAuthResult(bool success)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnFirebaseAuthResult] success:{success}");
 | 
					            Log.I($"[GuruCallback][OnFirebaseAuthResult] success:{success}");
 | 
				
			||||||
            _serviceImp?.OnFirebaseAuthResult(success);
 | 
					            _serviceImp?.OnFirebaseAuthResult(success);
 | 
				
			||||||
| 
						 | 
					@ -78,13 +78,13 @@ namespace GuruSDKService
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region ConsentFlow Callbacks
 | 
					        #region ConsentFlow Callbacks
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnAttResult(int authorizationTrackingStatus)
 | 
					        private static void OnAttResult(int authorizationTrackingStatus)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnAttResult] authorizationTrackingStatus:{authorizationTrackingStatus}");
 | 
					            Log.I($"[GuruCallback][OnAttResult] authorizationTrackingStatus:{authorizationTrackingStatus}");
 | 
				
			||||||
            _serviceImp?.OnAttResult(authorizationTrackingStatus);
 | 
					            _serviceImp?.OnAttResult(authorizationTrackingStatus);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnConsentResult(int statusCode)
 | 
					        private static void OnConsentResult(int statusCode)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnConsentResult] statusCode:{statusCode}");
 | 
					            Log.I($"[GuruCallback][OnConsentResult] statusCode:{statusCode}");
 | 
				
			||||||
            _serviceImp?.OnConsentResult(statusCode);
 | 
					            _serviceImp?.OnConsentResult(statusCode);
 | 
				
			||||||
| 
						 | 
					@ -94,15 +94,15 @@ namespace GuruSDKService
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region AD Callbacks
 | 
					        #region AD Callbacks
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnAdsInitComplete()
 | 
					        private static void OnAdsInitComplete()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnAdsInitComplete]");
 | 
					            Log.I($"[GuruCallback][OnAdsInitComplete]");
 | 
				
			||||||
            _serviceImp?.OnAdsInitComplete();
 | 
					            _serviceImp?.OnAdsInitComplete();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public bool HasBannerADLoaded;
 | 
					        public static bool HasBannerADLoaded;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnBannerADLoaded()
 | 
					        private static void OnBannerADLoaded()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnBannerADLoaded]");
 | 
					            Log.I($"[GuruCallback][OnBannerADLoaded]");
 | 
				
			||||||
            GuruSDK.Callbacks.Ads.OnBannerADLoaded -= OnBannerADLoaded; //只监听第一次banner加载成功,处理banner显示逻辑
 | 
					            GuruSDK.Callbacks.Ads.OnBannerADLoaded -= OnBannerADLoaded; //只监听第一次banner加载成功,处理banner显示逻辑
 | 
				
			||||||
| 
						 | 
					@ -110,25 +110,25 @@ namespace GuruSDKService
 | 
				
			||||||
            _serviceImp?.OnBannerADLoaded();
 | 
					            _serviceImp?.OnBannerADLoaded();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnInterstitialADLoaded()
 | 
					        private static void OnInterstitialADLoaded()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnInterstitialADLoaded]");
 | 
					            Log.I($"[GuruCallback][OnInterstitialADLoaded]");
 | 
				
			||||||
            _serviceImp?.OnInterstitialADLoaded();
 | 
					            _serviceImp?.OnInterstitialADLoaded();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnInterstitialADFailed()
 | 
					        private static void OnInterstitialADFailed()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnInterstitialADFailed]");
 | 
					            Log.I($"[GuruCallback][OnInterstitialADFailed]");
 | 
				
			||||||
            _serviceImp?.OnInterstitialADFailed();
 | 
					            _serviceImp?.OnInterstitialADFailed();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnRewardedADLoaded()
 | 
					        private static void OnRewardedADLoaded()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnRewardedADLoaded]");
 | 
					            Log.I($"[GuruCallback][OnRewardedADLoaded]");
 | 
				
			||||||
            _serviceImp?.OnRewardedADLoaded();
 | 
					            _serviceImp?.OnRewardedADLoaded();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnRewardADFailed()
 | 
					        private static void OnRewardADFailed()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnRewardADFailed]");
 | 
					            Log.I($"[GuruCallback][OnRewardADFailed]");
 | 
				
			||||||
            _serviceImp?.OnRewardADFailed();
 | 
					            _serviceImp?.OnRewardADFailed();
 | 
				
			||||||
| 
						 | 
					@ -138,9 +138,9 @@ namespace GuruSDKService
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region Firebase Component Callbacks
 | 
					        #region Firebase Component Callbacks
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public bool IsRemoteConfigFetchSuccess = false;
 | 
					        public static bool IsRemoteConfigFetchSuccess = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnRemoteFetchComplete(bool success)
 | 
					        private static void OnRemoteFetchComplete(bool success)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnRemoteFetchComplete] success:{success}");
 | 
					            Log.I($"[GuruCallback][OnRemoteFetchComplete] success:{success}");
 | 
				
			||||||
            IsRemoteConfigFetchSuccess = success;
 | 
					            IsRemoteConfigFetchSuccess = success;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,11 +1,11 @@
 | 
				
			||||||
using Guru;
 | 
					using Guru;
 | 
				
			||||||
using UnityEngine.Purchasing;
 | 
					using UnityEngine.Purchasing;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace GuruSDKService
 | 
					namespace GuruService
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public partial class GuruSDKService
 | 
					    public partial class GuruSDKService
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        private void AddIAPCallbackListener()
 | 
					        private static void AddIAPCallbackListener()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            GuruSDK.Callbacks.IAP.OnIAPInitStart += OnIAPInitStart;
 | 
					            GuruSDK.Callbacks.IAP.OnIAPInitStart += OnIAPInitStart;
 | 
				
			||||||
            GuruSDK.Callbacks.IAP.OnIAPInitComplete += OnIAPInitComplete;
 | 
					            GuruSDK.Callbacks.IAP.OnIAPInitComplete += OnIAPInitComplete;
 | 
				
			||||||
| 
						 | 
					@ -17,41 +17,49 @@ namespace GuruSDKService
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region callbacks
 | 
					        #region callbacks
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnIAPInitStart()
 | 
					        private static void OnIAPInitStart()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnIAPInitStart]");
 | 
					            Log.I($"[GuruCallback][OnIAPInitStart]");
 | 
				
			||||||
 | 
					            _serviceImp.OnIAPInitStart();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnIAPInitComplete(bool success)
 | 
					        private static void OnIAPInitComplete(bool success)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnIAPInitComplete] success:{success}");
 | 
					            Log.I($"[GuruCallback][OnIAPInitComplete] success:{success}");
 | 
				
			||||||
 | 
					            _serviceImp.OnIAPInitComplete(success);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnPurchaseStart(string productName)
 | 
					        private static void OnPurchaseStart(string productName)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnPurchaseStart] productName:{productName}");
 | 
					            Log.I($"[GuruCallback][OnPurchaseStart] productName:{productName}");
 | 
				
			||||||
 | 
					            ShowIAPLoadingView();
 | 
				
			||||||
 | 
					            _serviceImp.OnPurchaseStart(productName);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnPurchaseEnd(string productName, bool success)
 | 
					        private static void OnPurchaseEnd(string productName, bool success)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnPurchaseEnd] productName:{productName}, success:{success}");
 | 
					            Log.I($"[GuruCallback][OnPurchaseEnd] productName:{productName}, success:{success}");
 | 
				
			||||||
 | 
					            CloseIAPLoadingView();
 | 
				
			||||||
 | 
					            _serviceImp.OnPurchaseEnd(productName, success);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnPurchaseFailed(string productName, string reason)
 | 
					        private static void OnPurchaseFailed(string productName, string reason)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnPurchaseFailed] productName:{productName}, reason:{reason}");
 | 
					            Log.I($"[GuruCallback][OnPurchaseFailed] productName:{productName}, reason:{reason}");
 | 
				
			||||||
 | 
					            _serviceImp.OnPurchaseFailed(productName, reason);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void OnIAPRestored(bool success, string msg)
 | 
					        private static void OnIAPRestored(bool success, string msg)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            Log.I($"[GuruCallback][OnIAPRestored] success:{success}, msg:{msg}");
 | 
					            Log.I($"[GuruCallback][OnIAPRestored] success:{success}, msg:{msg}");
 | 
				
			||||||
 | 
					            _serviceImp.OnIAPRestored(success, msg);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region 查询接口
 | 
					        #region 查询接口
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public string GetProductCurrencyCode(string productName)
 | 
					        public static string GetProductCurrencyCode(string productName)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (string.IsNullOrEmpty(productName))
 | 
					            if (string.IsNullOrEmpty(productName))
 | 
				
			||||||
                return Fallback();
 | 
					                return Fallback();
 | 
				
			||||||
| 
						 | 
					@ -68,7 +76,7 @@ namespace GuruSDKService
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public string GetProductPriceString(string productName)
 | 
					        public static string GetProductPriceString(string productName)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (string.IsNullOrEmpty(productName))
 | 
					            if (string.IsNullOrEmpty(productName))
 | 
				
			||||||
                return Fallback();
 | 
					                return Fallback();
 | 
				
			||||||
| 
						 | 
					@ -85,7 +93,7 @@ namespace GuruSDKService
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public double GetProductPrice(string productName)
 | 
					        public static double GetProductPrice(string productName)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (string.IsNullOrEmpty(productName))
 | 
					            if (string.IsNullOrEmpty(productName))
 | 
				
			||||||
                return Fallback();
 | 
					                return Fallback();
 | 
				
			||||||
| 
						 | 
					@ -104,9 +112,9 @@ namespace GuruSDKService
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void ShowIAPLoadingView() => _serviceImp.ShowIAPBuyLoadingView();
 | 
					        public static void ShowIAPLoadingView() => _serviceImp.ShowIAPBuyLoadingView();
 | 
				
			||||||
        public void CloseIAPLoadingView() => _serviceImp.CloseIAPLoadingView();
 | 
					        public static void CloseIAPLoadingView() => _serviceImp.CloseIAPLoadingView();
 | 
				
			||||||
        public void IAPBuySuccessTip() => _serviceImp.IAPBuySuccessTip();
 | 
					        public static void IAPBuySuccessTip() => _serviceImp.IAPBuySuccessTip();
 | 
				
			||||||
        public void IAPBuyFailTip() => _serviceImp.IAPBuyFailTip();
 | 
					        public static void IAPBuyFailTip() => _serviceImp.IAPBuyFailTip();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1,24 +1,24 @@
 | 
				
			||||||
using Guru;
 | 
					using Guru;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace GuruSDKService
 | 
					namespace GuruService
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public partial class GuruSDKService
 | 
					    public static partial class GuruSDKService
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        private void InitSDKModel()
 | 
					        private static void InitSDKModel()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (_serviceImp != null)
 | 
					            if (_serviceImp != null)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                SetGuruSDK_BLevel(_serviceImp.b_level);
 | 
					                SetGuruSDK_BLevel(_serviceImp.GetBLevel());
 | 
				
			||||||
                SetGuruSDK_BPlay(_serviceImp.b_play);
 | 
					                SetGuruSDK_BPlay(_serviceImp.GetBPlay());
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void SetGuruSDK_BLevel(int level)
 | 
					        public static void SetGuruSDK_BLevel(int level)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            GuruSDK.SuccessLevelCount = level;
 | 
					            GuruSDK.SuccessLevelCount = level;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void SetGuruSDK_BPlay(int play)
 | 
					        public static void SetGuruSDK_BPlay(int play)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            GuruSDK.TotalPlayedCount = play;
 | 
					            GuruSDK.TotalPlayedCount = play;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,16 +2,16 @@ using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
using Guru;
 | 
					using Guru;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace GuruSDKService
 | 
					namespace GuruService
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public partial class GuruSDKService : Singleton<GuruSDKService>
 | 
					    public static partial class GuruSDKService
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        private bool _initService;
 | 
					        private static bool _initService;
 | 
				
			||||||
        private IGuruSDKServiceImp _serviceImp;
 | 
					        private static IGuruSDKServiceImp _serviceImp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void InitService(IGuruSDKServiceImp serviceImp, Action onFirebaseReady)
 | 
					        public static void InitService(IGuruSDKServiceImp serviceImp, Action onFirebaseReady)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if(_initService) return;
 | 
					            if (_initService) return;
 | 
				
			||||||
            _initService = true;
 | 
					            _initService = true;
 | 
				
			||||||
            _serviceImp = serviceImp;
 | 
					            _serviceImp = serviceImp;
 | 
				
			||||||
            _onFirebaseReady = onFirebaseReady;
 | 
					            _onFirebaseReady = onFirebaseReady;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,102 @@
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using Guru;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace GuruService
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public abstract class GuruSDKServiceImpBase : IGuruSDKServiceImp
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public virtual string CustomServiceKey => "";
 | 
				
			||||||
 | 
					        public virtual string BannerBackgroundColor => "#00000000";
 | 
				
			||||||
 | 
					        public abstract bool IsNoAD { get; }
 | 
				
			||||||
 | 
					        public abstract bool IsIAPEnabled { get; }
 | 
				
			||||||
 | 
					        public abstract bool IsDebugMode { get; }
 | 
				
			||||||
 | 
					        public abstract Dictionary<string, object> GetDefaultRemoteData();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public virtual byte[] GetGooglePlayTangleData()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (!IsIAPEnabled) return null;
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					#if UNITY_EDITOR
 | 
				
			||||||
 | 
					            return null;
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					            return GooglePlayTangle.Data();
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public virtual byte[] GetAppleTangleData()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (!IsIAPEnabled) return null;
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					#if UNITY_EDITOR
 | 
				
			||||||
 | 
					            return null;
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					            return AppleTangle.Data();
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        public void SetBLevel(int level)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            GuruSDKService.SetGuruSDK_BLevel(level);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract int GetBLevel();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void SetBPlay(int play)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            GuruSDKService.SetGuruSDK_BPlay(play);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract int GetBPlay();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnAppPaused(bool paused);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnAppQuit();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnFirebaseReady(bool success);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnGuruServiceReady();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnUserAuthResult(bool success);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnFirebaseAuthResult(bool success);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnAttResult(int authorizationTrackingStatus);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnConsentResult(int statusCode);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnAdsInitComplete();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnBannerADLoaded();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnInterstitialADLoaded();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnInterstitialADFailed();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnRewardedADLoaded();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnRewardADFailed();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnRemoteFetchComplete(bool success);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnIAPInitStart();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnIAPInitComplete(bool success);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnPurchaseStart(string productName);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnPurchaseEnd(string productName, bool success);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnPurchaseFailed(string productName, string reason);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void OnIAPRestored(bool success, string msg);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void ShowIAPBuyLoadingView();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void CloseIAPLoadingView();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void IAPBuySuccessTip();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract void IAPBuyFailTip();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,3 @@
 | 
				
			||||||
 | 
					fileFormatVersion: 2
 | 
				
			||||||
 | 
					guid: fb94a80a939d4b23bf623ad568378846
 | 
				
			||||||
 | 
					timeCreated: 1712103240
 | 
				
			||||||
| 
						 | 
					@ -1,6 +1,6 @@
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace GuruSDKService
 | 
					namespace GuruService
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    public interface IGuruSDKServiceImp
 | 
					    public interface IGuruSDKServiceImp
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
| 
						 | 
					@ -19,8 +19,10 @@ namespace GuruSDKService
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #region Model映射
 | 
					        #region Model映射
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        int b_level { get; set; }
 | 
					        void SetBLevel(int level);
 | 
				
			||||||
        int b_play { get; set; }
 | 
					        int GetBLevel();
 | 
				
			||||||
 | 
					        void SetBPlay(int play);
 | 
				
			||||||
 | 
					        int GetBPlay();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #endregion
 | 
					        #endregion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue