2022-05-23 13:39:59 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
2022-09-09 14:35:49 +00:00
|
|
|
|
using UnityEngine;
|
2022-05-23 13:39:59 +00:00
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
2022-09-09 14:35:49 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Set reward click listener
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
void SetRewardClickListener(Action _rewardClickAction);
|
2022-05-23 13:39:59 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Get channel
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
AppChannel GetChannel();
|
|
|
|
|
|
|
|
|
|
|
|
#region Ads
|
2022-09-09 14:35:49 +00:00
|
|
|
|
|
|
|
|
|
|
// remove all ads
|
|
|
|
|
|
void PurchasedRemoveAds();
|
|
|
|
|
|
|
2022-05-23 13:39:59 +00:00
|
|
|
|
/// <summary>
|
2022-09-09 14:35:49 +00:00
|
|
|
|
/// Remove Native Ad
|
2022-05-23 13:39:59 +00:00
|
|
|
|
/// </summary>
|
2022-09-09 14:35:49 +00:00
|
|
|
|
void RemoveNativeAd();
|
2022-05-23 13:39:59 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2022-09-09 14:35:49 +00:00
|
|
|
|
/// Is Ready Native Ad
|
2022-05-23 13:39:59 +00:00
|
|
|
|
/// </summary>
|
2022-09-09 14:35:49 +00:00
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
bool IsReadyNativeAd();
|
2022-07-04 11:17:39 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2022-09-09 14:35:49 +00:00
|
|
|
|
/// Show Native Ad
|
2022-07-04 11:17:39 +00:00
|
|
|
|
/// </summary>
|
2022-09-09 14:35:49 +00:00
|
|
|
|
/// <param name="_pos">position</param>
|
|
|
|
|
|
void ShowNativeAd(RectTransform pRect, Camera pCam = null, string 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="_pos">1:top,2:bottom</param>
|
|
|
|
|
|
void ShowBanner(TKGBannerAlign _bannerAlign);
|
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
|
|
|
|
void HideBanner();
|
2022-07-04 11:17:39 +00:00
|
|
|
|
|
2022-05-23 13:39:59 +00:00
|
|
|
|
/// <summary>
|
2022-09-09 14:35:49 +00:00
|
|
|
|
/// Show Interstitial Ad
|
2022-05-23 13:39:59 +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>
|
|
|
|
|
|
void ShowInterstitialAd(TKGIVAdPositionName _adPos, Action _callback = null, IVADType _IvType = IVADType.IV1);
|
2022-05-23 13:39:59 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2022-09-09 14:35:49 +00:00
|
|
|
|
/// Show Reward Ad
|
2022-05-23 13:39:59 +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>
|
|
|
|
|
|
void ShowRewardAd(TKGRVPositionName _adPos, Action<bool> _rewardCallback = null, Action _showFailedCallback = null);
|
2022-05-23 13:39:59 +00:00
|
|
|
|
|
|
|
|
|
|
/// <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>
|
2022-09-09 14:35:49 +00:00
|
|
|
|
void LevelStart(int _level);
|
2022-05-23 13:39:59 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Notify game start
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="_level"></param>
|
2022-09-09 14:35:49 +00:00
|
|
|
|
void LevelStart(string _level);
|
2022-05-23 13:39:59 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Notify game end
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="_level"></param>
|
2022-09-09 14:35:49 +00:00
|
|
|
|
/// <param name="_stageResult"></param>
|
|
|
|
|
|
bool LevelEnd(int _level, StageResult _stageResult);
|
2022-05-23 13:39:59 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Notify game end
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="_level"></param>
|
|
|
|
|
|
/// <param name="_win"></param>
|
2022-09-09 14:35:49 +00:00
|
|
|
|
bool LevelEnd(string _level, StageResult _stageResult);
|
2022-05-23 13:39:59 +00:00
|
|
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
2022-09-09 14:35:49 +00:00
|
|
|
|
///// <summary>
|
|
|
|
|
|
///// Log Tracking Event
|
|
|
|
|
|
///// </summary>
|
|
|
|
|
|
///// <param name="_eventType"></param>
|
|
|
|
|
|
//void LogTrackingEvent(TrackingEventType _eventType);
|
2022-05-23 13:39:59 +00:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Online Config
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// get config - string
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="_key"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2022-09-09 14:35:49 +00:00
|
|
|
|
string GetConfigStr(string _key);
|
2022-05-23 13:39:59 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// get config - int
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="_key"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2022-09-09 14:35:49 +00:00
|
|
|
|
int GetConfigInt(string _key);
|
2022-05-23 13:39:59 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// get config - bool
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="_key"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2022-09-09 14:35:49 +00:00
|
|
|
|
bool GetConfigBool(string _key);
|
2022-05-23 13:39:59 +00:00
|
|
|
|
|
|
|
|
|
|
#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);
|
|
|
|
|
|
|
2022-09-09 14:35:49 +00:00
|
|
|
|
void OpenPolicyPop();
|
|
|
|
|
|
|
2022-05-23 13:39:59 +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>
|
|
|
|
|
|
void Shake(int _shakeType, float _intensity = 1);
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Others (unCommon)
|
|
|
|
|
|
|
2022-07-04 11:17:39 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Set game focus
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="_gameFocusAction"></param>
|
|
|
|
|
|
void SetUserSourceListener(Action<bool, string> _userSourceAction);
|
|
|
|
|
|
|
2022-09-09 14:35:49 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Set game focus
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="_gameFocusAction"></param>
|
|
|
|
|
|
void SetUserSourceListener(Action<bool, string, string> _userSourceActionWithCampaignName);
|
|
|
|
|
|
|
2022-07-04 11:17:39 +00:00
|
|
|
|
/// <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);
|
|
|
|
|
|
|
2022-09-09 14:35:49 +00:00
|
|
|
|
/// <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);
|
|
|
|
|
|
|
2022-05-23 13:39:59 +00:00
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// IV Ad Type
|
|
|
|
|
|
/// Control different frequency interstitial Ads
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public enum IVADType
|
|
|
|
|
|
{
|
|
|
|
|
|
IV1 = 0,
|
|
|
|
|
|
IV2,
|
2022-09-09 14:35:49 +00:00
|
|
|
|
IV3,
|
|
|
|
|
|
IV4,
|
|
|
|
|
|
IV5,
|
|
|
|
|
|
IV6,
|
|
|
|
|
|
IV7,
|
|
|
|
|
|
iv8,
|
2022-05-23 13:39:59 +00:00
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-09 14:35:49 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// banner align
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public enum TKGBannerAlign : int
|
|
|
|
|
|
{
|
|
|
|
|
|
BannerCenterBottomAlign = 34,
|
|
|
|
|
|
BannerCenterTopAlign = 10,
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-07-04 11:17:39 +00:00
|
|
|
|
/// <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>
|
2022-05-23 13:39:59 +00:00
|
|
|
|
public enum AppChannel
|
|
|
|
|
|
{
|
|
|
|
|
|
None,
|
|
|
|
|
|
AppStore_GB,
|
|
|
|
|
|
AppStore_CN,
|
|
|
|
|
|
GooglePlay,
|
|
|
|
|
|
DY012,
|
|
|
|
|
|
GW002,
|
|
|
|
|
|
HY003,
|
|
|
|
|
|
OP004,
|
|
|
|
|
|
VO005,
|
|
|
|
|
|
XM006,
|
|
|
|
|
|
HW007,
|
|
|
|
|
|
TX008,
|
|
|
|
|
|
TP009,
|
|
|
|
|
|
MM010,
|
|
|
|
|
|
ZX011,
|
|
|
|
|
|
KS012,
|
2022-07-04 11:17:39 +00:00
|
|
|
|
PJ000,
|
|
|
|
|
|
|
|
|
|
|
|
AndroidRoot = 10000
|
2022-05-23 13:39:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|