405 lines
		
	
	
		
			10 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			405 lines
		
	
	
		
			10 KiB
		
	
	
	
		
			C#
		
	
	
	
| using System;
 | ||
| using System.Collections.Generic;
 | ||
| using UnityEngine;
 | ||
| 
 | ||
| namespace Touka
 | ||
| {
 | ||
|     public interface ITKGSDK
 | ||
|     {
 | ||
|         /// <summary>
 | ||
|         /// init sdk
 | ||
|         /// </summary>
 | ||
|         void InitSDK(Action _initCallback = null);
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Set game focus
 | ||
|         /// </summary>
 | ||
|         /// <param name="_gameFocusAction"></param>
 | ||
|         void SetGameFocusListener(Action<bool> _gameFocusAction);
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Set reward click  listener
 | ||
|         /// </summary>
 | ||
|         void SetRewardClickListener(Action _rewardClickAction);
 | ||
|         /// <summary>
 | ||
|         /// Get channel
 | ||
|         /// </summary>
 | ||
|         /// <returns></returns>
 | ||
|         AppChannel GetChannel();
 | ||
| 
 | ||
|         #region Ads
 | ||
| 
 | ||
|         // remove all ads
 | ||
|         void PurchasedRemoveAds();
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Remove Native Ad
 | ||
|         /// </summary>
 | ||
|         void RemoveNativeAd();
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Is Ready Native Ad
 | ||
|         /// </summary>
 | ||
|         /// <returns></returns>
 | ||
|         bool IsReadyNativeAd();
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Show Native Ad
 | ||
|         /// </summary>
 | ||
|         /// <param name="_pos">position</param>
 | ||
|         void ShowNativeAd(RectTransform pRect, Camera pCam = null, string pAdPos = "");
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Show banner
 | ||
|         /// </summary>
 | ||
|         /// <param name="_pos">1:top,2:bottom</param>
 | ||
|         void ShowBanner(TKGBannerAlign _bannerAlign);
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Hide banner
 | ||
|         /// </summary>
 | ||
|         void HideBanner();
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Show Interstitial Ad
 | ||
|         /// </summary>
 | ||
|         /// <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>
 | ||
|         void ShowInterstitialAd(TKGIVAdPositionName _adPos, Action _callback = null, IVADType _IvType = IVADType.IV1);
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Show Reward Ad
 | ||
|         /// </summary>
 | ||
|         /// <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>
 | ||
|         void ShowRewardAd(TKGRVPositionName _adPos, Action<bool> _rewardCallback = null, Action _showFailedCallback = null);
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Is Ready Reward
 | ||
|         /// </summary>
 | ||
|         /// <returns></returns>
 | ||
|         bool IsReadyRewardAd();
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Is Ready Interstitial
 | ||
|         /// </summary>
 | ||
|         /// <returns></returns>
 | ||
|         bool IsReadyInterstitialAd();
 | ||
| 
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region Log Event
 | ||
| 
 | ||
|         #region Normal 
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// log event
 | ||
|         /// </summary>
 | ||
|         /// <param name="_eventSort"></param>
 | ||
|         void LogEvent(string _eventSort);
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// log event
 | ||
|         /// </summary>
 | ||
|         /// <param name="_eventSort"></param>
 | ||
|         /// <param name="_key"></param>
 | ||
|         /// <param name="_value"></param>
 | ||
|         void LogEvent(string _eventSort, string _key, string _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>
 | ||
|         void LogEvent(string _eventSort, string _key01, string _value01, string _key02, string _value02);
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// log event
 | ||
|         /// </summary>
 | ||
|         /// <param name="_eventSort"></param>
 | ||
|         /// <param name="_eventDic"></param>
 | ||
|         void LogEvent(string _eventSort, Dictionary<string, string> _eventDic = null);
 | ||
| 
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region Level Event
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Notify game start
 | ||
|         /// </summary>
 | ||
|         /// <param name="_level"></param>
 | ||
|         void LevelStart(int _level);
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Notify game start
 | ||
|         /// </summary>
 | ||
|         /// <param name="_level"></param>
 | ||
|         void LevelStart(string _level);
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Notify game end
 | ||
|         /// </summary>
 | ||
|         /// <param name="_level"></param>
 | ||
|         /// <param name="_stageResult"></param>
 | ||
|         bool LevelEnd(int _level, StageResult _stageResult);
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Notify game end
 | ||
|         /// </summary>
 | ||
|         /// <param name="_level"></param>
 | ||
|         /// <param name="_win"></param>
 | ||
|         bool LevelEnd(string _level, StageResult _stageResult);
 | ||
| 
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region Reward Ad Button Show
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Log Reward ad button show
 | ||
|         /// </summary>
 | ||
|         /// <param name="_pos"></param>
 | ||
|         void LogRewardAdBtnShow(string _pos);
 | ||
| 
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region Tracking Event
 | ||
| 
 | ||
|         ///// <summary>
 | ||
|         ///// Log Tracking Event
 | ||
|         ///// </summary>
 | ||
|         ///// <param name="_eventType"></param>
 | ||
|         //void LogTrackingEvent(TrackingEventType _eventType);
 | ||
| 
 | ||
|         #endregion
 | ||
| 
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region Online Config
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// get config - string
 | ||
|         /// </summary>
 | ||
|         /// <param name="_key"></param>
 | ||
|         /// <returns></returns>
 | ||
|         string GetConfigStr(string _key);
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// get config - int
 | ||
|         /// </summary>
 | ||
|         /// <param name="_key"></param>
 | ||
|         /// <returns></returns>
 | ||
|         int GetConfigInt(string _key);
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// get config - bool
 | ||
|         /// </summary>
 | ||
|         /// <param name="_key"></param>
 | ||
|         /// <returns></returns>
 | ||
|         bool GetConfigBool(string _key);
 | ||
| 
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region Others(common)
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// review
 | ||
|         /// </summary>
 | ||
|         void Review();
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// open privacy url
 | ||
|         /// </summary>
 | ||
|         void OpenPrivacyURL();
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// open user term url
 | ||
|         /// </summary>
 | ||
|         void OpenUserTermURL();
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// open more game
 | ||
|         /// </summary>
 | ||
|         void OpenMoreGame();
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// open browser url
 | ||
|         /// </summary>
 | ||
|         /// <param name="_url"></param>
 | ||
|         void OpenUrlByBrowser(string _url);
 | ||
| 
 | ||
|         void OpenPolicyPop();
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// shake
 | ||
|         /// </summary>
 | ||
|         /// <param name="_shakeType">0 light,1 medium,2 heavy</param>
 | ||
|         /// <param name="_intensity">ios 0~1, android any num</param>
 | ||
|         void Shake(int _shakeType, float _intensity = 1);
 | ||
| 
 | ||
|         #endregion
 | ||
| 
 | ||
|         #region Others (unCommon)
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Set game focus
 | ||
|         /// </summary>
 | ||
|         /// <param name="_gameFocusAction"></param>
 | ||
|         void SetUserSourceListener(Action<bool, string> _userSourceAction);
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// Set game focus
 | ||
|         /// </summary>
 | ||
|         /// <param name="_gameFocusAction"></param>
 | ||
|         void SetUserSourceListener(Action<bool, string, string> _userSourceActionWithCampaignName);
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// common callback
 | ||
|         /// </summary>
 | ||
|         /// <param name="_commonCallback"></param>
 | ||
|         void SetTKGCommonCallback(Action<CommonCallbackCode, string> _commonCallback);
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// set log enable
 | ||
|         /// </summary>
 | ||
|         /// <param name="_enable"></param>
 | ||
|         void SetLogEnable(bool _enable);
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// share txt
 | ||
|         /// </summary>
 | ||
|         /// <param name="_shareTxt"></param>
 | ||
|         void ShareTxt(string _shareTxt);
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// regist APNS
 | ||
|         /// </summary>
 | ||
|         void RegistAPNS();
 | ||
| 
 | ||
| 
 | ||
|         /// <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>
 | ||
|         void RegistNotification(string notiId, string body, string fireDate, int badge, string title, string subTitle);
 | ||
| 
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// remove all notification
 | ||
|         /// </summary>
 | ||
|         void RemoveAllNotifications();
 | ||
| 
 | ||
|         /// <summary>
 | ||
|         /// remove notification by notification identifier
 | ||
|         /// </summary>
 | ||
|         /// <param name="notiId">notification identifier</param>
 | ||
|         void RemoveNotification(string notiId);
 | ||
| 
 | ||
|         #endregion
 | ||
|     }
 | ||
| 
 | ||
|     /// <summary>
 | ||
|     /// IV Ad Type
 | ||
|     /// Control different frequency interstitial Ads
 | ||
|     /// </summary>
 | ||
|     public enum IVADType
 | ||
|     {
 | ||
|         IV1 = 0,
 | ||
|         IV2,
 | ||
|         IV3,
 | ||
|         IV4,
 | ||
|         IV5,
 | ||
|         IV6,
 | ||
|         IV7,
 | ||
|         iv8,
 | ||
| 
 | ||
|         MAX,
 | ||
|     }
 | ||
| 
 | ||
|     /// <summary>
 | ||
|     /// Tracking Event Type
 | ||
|     /// </summary>
 | ||
|     public enum TrackingEventType
 | ||
|     {
 | ||
|         GuildStart = 0,     // guide start show
 | ||
|         GuildEnd = 1,       // guild end
 | ||
|         FirstOperateGame = 2, // user operates the game for the first time
 | ||
| 
 | ||
|         Max,
 | ||
|     }
 | ||
| 
 | ||
|     /// <summary>
 | ||
|     /// ad show failed code type
 | ||
|     /// </summary>
 | ||
|     public enum AdShowFailCodeType
 | ||
|     {
 | ||
|         AdShowFailReal = 57,     // ad real show failed
 | ||
|         AdIsNotReady = 58,   // The ad component is displayed and found not ready
 | ||
|         AdIsReadyCannotShow = 59,   // When the ad component is displayed, the ad is ready, but the rule that cannot display the ad is triggered
 | ||
|     }
 | ||
| 
 | ||
|     /// <summary>
 | ||
|     /// banner align
 | ||
|     /// </summary>
 | ||
|     public enum TKGBannerAlign : int
 | ||
|     {
 | ||
|         BannerCenterBottomAlign = 34,
 | ||
|         BannerCenterTopAlign = 10,
 | ||
|     }
 | ||
| 
 | ||
|     /// <summary>
 | ||
|     /// tkg common callback code
 | ||
|     /// </summary>
 | ||
|     public enum CommonCallbackCode
 | ||
|     {
 | ||
|         FirebaseOnlineParamGet_Succ = 990001,
 | ||
|         FirebaseOnlineParamGet_Failed = 990002,
 | ||
|     }
 | ||
| 
 | ||
|     /// <summary>
 | ||
|     /// stage result
 | ||
|     /// </summary>
 | ||
|     public enum StageResult
 | ||
|     {
 | ||
|         StageSucc = 0,
 | ||
|         StageFail = 1,
 | ||
|         StageRetry = 2,
 | ||
|         StageBack = 3,
 | ||
|     }
 | ||
| 
 | ||
|     /// <summary>
 | ||
|     /// app channel
 | ||
|     /// </summary>
 | ||
|     public enum AppChannel
 | ||
|     {
 | ||
|         None,
 | ||
|         AppStore_GB,
 | ||
|         AppStore_CN,
 | ||
|         GooglePlay,
 | ||
|         DY012,
 | ||
|         GW002,
 | ||
|         HY003,
 | ||
|         OP004,
 | ||
|         VO005,
 | ||
|         XM006,
 | ||
|         HW007,
 | ||
|         TX008,
 | ||
|         TP009,
 | ||
|         MM010,
 | ||
|         ZX011,
 | ||
|         KS012,
 | ||
|         PJ000,
 | ||
| 
 | ||
|         AndroidRoot = 10000
 | ||
|     }
 | ||
| }
 |