| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Collections.Generic; | 
					
						
							|  |  |  |  | using UnityEngine; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace Touka | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     public class TKGSDKNative : ITKGSDK | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         private Dictionary<string, object> mDefaultDic = new Dictionary<string, object>(); | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// init sdk | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_initCallback"></param> | 
					
						
							|  |  |  |  |         public void InitSDK(Action _initCallback = null) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             SetOnlineConfigInit(); | 
					
						
							| 
									
										
										
										
											2022-09-13 03:26:55 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.Init(_initCallback); | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         private void SetOnlineConfigInit() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             //加入自定义参数列表 | 
					
						
							|  |  |  |  |             foreach (string tKey in TKGParams.OnlineParamDic.Keys) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 mDefaultDic.Add(tKey, TKGParams.OnlineParamDic[tKey]); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// Set game focus | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_gameFocusAction"></param> | 
					
						
							|  |  |  |  |         public void SetGameFocusListener(Action<bool> _gameFocusAction) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.SetGameFocusListener(_gameFocusAction); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         public void SetRewardClickListener(Action _rewardClickAction) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.SetRewardClickListener(_rewardClickAction); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// Get channel | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public AppChannel GetChannel() | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             Debug.Log("android back getchannel : " + TKGNativeInterface.Instance.GetChannel()); | 
					
						
							|  |  |  |  |             string channelStr = TKGNativeInterface.Instance.GetChannel(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             channelStr = channelStr.Equals("default") ? AppChannel.AndroidRoot.ToString() : channelStr; | 
					
						
							|  |  |  |  |             AppChannel tChannel = AppChannel.None; | 
					
						
							|  |  |  |  |             if (Enum.TryParse(channelStr, out tChannel)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return tChannel; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             return AppChannel.None; | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region Ads | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         public void SetUnitySDKVersion(string sdkVersion) | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.SetUnitySDKVersion(sdkVersion); | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         public void PurchasedRemoveAds() | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.PurchasedRemoveAds(); | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         public void RemoveNativeAd() | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.RemoveNativeAd(); | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         public bool IsReadyNativeAd() | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             return TKGNativeInterface.Instance.IsReadyNativeAd(); | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         public void ShowNativeAd(RectTransform pRect, Camera pCam = null, string pAdPos = "") | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.ShowNativeAd(pRect,pCam,pAdPos); | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         /// Show banner | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         /// </summary> | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         /// <param name="_bannerAlign">bannerAlign</param> | 
					
						
							|  |  |  |  |         public void ShowBanner(TKGBannerAlign _pos) | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.showBannerAd(_pos); | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         /// Hide banner | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         /// </summary> | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         public void HideBanner() | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.hideBannerAd(); | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         /// Show Interstitial Ad | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         /// </summary> | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         /// <param name="_adPos"> Name of interstitial ad placement. </param> | 
					
						
							|  |  |  |  |         /// <param name="_callback"> Callback of interstitial ad close and show interstitial failed</param> | 
					
						
							|  |  |  |  |         /// <param name="_IvType"> IVADType for distinguish interstitial ads frequency, default use iv1</param> | 
					
						
							|  |  |  |  |         public void ShowInterstitialAd(TKGIVAdPositionName _adPos, Action _callback = null, IVADType _IvType = IVADType.IV1) | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] Show Interstitial call, _adPos : " + _adPos); | 
					
						
							|  |  |  |  |             if (_callback != null) _callback(); | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  |             TKGSDKCallback.mInterAdCallback = _callback; | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.showInterstitialAd(_adPos.ToString(), _IvType); | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         /// Show Reward Ad | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         /// </summary> | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         /// <param name="_adPos"> Name of reward ad placement</param> | 
					
						
							|  |  |  |  |         /// <param name="_rewardCallback"> true:reward succ, false: reward failed</param> | 
					
						
							|  |  |  |  |         /// <param name="_showFailedCallback">Callback of reward ad show fail</param> | 
					
						
							|  |  |  |  |         public void ShowRewardAd(TKGRVPositionName _adPos, Action<bool> _rewardCallback = null, Action _showFailedCallback = null) | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] Show reward call, _adPos : " + _adPos); | 
					
						
							|  |  |  |  |             if (_rewardCallback != null) _rewardCallback(true); | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             TKGSDKCallback.mRewardCallback = _rewardCallback; | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGSDKCallback.mRewardShowFailedCallback = _showFailedCallback; | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.showRewardAd(_adPos.ToString(), -1); | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-13 03:26:55 +00:00
										 |  |  |  |         public void Toast(string text) { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.toast(text); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         public void SetShowSDKToast(bool _useSDKToast) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.SetShowSDKToast(_useSDKToast); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// Is Ready Interstitial | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public bool IsReadyInterstitialAd() | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return true; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             return TKGNativeInterface.Instance.isInterstitialAdReady(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// Is Ready Reward | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         public bool IsReadyRewardAd() | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return true; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             return TKGNativeInterface.Instance.isRewardAdReady(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region Log Event | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region Normal | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// log event | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_eventSort"></param> | 
					
						
							|  |  |  |  |         public void LogEvent(string _eventSort) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] logEvent : " + _eventSort); | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.onEvent(_eventSort); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// log event | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_eventSort"></param> | 
					
						
							|  |  |  |  |         /// <param name="_key"></param> | 
					
						
							|  |  |  |  |         /// <param name="_value"></param> | 
					
						
							|  |  |  |  |         public void LogEvent(string _eventSort, string _key, string _value) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] logEvent : " + _eventSort + " , _key : " + _key + " , _value : " + _value); | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.onEvent(_eventSort, _key, _value); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// log event | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_eventSort"></param> | 
					
						
							|  |  |  |  |         /// <param name="_key01"></param> | 
					
						
							|  |  |  |  |         /// <param name="_value01"></param> | 
					
						
							|  |  |  |  |         /// <param name="_key02"></param> | 
					
						
							|  |  |  |  |         /// <param name="_value02"></param> | 
					
						
							|  |  |  |  |         public void LogEvent(string _eventSort, string _key01, string _value01, string _key02, string _value02) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] logEvent : " + _eventSort + " , _key01 : " + _key01 + " , _value01 : " + _value01 + " , _key2 : " + _key02 + " , _value02 : " + _value02); | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.onEvent(_eventSort, _key01, _value01, _key02, _value02); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// log event | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_eventSort"></param> | 
					
						
							|  |  |  |  |         /// <param name="_eventDic"></param> | 
					
						
							|  |  |  |  |         public void LogEvent(string _eventSort, Dictionary<string, string> _eventDic = null) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] logEvent : " + _eventSort + " , _eventDic.count : " + _eventDic.Count); | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.onEvent(_eventSort, _eventDic); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region Level Event | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// Notify game start | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_level"></param> | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         public void LevelStart(int _level) | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] LevelStart _level : " + _level); | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.LevelStart(_level.ToString()); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// Notify game start | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_level"></param> | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         public void LevelStart(string _level) | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] LevelStart _level : " + _level); | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.LevelStart(_level); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// Notify game end | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_level"></param> | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         /// <param name="_stageResult"></param> | 
					
						
							|  |  |  |  |         public bool LevelEnd(int _level, StageResult _stageResult) | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] LevelEnd _level : " + _level + " , _stageResult : " + _stageResult); | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return true; | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.LevelEnd(_level.ToString(), _stageResult); | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             return true; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// Notify game end | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_level"></param> | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         /// <param name="_stageResult"></param> | 
					
						
							|  |  |  |  |         public bool LevelEnd(string _level, StageResult _stageResult) | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] LevelEnd _level : " + _level + " , _win : " + _stageResult); | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return true; | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.LevelEnd(_level, _stageResult); | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             return true; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region Reward Ad Button Show | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// Log Reward ad button show | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_pos"></param> | 
					
						
							|  |  |  |  |         public void LogRewardAdBtnShow(string _pos) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] LogRewardAdBtnShow _pos : " + _pos); | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.onEvent(TKGStringEvent.Event_Sort_TKGInner_ad_button_show, TKGStringEvent.Event_Type_TKGInner_ad_position, _pos); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region Tracking Event | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// Log Tracking Event | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_eventType"></param> | 
					
						
							|  |  |  |  |         public void LogTrackingEvent(TrackingEventType _eventType) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] LogTrackingEvent _eventType : " + _eventType); | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.LogTrackingEvent(_eventType); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region Online Config | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// get config - string | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_key"></param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         public string GetConfigStr(string _key) | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         { | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return GetConfigDefaultValue(_key); | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  |             string tempOnline = TKGNativeInterface.Instance.GetConfigString(_key, GetConfigDefaultValue(_key)); | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] tempOnline , _key : " + _key + " , tempOnline : " + tempOnline); | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             return tempOnline; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// get config - int | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_key"></param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         public int GetConfigInt(string _key) | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         { | 
					
						
							|  |  |  |  |             string tDefaultValue = GetConfigDefaultValue(_key); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             if (int.TryParse(tDefaultValue, out int tIntVal)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return tIntVal; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative]"); | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             return 0; | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             int defaultInt = 0; | 
					
						
							|  |  |  |  |             int.TryParse(tDefaultValue, out defaultInt); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             int tempInt = TKGNativeInterface.Instance.GetConfigInt(_key, defaultInt); | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] GetConfigInt , _key : " + _key + " , tempInt : " + tempInt); | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             return tempInt; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// get config - bool | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_key"></param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         public bool GetConfigBool(string _key) | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         { | 
					
						
							|  |  |  |  |             string tDefaultValue = GetConfigDefaultValue(_key); | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             if (int.TryParse(tDefaultValue, out int tIntVal)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return tIntVal != 0; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative]"); | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |             return false; | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             int defaultInt = 0; | 
					
						
							|  |  |  |  |             int.TryParse(tDefaultValue, out defaultInt); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             bool tBoolValue = TKGNativeInterface.Instance.GetConfigBool(_key, defaultInt != 0); | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] GetConfigBool , _key : " + _key + " , tBoolValue : " + tBoolValue); | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             return tBoolValue; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// get default config value | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_key"></param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         private string GetConfigDefaultValue(string _key) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             string tDefault = ""; | 
					
						
							|  |  |  |  |             if (mDefaultDic.ContainsKey(_key)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 tDefault = mDefaultDic[_key].ToString(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             Debug.Log("getConfigDefaultValue, _key : " + _key + " , tDefault : " + tDefault); | 
					
						
							|  |  |  |  |             return tDefault; | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region Others (common) | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// review | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public void Review() | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] Review"); | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  | #if AppStore_GB | 
					
						
							|  |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] Review cannot be opened in editor, please open it in real machine"); | 
					
						
							|  |  |  |  | #else | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] 编辑器中无法打开评价页面,请在真机中打开"); | 
					
						
							|  |  |  |  |      | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.Review(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// open privacy url | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public void OpenPrivacyURL() | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] OpenPrivacyURL"); | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  | #if AppStore_GB | 
					
						
							|  |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] Web page cannot be opened in editor, please open it in real machine"); | 
					
						
							|  |  |  |  | #else | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] 编辑器中无法打开网页,请在真机中打开"); | 
					
						
							|  |  |  |  |      | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.OpenPrivacyURL(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// open user term url | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public void OpenUserTermURL() | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] OpenUserTermURL"); | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  | #if AppStore_GB | 
					
						
							|  |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] Web page cannot be opened in editor, please open it in real machine"); | 
					
						
							|  |  |  |  | #else | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] 编辑器中无法打开网页,请在真机中打开"); | 
					
						
							|  |  |  |  |      | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.OpenUserTermURL(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// open policy pop | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public void OpenPolicyPop() | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] OpenPolicyPop"); | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  | #if AppStore_GB | 
					
						
							|  |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] Web page cannot be opened in editor, please open it in real machine"); | 
					
						
							|  |  |  |  | #else | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] 编辑器中无法打开网页,请在真机中打开"); | 
					
						
							|  |  |  |  |      | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.OpenPolicyPop(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// open more game | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public void OpenMoreGame() | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] OpenMoreGame"); | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  | #if AppStore_GB | 
					
						
							|  |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] App Store cannot be opened in editor, please open it in real machine"); | 
					
						
							|  |  |  |  | #else | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] 编辑器中无法打开App Store,请在真机中打开"); | 
					
						
							|  |  |  |  |      | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.OpenMoreGame(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// open url browser | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_url"></param> | 
					
						
							|  |  |  |  |         public void OpenUrlByBrowser(string _url) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |             TKGDebugger.LogDebug("[TKGSDKNative] OpenUrlByBrowser"); | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             TKGUtils.OpenBrowserUrl(_url); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// shake | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_shakeType">0 light,1 medium,2 heavy</param> | 
					
						
							|  |  |  |  |         /// <param name="_intensity">ios 0~1, android any num</param> | 
					
						
							|  |  |  |  |         public void Shake(int _shakeType, float _intensity = 1) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             TKGNativeInterface.Instance.shake(_shakeType, _intensity); | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region others(uncommon) | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// SetUserSourceListener | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_userSourceAction"></param> | 
					
						
							|  |  |  |  |         public void SetUserSourceListener(Action<bool, string> _userSourceAction) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             TKGSDKCallback.mTKGUserSourceCallback = _userSourceAction; | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.SetUserSourceCallback(new AndroidTKGUserSourceCalllback()); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// SetUserSourceListenerWithCampaignName | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_userSourceAction"></param> | 
					
						
							|  |  |  |  |         public void SetUserSourceListener(Action<bool, string, string> _userSourceAction) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  |             TKGSDKCallback.mTKGUserSourceCallbackWithCampaignName = _userSourceAction; | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.SetUserSourceCallback(new AndroidTKGUserSourceCalllbackWithCampaignName()); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-13 03:26:55 +00:00
										 |  |  |  |         public void SetFunctionSwitchListener(List<FunctionType> _functionKeys, Action<FunctionType, bool> _functionSwitchCallback) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  |             TKGSDKCallback.mFunctionSwitchCalllback = _functionSwitchCallback; | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.SetFunctionSwitchCalllback(_functionKeys,new AndroidFunctionSwitchCalllback()); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// Set TKG Common callback | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="_commonCallback"></param> | 
					
						
							|  |  |  |  |         public void SetTKGCommonCallback(Action<CommonCallbackCode, string> _commonCallback) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |             TKGSDKCallback.mTKGCommonCallback = _commonCallback; | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.SetSDKCommonCallback(new AndroidTKGCommonCalllback()); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// Set log enable | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public void SetLogEnable(bool _enable) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.SetLogEnable(_enable); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// share txt | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public void ShareTxt(string _shareTxt) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.ShareTxt(_shareTxt); | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-09 14:35:49 +00:00
										 |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// regist APNS | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public void RegistAPNS() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |              | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #else | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.RegistAPNS(); | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// shake | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="notiId">notification identifier</param> | 
					
						
							|  |  |  |  |         /// <param name="body">The body of the notification.</param> | 
					
						
							|  |  |  |  |         /// <param name="fireDate">notify after the time interval. format: yyyy-MM-dd HH:mm:ss </param> | 
					
						
							|  |  |  |  |         /// <param name="badge">The application badge number.</param> | 
					
						
							|  |  |  |  |         /// <param name="title">The title of the notification.</param> | 
					
						
							|  |  |  |  |         /// <param name="subTitle">The subtitle of the notification.</param> | 
					
						
							|  |  |  |  |         public void RegistNotification(string notiId, string body, string fireDate, int badge, string title, string subTitle) { | 
					
						
							|  |  |  |  |              | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #else | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.RegistNotification(notiId,body,fireDate,badge,title,subTitle); | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// remove all notification | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public void RemoveAllNotifications() { | 
					
						
							|  |  |  |  |              | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #else | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.RemoveAllNotifications(); | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// remove notification by notification identifier | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="notiId">notification identifier</param> | 
					
						
							|  |  |  |  |         public void RemoveNotification(string notiId) { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |              | 
					
						
							|  |  |  |  | #if UNITY_EDITOR | 
					
						
							|  |  |  |  |             return; | 
					
						
							|  |  |  |  | #else | 
					
						
							|  |  |  |  |             TKGNativeInterface.Instance.RemoveNotification(notiId); | 
					
						
							|  |  |  |  | #endif | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2022-09-13 03:26:55 +00:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |     } | 
					
						
							|  |  |  |  | } |