导入sdk
This commit is contained in:
parent
14ba09b777
commit
e65c46e345
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3ce648fc8bf664d56bcf72c9d5be76e6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 24df658e83b09495585fa9cf08156d07
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,150 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>lock_screen</key>
|
||||
<string>on</string>
|
||||
<key>tenjin_api_key</key>
|
||||
<string>PYOTVKJ4XZJHSMZW2V6GBQRCNXAFKWU2</string>
|
||||
<key>rn_app_key</key>
|
||||
<string></string>
|
||||
<key>file</key>
|
||||
<string></string>
|
||||
<key>tka_theme</key>
|
||||
<string></string>
|
||||
<key>ad_sk_interstital_id</key>
|
||||
<string></string>
|
||||
<key>fb_client_token</key>
|
||||
<string></string>
|
||||
<key>package_name</key>
|
||||
<string>com.toukagames.drawarmy</string>
|
||||
<key>updatetime</key>
|
||||
<string>2022/06/23 15:00:52</string>
|
||||
<key>usb</key>
|
||||
<string>on</string>
|
||||
<key>adjust_id</key>
|
||||
<string></string>
|
||||
<key>fb_download_url</key>
|
||||
<string></string>
|
||||
<key>td_channel_id</key>
|
||||
<string>default</string>
|
||||
<key>firebase_name</key>
|
||||
<string>GoogleService-Info.plist</string>
|
||||
<key>game_screen_orientation</key>
|
||||
<string>0</string>
|
||||
<key>main_activity</key>
|
||||
<string>com.u8.sdk.U8UnityContext</string>
|
||||
<key>admob_id</key>
|
||||
<string>ca-app-pub-3916046151571724~7731238444</string>
|
||||
<key>channel</key>
|
||||
<string>AppStore_CN</string>
|
||||
<key>tka_url_privacy</key>
|
||||
<string>https://www.mooncakegame.com/privacy.html</string>
|
||||
<key>um_app_key</key>
|
||||
<string>60890fe2f00c2e19b93e6155</string>
|
||||
<key>tw_txt</key>
|
||||
<string>{"m-native_sdk":"","lock_screen":"on","fs":"3","m-interaction_sdk":"","wifi_interval":"30","td_app_id":"","m-banner":"b779308d2f67c37d","usb":"on","unlock":"on","citys":"北京,上海,广州,深圳,东莞,香港,澳门,武汉,阿里云,腾讯云,华为云","td_channel_id":"default","m-splash_sdk":"","unlock_next":"1","wifi":"on","pp":"30","m-splash":"","m-interaction":"babddc80a2651057","m-app_key":"QVt-ZBOR44Frm2Ub8gEfbPo-K8SeKHvyzoq-TJ3op08cFx29THV9DviWinxrQBxNePGKU14gHOkClTrNOi_1a9","unlock_style":"2","unlock_interval":"2","m-reward":"ddb2dd36ec0f5a85","m-app_id":"","m-native":"","bg_pop":"on"}</string>
|
||||
<key>unlock_next</key>
|
||||
<string>1</string>
|
||||
<key>ad_banner_id</key>
|
||||
<string>b6083a3a129482</string>
|
||||
<key>platform</key>
|
||||
<string>ios</string>
|
||||
<key>copyright_id</key>
|
||||
<string></string>
|
||||
<key>copyright_holder</key>
|
||||
<string></string>
|
||||
<key>publisher_url_scheme</key>
|
||||
<string></string>
|
||||
<key>app_name</key>
|
||||
<string>TKGSDKDemo</string>
|
||||
<key>bugly_appid</key>
|
||||
<string></string>
|
||||
<key>offer_id</key>
|
||||
<string></string>
|
||||
<key>ga_secretkey</key>
|
||||
<string>6a2dd6d6189994e7af755efe6944e4a08e0929a7</string>
|
||||
<key>unlock_interval</key>
|
||||
<string>2</string>
|
||||
<key>fb_appid</key>
|
||||
<string></string>
|
||||
<key>ad_interstital_half_id</key>
|
||||
<string></string>
|
||||
<key>ad_native_banner_id</key>
|
||||
<string></string>
|
||||
<key>tk_app_id</key>
|
||||
<string>a607fe29de4363</string>
|
||||
<key>ad_native_splash_id</key>
|
||||
<string></string>
|
||||
<key>bg_pop</key>
|
||||
<string>on</string>
|
||||
<key>bugly_appkey</key>
|
||||
<string></string>
|
||||
<key>firebase_path</key>
|
||||
<string>https://my-report.oss-cn-beijing.aliyuncs.com/icon/2022/06/23/5c91a28aac0543d1afcb1f1e92946cce.plist</string>
|
||||
<key>fs</key>
|
||||
<string>3</string>
|
||||
<key>ad_appkey</key>
|
||||
<string>c13e4357e57d78e76e472899eb182e98</string>
|
||||
<key>wifi_interval</key>
|
||||
<string>30</string>
|
||||
<key>tka_url_agreement</key>
|
||||
<string>https://www.mooncakegame.com/agreements.html</string>
|
||||
<key>ad_templete_natvie_id</key>
|
||||
<string></string>
|
||||
<key>td_app_id</key>
|
||||
<string></string>
|
||||
<key>tka_age</key>
|
||||
<string>12</string>
|
||||
<key>ad_full_reward_id</key>
|
||||
<string></string>
|
||||
<key>tka_type</key>
|
||||
<string></string>
|
||||
<key>splash_img</key>
|
||||
<string></string>
|
||||
<key>channel_appkey</key>
|
||||
<string></string>
|
||||
<key>unlock</key>
|
||||
<string>on</string>
|
||||
<key>ad_interstital_id</key>
|
||||
<string>b607ae9b4529ed</string>
|
||||
<key>citys</key>
|
||||
<string>北京,上海,广州,深圳,东莞,香港,澳门,武汉,阿里云,腾讯云,华为云</string>
|
||||
<key>publisher_appid</key>
|
||||
<string></string>
|
||||
<key>ad_splash_id</key>
|
||||
<string></string>
|
||||
<key>baidumobad_app_id</key>
|
||||
<string></string>
|
||||
<key>channel_appsecret</key>
|
||||
<string></string>
|
||||
<key>ad_appid</key>
|
||||
<string>a607acb6913054</string>
|
||||
<key>ad_sk_native1_id</key>
|
||||
<string></string>
|
||||
<key>publish_account</key>
|
||||
<string>Mooncake Games Limited</string>
|
||||
<key>channel_appid</key>
|
||||
<string></string>
|
||||
<key>ad_render_native_id</key>
|
||||
<string>b608251153978a</string>
|
||||
<key>wifi</key>
|
||||
<string>on</string>
|
||||
<key>pp</key>
|
||||
<string>30</string>
|
||||
<key>ad_reward_id</key>
|
||||
<string>b608250f4ec04a</string>
|
||||
<key>ad_sk_native_id</key>
|
||||
<string></string>
|
||||
<key>tka_url_moregame</key>
|
||||
<string>https://apps.apple.com/developer/id1521253916</string>
|
||||
<key>unlock_style</key>
|
||||
<string>2</string>
|
||||
<key>ga_key</key>
|
||||
<string>000f968b863b47fc95ef55473ce955b1</string>
|
||||
<key>ad_sk_splash_id</key>
|
||||
<string></string>
|
||||
<key>ad_platform</key>
|
||||
<string>topon</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: eb64a089a31554aa5bffdb0e52149a14
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,156 @@
|
|||
|
||||
#=================基础配置=============================
|
||||
#游戏名称
|
||||
app_name=太空潜行者
|
||||
#包名
|
||||
package_name=com.autumnant.alienkill
|
||||
#闪屏图(&健康提示),值:图片名字,没有填"",详见需求文档(- 新增splash图 部分):https://pic6ktmsyi.feishu.cn/docs/doccnRdYblZyPN2HpIK6nsJmqSb#
|
||||
splash_img=
|
||||
#游戏横竖屏,根据游戏横竖屏取值 值: 0 竖屏, 1 横屏
|
||||
game_screen_orientation=0
|
||||
#发行主体
|
||||
publish_account=北京慕恩凯克网络科技有限公司
|
||||
|
||||
#渠道
|
||||
channel=DY012
|
||||
#子渠道
|
||||
sub_channel=""
|
||||
#客户端协议上报u8 appid
|
||||
tk_app_id=8110
|
||||
|
||||
#外部测试使用facebook id
|
||||
fb_appid=
|
||||
fb_client_token=
|
||||
#adjust_id{}
|
||||
adjust_id=
|
||||
#巨量app id
|
||||
rangers_applog_id={rangers_applog_id}
|
||||
#发行人app id
|
||||
publisher_appid=
|
||||
publisher_url_scheme=
|
||||
#游戏软著著作人
|
||||
copyright_holder=北京慕恩凯克网络科技有限公司
|
||||
#游戏软著登记号
|
||||
copyright_id=2022SR0713177
|
||||
|
||||
#调试模式(写死不动,仅供调试使用)
|
||||
#debug_mode=false
|
||||
|
||||
|
||||
#=================用户协议(弹窗)配置=============================
|
||||
#游戏类型
|
||||
TkA_Type=休闲益智
|
||||
#游戏题材
|
||||
TkA_Theme=冒险闯关
|
||||
#适龄,取值:8|12|16|18
|
||||
TkA_Age=12
|
||||
#隐私政策url
|
||||
TkA_Url_Privacy=https://www.mooncakegame.com/privacy.html
|
||||
#用户协议url
|
||||
TkA_Url_Agreement=https://www.mooncakegame.com/agreements.html
|
||||
|
||||
#=================广告通用配置=============================
|
||||
#广告平台,max|topon|xiaomi
|
||||
ad_platform=topon
|
||||
|
||||
#广告appid (包括max applovin.sdk.key)
|
||||
ad_appid=a1dt3hgr196p3q
|
||||
#广告appkey
|
||||
ad_appkey=c13e4357e57d78e76e472899eb182e98
|
||||
#admob id
|
||||
admob_id=
|
||||
|
||||
|
||||
#开屏广告位id
|
||||
ad_splash_id=b6297221b599ae
|
||||
ad_native_splash_id=
|
||||
#插屏广告位id
|
||||
ad_interstital_id=b1dt3hgr9pocks
|
||||
#半屏插屏广告位id(小米广告区分全/半屏)
|
||||
ad_interstital_half_id=
|
||||
#激励视频广告位id
|
||||
ad_reward_id=b1dt3hgrarr5pi
|
||||
#banner广告位id
|
||||
ad_banner_id=
|
||||
ad_native_banner_id=
|
||||
# 原生模板广告位id [增加]
|
||||
ad_templete_natvie_id=
|
||||
|
||||
# 原生自渲染广告位id [增加]
|
||||
ad_render_native_id=
|
||||
|
||||
|
||||
#=================TW配置=============================
|
||||
#[TODO][meta-data]百度 APPID
|
||||
BaiduMobAd_APP_ID=
|
||||
|
||||
#副包下载链接
|
||||
FB_DOWNLOAD_URL=
|
||||
FB_POP_CONFIG_DAT_URL=https://my-report.oss-cn-beijing.aliyuncs.com/config/pops-com.autumnant.alienkill.dat
|
||||
#更多游戏链接
|
||||
tka_url_moregame=
|
||||
|
||||
#TW广告位
|
||||
#SDK插屏
|
||||
ad_sk_interstital_id=
|
||||
#SDK开屏
|
||||
ad_sk_splash_id=
|
||||
#SDK信息流
|
||||
ad_sk_native_id=
|
||||
#SDK信息流1
|
||||
ad_sk_native1_id=
|
||||
|
||||
#[TODO][meta-data]游戏主 Activity:
|
||||
#取值 Unity游戏: com.u8.sdk.U8UnityContext
|
||||
#flash游戏: com.u8.sdk.ane.U8ANEActivity
|
||||
#Cocos游戏: com.u8.sdk.U8CocosActivity
|
||||
MAIN_ACTIVITY=com.u8.sdk.U8UnityContext
|
||||
|
||||
#极光 AppKey,默认空
|
||||
JPUSH_APPKEY=""
|
||||
|
||||
|
||||
#客服邮箱
|
||||
tkg_custom=dev@mooncakegame.com
|
||||
channel_appid=
|
||||
channel_appkey=
|
||||
channel_appsecret=
|
||||
|
||||
|
||||
#=================Bugly=============================
|
||||
Bugly_AppID=17f7b7efc7
|
||||
Bugly_AppKey=1d989fdb-526e-49a7-b23b-94d12185e934
|
||||
|
||||
|
||||
#=================YSDK实名认证=============================
|
||||
#[TODO][ysdkconf.ini]腾讯AppID
|
||||
OFFER_ID=1112212474
|
||||
|
||||
|
||||
#=================Umeng配置=============================
|
||||
#UM Appkey
|
||||
UM_APP_KEY=6297415788ccdf4b7e838779
|
||||
#json 参数 key
|
||||
JSON_PARAM_KEY=""
|
||||
#[TODO][文件类型参数]默认 (在线) 参数配置
|
||||
UMENG_DEFAULT_ONLINE_CONFIG=""
|
||||
|
||||
#=================GA配置=============================
|
||||
#GA AppKey
|
||||
GA_KEY=
|
||||
#GA AppSecret
|
||||
GA_SECRETKEY=
|
||||
|
||||
#=================热云配置=============================
|
||||
#AppKey
|
||||
RN_APP_KEY=
|
||||
|
||||
#=================Tenjin配置=============================
|
||||
#Tenjin ApiKey
|
||||
TENJIN_API_KEY=PYOTVKJ4XZJHSMZW2V6GBQRCNXAFKWU2
|
||||
|
||||
#=================Firebase配置=============================
|
||||
#[TODO][文件类型参数]google-services.json文件
|
||||
google_services_json=""
|
||||
|
||||
{remark}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 65fdf291ed5a645e5a155b7eac5b25c2
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,70 @@
|
|||
TKG_ENABLE_LOG = false
|
||||
|
||||
|
||||
#***********副包配置***********
|
||||
#副包下载地址,目前所有游戏使用同一个副包,此链接不需要修改
|
||||
FB_DOWNLOAD_URL = http://p2-yx.adkwai.com/udata/pkg/DSP-EFFECT/apk/36e063f5-9473-4064-b99f-8686bcc427e6.apk
|
||||
#是否在wifi状态下提前预下载副包apk
|
||||
FB_PREDOWNLOAD_IN_WIFI = false
|
||||
|
||||
#云控弹窗配置链接(* 每个游戏需要单独配置),留空则使用留包配置
|
||||
#FB_POP_CONFIG_DAT_URL = https://my-report.oss-cn-beijing.aliyuncs.com/config/pops-com.zlsz.basketdash.global.dat
|
||||
|
||||
#锁屏广告类型 0:信息流 1:百度资讯 此处设置会被弹窗配置文件(pop-包名.dat)设置覆盖
|
||||
DEFAULT_LOCK_SCREEN_TYPE = 0
|
||||
#弹窗库日志打印开关
|
||||
POPLIB_LOG_ENABLE = false
|
||||
|
||||
#延迟多久弹出副包悬浮按钮,单位毫秒(可根据游戏加载时长设置,一般进入游戏正式画面再显示)
|
||||
SHOW_FB_UI_DELAY = 5000
|
||||
#自动弹出副包安装提示弹窗时,延迟多久弹出,单位毫秒(可根据游戏加载时长设置,一般进入游戏正式画面再显示)
|
||||
AUTO_SHOW_FB_DIALOG_DELAY = 10000
|
||||
|
||||
|
||||
#激活上报比例,取值0-100
|
||||
ANALYTICS_RATIO = 100
|
||||
|
||||
#统计激活(初始化)时机
|
||||
# 打开游戏时 :0
|
||||
# 实名认证之后 :1
|
||||
# 展示了一次插屏广告 :3
|
||||
# 广告展示收入达标 :5 (设置这个值需要同时设置ANALYTICS_INIT_REVENUE的取值)
|
||||
ANALYTICS_INIT_TIME = 0
|
||||
#广告收入达到多少才初始化,值: 0.005
|
||||
ANALYTICS_INIT_REVENUE = 0
|
||||
#展示广告x次数之后初始化统计SDK
|
||||
ANALYTICS_SHOW_AD_NUMBER = 1
|
||||
|
||||
#插屏广告弹出规则 值json: [{"type":0,"overLevel":0,"interval":30,"skipLevel":1},{"type":1,"overLevel":0,"interval":30,"skipLevel":1}]
|
||||
INTER_AD_RULES = [{"type":"0","overLevel":"0","interval":"10","skipLevel":"1"}]
|
||||
#自动插屏规则 值json: SDK默认值: {"open":false,"interval":30,"skipLevel":1}
|
||||
AUTO_INTER_AD_RULES= {"open":false,"interval":"30","skipLevel":"-1"}
|
||||
|
||||
#新增当天游戏通关数,一个用户上报一次,X支持在线参数配置,默认值15
|
||||
NewUserPassLevel = 15
|
||||
#新增当天视频广告播放次数超过X次,则上报,一个用户上报一次,X支持在线参数配置,默认值15
|
||||
NewUserAdsCount = 15
|
||||
|
||||
#用户任意类型广告(包括游戏内及TW所有广告类型)ecpm达到X则上报
|
||||
NewUserEcpm = 3
|
||||
#当插屏ecpm达到X则上报,包括TW插屏
|
||||
NewUserIvEcpm = 3
|
||||
#当激励视频ecpm达到X则上报
|
||||
NewUserRvEcpm = 4
|
||||
#插屏+激励视频(包括TW),成功展示X次则上报。
|
||||
NewUserPvCount = 18
|
||||
|
||||
#用户任意类型广告ecpm达到X且用户时长达到Y则上报。时长(NewUserTime)是当日多次登陆累计时间
|
||||
NewUserTimeEcpm = 3
|
||||
#时间,单位秒
|
||||
NewUserTime = 600
|
||||
|
||||
#用户收益达到X则上报
|
||||
NewUserAdsArpu = 0.05
|
||||
|
||||
nativeStatus = 0
|
||||
bannerStatus = 0
|
||||
tkgshowauthview = 1
|
||||
nativeTemplatesType = 3
|
||||
|
||||
{remark}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 47e36f69986b64faca5bcd86c28c569f
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,62 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>auto_inter_ad_rules</key>
|
||||
<string>{"open":false,"interval":"30","skipLevel":"-1"}</string>
|
||||
<key>analytics_init_time</key>
|
||||
<string>0</string>
|
||||
<key>show_fb_ui_delay</key>
|
||||
<string>5000</string>
|
||||
<key>analytics_ratio</key>
|
||||
<string>100</string>
|
||||
<key>skiplevel</key>
|
||||
<string>-1</string>
|
||||
<key>newusertime</key>
|
||||
<string>600</string>
|
||||
<key>newuseradscount</key>
|
||||
<string>15</string>
|
||||
<key>config_id</key>
|
||||
<string>77</string>
|
||||
<key>analytics_show_ad_number</key>
|
||||
<string>1</string>
|
||||
<key>tkg_enable_log</key>
|
||||
<string>false</string>
|
||||
<key>inter_ad_rules</key>
|
||||
<string>[{"type":"0","overLevel":"0","interval":"10","skipLevel":"1"}]</string>
|
||||
<key>poplib_log_enable</key>
|
||||
<string>false</string>
|
||||
<key>newuseradsarpu</key>
|
||||
<string>0.05</string>
|
||||
<key>newuserecpm</key>
|
||||
<string>3</string>
|
||||
<key>newuserrvecpm</key>
|
||||
<string>4</string>
|
||||
<key>nativestatus</key>
|
||||
<string>1</string>
|
||||
<key>type</key>
|
||||
<string>0</string>
|
||||
<key>newuserpvcount</key>
|
||||
<string>2</string>
|
||||
<key>overlevel</key>
|
||||
<string>0</string>
|
||||
<key>interval</key>
|
||||
<string>30</string>
|
||||
<key>default_lock_screen_type</key>
|
||||
<string>0</string>
|
||||
<key>newuserpasslevel</key>
|
||||
<string>2</string>
|
||||
<key>newuserivecpm</key>
|
||||
<string>3</string>
|
||||
<key>analytics_init_revenue</key>
|
||||
<string>0</string>
|
||||
<key>newusertimeecpm</key>
|
||||
<string>3</string>
|
||||
<key>auto_show_fb_dialog_delay</key>
|
||||
<string>10000</string>
|
||||
<key>bannerstatus</key>
|
||||
<string>1</string>
|
||||
<key>fb_predownload_in_wifi</key>
|
||||
<string>false</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ba8674841547f40f3b4b19848e3538c6
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 32ab70ae334024cb1adf42ad214c2e0e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CLIENT_ID</key>
|
||||
<string>550052975381-e0rjfq35fj8lhvs9707robckba6rl5ck.apps.googleusercontent.com</string>
|
||||
<key>REVERSED_CLIENT_ID</key>
|
||||
<string>com.googleusercontent.apps.550052975381-e0rjfq35fj8lhvs9707robckba6rl5ck</string>
|
||||
<key>API_KEY</key>
|
||||
<string>AIzaSyDeCg8CaAcWNVXeTLG88PK36x2ddfI2IMY</string>
|
||||
<key>GCM_SENDER_ID</key>
|
||||
<string>550052975381</string>
|
||||
<key>PLIST_VERSION</key>
|
||||
<string>1</string>
|
||||
<key>BUNDLE_ID</key>
|
||||
<string>com.toukagames.drawmonster.global</string>
|
||||
<key>PROJECT_ID</key>
|
||||
<string>draw-monster-gp</string>
|
||||
<key>STORAGE_BUCKET</key>
|
||||
<string>draw-monster-gp.appspot.com</string>
|
||||
<key>IS_ADS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_ANALYTICS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_APPINVITE_ENABLED</key>
|
||||
<true></true>
|
||||
<key>IS_GCM_ENABLED</key>
|
||||
<true></true>
|
||||
<key>IS_SIGNIN_ENABLED</key>
|
||||
<true></true>
|
||||
<key>GOOGLE_APP_ID</key>
|
||||
<string>1:550052975381:ios:953d8682ba9591a21ccf1c</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ffbe7a922389948798d5db8836d43e81
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"project_info": {
|
||||
"project_number": "928037420955",
|
||||
"project_id": "color-picker-aa5af",
|
||||
"storage_bucket": "color-picker-aa5af.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:928037420955:android:3e76e423015d16eb092b3e",
|
||||
"android_client_info": {
|
||||
"package_name": "com.hotpotgames.colorpicker.global"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "928037420955-qdl2k3kroi8ob6jof00eb48gee1b72uc.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyBqL7EH2e7aiizE_b209e4L2O4lzpEkTGs"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "928037420955-qdl2k3kroi8ob6jof00eb48gee1b72uc.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
},
|
||||
{
|
||||
"client_id": "928037420955-muritipbg7cqk6t5n9pvf8pc38u6o9qt.apps.googleusercontent.com",
|
||||
"client_type": 2,
|
||||
"ios_info": {
|
||||
"bundle_id": "com.hotpotgames.colorpicker.global"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1fb6bdfbd377c49a0850fcf743aaced1
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,150 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>lock_screen</key>
|
||||
<string>on</string>
|
||||
<key>tenjin_api_key</key>
|
||||
<string>PYOTVKJ4XZJHSMZW2V6GBQRCNXAFKWU2</string>
|
||||
<key>rn_app_key</key>
|
||||
<string></string>
|
||||
<key>file</key>
|
||||
<string></string>
|
||||
<key>tka_theme</key>
|
||||
<string></string>
|
||||
<key>ad_sk_interstital_id</key>
|
||||
<string></string>
|
||||
<key>fb_client_token</key>
|
||||
<string></string>
|
||||
<key>package_name</key>
|
||||
<string>com.toukagames.drawmonster.global</string>
|
||||
<key>updatetime</key>
|
||||
<string>2022/06/23 15:00:52</string>
|
||||
<key>usb</key>
|
||||
<string>on</string>
|
||||
<key>adjust_id</key>
|
||||
<string></string>
|
||||
<key>fb_download_url</key>
|
||||
<string></string>
|
||||
<key>td_channel_id</key>
|
||||
<string>default</string>
|
||||
<key>firebase_name</key>
|
||||
<string>GoogleService-Info.plist</string>
|
||||
<key>game_screen_orientation</key>
|
||||
<string>0</string>
|
||||
<key>main_activity</key>
|
||||
<string>com.u8.sdk.U8UnityContext</string>
|
||||
<key>admob_id</key>
|
||||
<string>ca-app-pub-3916046151571724~7731238444</string>
|
||||
<key>channel</key>
|
||||
<string>AppStore_GB</string>
|
||||
<key>tka_url_privacy</key>
|
||||
<string>https://www.mooncakegame.com/privacy.html</string>
|
||||
<key>um_app_key</key>
|
||||
<string>6192079de014255fcb7975f6</string>
|
||||
<key>tw_txt</key>
|
||||
<string>{"m-native_sdk":"","lock_screen":"on","fs":"3","m-interaction_sdk":"","wifi_interval":"30","td_app_id":"","m-banner":"b779308d2f67c37d","usb":"on","unlock":"on","citys":"北京,上海,广州,深圳,东莞,香港,澳门,武汉,阿里云,腾讯云,华为云","td_channel_id":"default","m-splash_sdk":"","unlock_next":"1","wifi":"on","pp":"30","m-splash":"","m-interaction":"babddc80a2651057","m-app_key":"QVt-ZBOR44Frm2Ub8gEfbPo-K8SeKHvyzoq-TJ3op08cFx29THV9DviWinxrQBxNePGKU14gHOkClTrNOi_1a9","unlock_style":"2","unlock_interval":"2","m-reward":"ddb2dd36ec0f5a85","m-app_id":"","m-native":"","bg_pop":"on"}</string>
|
||||
<key>unlock_next</key>
|
||||
<string>1</string>
|
||||
<key>ad_banner_id</key>
|
||||
<string>e40df8ef364c384a</string>
|
||||
<key>platform</key>
|
||||
<string>ios</string>
|
||||
<key>copyright_id</key>
|
||||
<string></string>
|
||||
<key>copyright_holder</key>
|
||||
<string></string>
|
||||
<key>publisher_url_scheme</key>
|
||||
<string></string>
|
||||
<key>app_name</key>
|
||||
<string>TKGSDKDemo</string>
|
||||
<key>bugly_appid</key>
|
||||
<string></string>
|
||||
<key>offer_id</key>
|
||||
<string></string>
|
||||
<key>ga_secretkey</key>
|
||||
<string>4b77151cfd17032cfbe13c6c7287d7a86b5c32f9</string>
|
||||
<key>unlock_interval</key>
|
||||
<string>2</string>
|
||||
<key>fb_appid</key>
|
||||
<string></string>
|
||||
<key>ad_interstital_half_id</key>
|
||||
<string></string>
|
||||
<key>ad_native_banner_id</key>
|
||||
<string></string>
|
||||
<key>tk_app_id</key>
|
||||
<string></string>
|
||||
<key>ad_native_splash_id</key>
|
||||
<string></string>
|
||||
<key>bg_pop</key>
|
||||
<string>on</string>
|
||||
<key>bugly_appkey</key>
|
||||
<string></string>
|
||||
<key>firebase_path</key>
|
||||
<string>https://my-report.oss-cn-beijing.aliyuncs.com/icon/2022/06/23/5c91a28aac0543d1afcb1f1e92946cce.plist</string>
|
||||
<key>fs</key>
|
||||
<string>3</string>
|
||||
<key>ad_appkey</key>
|
||||
<string>QVt-ZBOR44Frm2Ub8gEfbPo-K8SeKHvyzoq-TJ3op08cFx29THV9DviWinxrQBxNePGKU14gHOkClTrNOi_1a9</string>
|
||||
<key>wifi_interval</key>
|
||||
<string>30</string>
|
||||
<key>tka_url_agreement</key>
|
||||
<string>https://www.mooncakegame.com/agreements.html</string>
|
||||
<key>ad_templete_natvie_id</key>
|
||||
<string></string>
|
||||
<key>td_app_id</key>
|
||||
<string></string>
|
||||
<key>tka_age</key>
|
||||
<string>12</string>
|
||||
<key>ad_full_reward_id</key>
|
||||
<string></string>
|
||||
<key>tka_type</key>
|
||||
<string></string>
|
||||
<key>splash_img</key>
|
||||
<string></string>
|
||||
<key>channel_appkey</key>
|
||||
<string></string>
|
||||
<key>unlock</key>
|
||||
<string>on</string>
|
||||
<key>ad_interstital_id</key>
|
||||
<string>8eb8a28145e1be9b</string>
|
||||
<key>citys</key>
|
||||
<string>北京,上海,广州,深圳,东莞,香港,澳门,武汉,阿里云,腾讯云,华为云</string>
|
||||
<key>publisher_appid</key>
|
||||
<string></string>
|
||||
<key>ad_splash_id</key>
|
||||
<string>b62b1434a10b0f</string>
|
||||
<key>baidumobad_app_id</key>
|
||||
<string></string>
|
||||
<key>channel_appsecret</key>
|
||||
<string></string>
|
||||
<key>ad_appid</key>
|
||||
<string>a62b1432a7272e@c13e4357e57d78e76e472899eb182e98</string>
|
||||
<key>ad_sk_native1_id</key>
|
||||
<string></string>
|
||||
<key>publish_account</key>
|
||||
<string>Mooncake Games Limited</string>
|
||||
<key>channel_appid</key>
|
||||
<string></string>
|
||||
<key>ad_render_native_id</key>
|
||||
<string>18dd15e1c2504e58</string>
|
||||
<key>wifi</key>
|
||||
<string>on</string>
|
||||
<key>pp</key>
|
||||
<string>30</string>
|
||||
<key>ad_reward_id</key>
|
||||
<string>4e99071ebf834bdd</string>
|
||||
<key>ad_sk_native_id</key>
|
||||
<string></string>
|
||||
<key>tka_url_moregame</key>
|
||||
<string>https://apps.apple.com/developer/id1521253916</string>
|
||||
<key>unlock_style</key>
|
||||
<string>2</string>
|
||||
<key>ga_key</key>
|
||||
<string>c21c63a29900d500b4490ad307a041be</string>
|
||||
<key>ad_sk_splash_id</key>
|
||||
<string></string>
|
||||
<key>ad_platform</key>
|
||||
<string>max</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d1f5e5143e4534ac8be4868699969557
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,156 @@
|
|||
|
||||
#=================基础配置=============================
|
||||
#游戏名称
|
||||
app_name=Color Picker
|
||||
#包名
|
||||
package_name=com.hotpotgames.colorpicker.global
|
||||
#闪屏图(&健康提示),值:图片名字,没有填"",详见需求文档(- 新增splash图 部分):https://pic6ktmsyi.feishu.cn/docs/doccnRdYblZyPN2HpIK6nsJmqSb#
|
||||
splash_img=
|
||||
#游戏横竖屏,根据游戏横竖屏取值 值: 0 竖屏, 1 横屏
|
||||
game_screen_orientation=0
|
||||
#发行主体
|
||||
publish_account=Hotpotgames
|
||||
|
||||
#渠道
|
||||
channel=GooglePlay
|
||||
#子渠道
|
||||
sub_channel=""
|
||||
#客户端协议上报u8 appid
|
||||
tk_app_id=8145
|
||||
|
||||
#外部测试使用facebook id
|
||||
fb_appid=
|
||||
fb_client_token=
|
||||
#adjust_id{}
|
||||
adjust_id=
|
||||
#巨量app id
|
||||
rangers_applog_id={rangers_applog_id}
|
||||
#发行人app id
|
||||
publisher_appid=
|
||||
publisher_url_scheme=
|
||||
#游戏软著著作人
|
||||
copyright_holder=
|
||||
#游戏软著登记号
|
||||
copyright_id=
|
||||
|
||||
#调试模式(写死不动,仅供调试使用)
|
||||
#debug_mode=false
|
||||
|
||||
|
||||
#=================用户协议(弹窗)配置=============================
|
||||
#游戏类型
|
||||
TkA_Type=
|
||||
#游戏题材
|
||||
TkA_Theme=
|
||||
#适龄,取值:8|12|16|18
|
||||
TkA_Age=8
|
||||
#隐私政策url
|
||||
TkA_Url_Privacy=https://www.hotpotgame.com/privacy.html
|
||||
#用户协议url
|
||||
TkA_Url_Agreement=
|
||||
|
||||
#=================广告通用配置=============================
|
||||
#广告平台,max|topon|xiaomi
|
||||
ad_platform=max
|
||||
|
||||
#广告appid (包括max applovin.sdk.key)
|
||||
ad_appid=
|
||||
#广告appkey
|
||||
ad_appkey=QVt-ZBOR44Frm2Ub8gEfbPo-K8SeKHvyzoq-TJ3op08cFx29THV9DviWinxrQBxNePGKU14gHOkClTrNOi_1a9
|
||||
#admob id
|
||||
admob_id=ca-app-pub-3916046151571724~8722834992
|
||||
|
||||
|
||||
#开屏广告位id
|
||||
ad_splash_id=
|
||||
ad_native_splash_id=
|
||||
#插屏广告位id
|
||||
ad_interstital_id=152b72ba25982c79
|
||||
#半屏插屏广告位id(小米广告区分全/半屏)
|
||||
ad_interstital_half_id=
|
||||
#激励视频广告位id
|
||||
ad_reward_id=f8d4cdbd7aa2cc51
|
||||
#banner广告位id
|
||||
ad_banner_id=6cb3712e367507ee
|
||||
ad_native_banner_id=
|
||||
# 原生模板广告位id [增加]
|
||||
ad_templete_natvie_id=
|
||||
|
||||
# 原生自渲染广告位id [增加]
|
||||
ad_render_native_id=
|
||||
|
||||
|
||||
#=================TW配置=============================
|
||||
#[TODO][meta-data]百度 APPID
|
||||
BaiduMobAd_APP_ID=
|
||||
|
||||
#副包下载链接
|
||||
FB_DOWNLOAD_URL=
|
||||
FB_POP_CONFIG_DAT_URL=
|
||||
#更多游戏链接
|
||||
tka_url_moregame=https://play.google.com/store/apps/developer?id=Hotpot+Games
|
||||
|
||||
#TW广告位
|
||||
#SDK插屏
|
||||
ad_sk_interstital_id=
|
||||
#SDK开屏
|
||||
ad_sk_splash_id=
|
||||
#SDK信息流
|
||||
ad_sk_native_id=
|
||||
#SDK信息流1
|
||||
ad_sk_native1_id=
|
||||
|
||||
#[TODO][meta-data]游戏主 Activity:
|
||||
#取值 Unity游戏: com.u8.sdk.U8UnityContext
|
||||
#flash游戏: com.u8.sdk.ane.U8ANEActivity
|
||||
#Cocos游戏: com.u8.sdk.U8CocosActivity
|
||||
MAIN_ACTIVITY=com.u8.sdk.U8UnityContext
|
||||
|
||||
#极光 AppKey,默认空
|
||||
JPUSH_APPKEY=""
|
||||
|
||||
|
||||
#客服邮箱
|
||||
tkg_custom=dev@hotpotgame.com
|
||||
channel_appid=
|
||||
channel_appkey=
|
||||
channel_appsecret=
|
||||
|
||||
|
||||
#=================Bugly=============================
|
||||
Bugly_AppID=
|
||||
Bugly_AppKey=
|
||||
|
||||
|
||||
#=================YSDK实名认证=============================
|
||||
#[TODO][ysdkconf.ini]腾讯AppID
|
||||
OFFER_ID=
|
||||
|
||||
|
||||
#=================Umeng配置=============================
|
||||
#UM Appkey
|
||||
UM_APP_KEY=62c3f8b088ccdf4b7ebc5f74
|
||||
#json 参数 key
|
||||
JSON_PARAM_KEY=""
|
||||
#[TODO][文件类型参数]默认 (在线) 参数配置
|
||||
UMENG_DEFAULT_ONLINE_CONFIG=""
|
||||
|
||||
#=================GA配置=============================
|
||||
#GA AppKey
|
||||
GA_KEY=5342eefde8d625ce060d9ec732c5bad9
|
||||
#GA AppSecret
|
||||
GA_SECRETKEY=0525bec7657873780b90f028910e773a8bbdbc24
|
||||
|
||||
#=================热云配置=============================
|
||||
#AppKey
|
||||
RN_APP_KEY=
|
||||
|
||||
#=================Tenjin配置=============================
|
||||
#Tenjin ApiKey
|
||||
TENJIN_API_KEY=PYOTVKJ4XZJHSMZW2V6GBQRCNXAFKWU2
|
||||
|
||||
#=================Firebase配置=============================
|
||||
#[TODO][文件类型参数]google-services.json文件
|
||||
google_services_json=""
|
||||
|
||||
{remark}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a34958c8e642f462f8d9c6f3e8808232
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,70 @@
|
|||
TKG_ENABLE_LOG = false
|
||||
|
||||
|
||||
#***********副包配置***********
|
||||
#副包下载地址,目前所有游戏使用同一个副包,此链接不需要修改
|
||||
FB_DOWNLOAD_URL = http://p2-yx.adkwai.com/udata/pkg/DSP-EFFECT/apk/36e063f5-9473-4064-b99f-8686bcc427e6.apk
|
||||
#是否在wifi状态下提前预下载副包apk
|
||||
FB_PREDOWNLOAD_IN_WIFI = false
|
||||
|
||||
#云控弹窗配置链接(* 每个游戏需要单独配置),留空则使用留包配置
|
||||
#FB_POP_CONFIG_DAT_URL = https://my-report.oss-cn-beijing.aliyuncs.com/config/pops-com.zlsz.basketdash.global.dat
|
||||
|
||||
#锁屏广告类型 0:信息流 1:百度资讯 此处设置会被弹窗配置文件(pop-包名.dat)设置覆盖
|
||||
DEFAULT_LOCK_SCREEN_TYPE = 0
|
||||
#弹窗库日志打印开关
|
||||
POPLIB_LOG_ENABLE = false
|
||||
|
||||
#延迟多久弹出副包悬浮按钮,单位毫秒(可根据游戏加载时长设置,一般进入游戏正式画面再显示)
|
||||
SHOW_FB_UI_DELAY = 5000
|
||||
#自动弹出副包安装提示弹窗时,延迟多久弹出,单位毫秒(可根据游戏加载时长设置,一般进入游戏正式画面再显示)
|
||||
AUTO_SHOW_FB_DIALOG_DELAY = 10000
|
||||
|
||||
|
||||
#激活上报比例,取值0-100
|
||||
ANALYTICS_RATIO = 100
|
||||
|
||||
#统计激活(初始化)时机
|
||||
# 打开游戏时 :0
|
||||
# 实名认证之后 :1
|
||||
# 展示了一次插屏广告 :3
|
||||
# 广告展示收入达标 :5 (设置这个值需要同时设置ANALYTICS_INIT_REVENUE的取值)
|
||||
ANALYTICS_INIT_TIME = 0
|
||||
#广告收入达到多少才初始化,值: 0.005
|
||||
ANALYTICS_INIT_REVENUE = 0
|
||||
#展示广告x次数之后初始化统计SDK
|
||||
ANALYTICS_SHOW_AD_NUMBER = 1
|
||||
|
||||
#插屏广告弹出规则 值json: [{"type":0,"overLevel":0,"interval":30,"skipLevel":1},{"type":1,"overLevel":0,"interval":30,"skipLevel":1}]
|
||||
INTER_AD_RULES = [{"type":"0","overLevel":"0","interval":"10","skipLevel":"1"}]
|
||||
#自动插屏规则 值json: SDK默认值: {"open":false,"interval":30,"skipLevel":1}
|
||||
AUTO_INTER_AD_RULES= {"open":false,"interval":"30","skipLevel":"-1"}
|
||||
|
||||
#新增当天游戏通关数,一个用户上报一次,X支持在线参数配置,默认值15
|
||||
NewUserPassLevel = 15
|
||||
#新增当天视频广告播放次数超过X次,则上报,一个用户上报一次,X支持在线参数配置,默认值15
|
||||
NewUserAdsCount = 15
|
||||
|
||||
#用户任意类型广告(包括游戏内及TW所有广告类型)ecpm达到X则上报
|
||||
NewUserEcpm = 3
|
||||
#当插屏ecpm达到X则上报,包括TW插屏
|
||||
NewUserIvEcpm = 3
|
||||
#当激励视频ecpm达到X则上报
|
||||
NewUserRvEcpm = 4
|
||||
#插屏+激励视频(包括TW),成功展示X次则上报。
|
||||
NewUserPvCount = 18
|
||||
|
||||
#用户任意类型广告ecpm达到X且用户时长达到Y则上报。时长(NewUserTime)是当日多次登陆累计时间
|
||||
NewUserTimeEcpm = 3
|
||||
#时间,单位秒
|
||||
NewUserTime = 600
|
||||
|
||||
#用户收益达到X则上报
|
||||
NewUserAdsArpu = 0.05
|
||||
|
||||
nativeStatus = 0
|
||||
bannerStatus = 1
|
||||
tkgshowauthview = 0
|
||||
nativeTemplatesType = 3
|
||||
|
||||
{remark}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c3855640365d742e1a7af4a90cfb0aae
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,62 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>auto_inter_ad_rules</key>
|
||||
<string>{"open":false,"interval":"30","skipLevel":"-1"}</string>
|
||||
<key>analytics_init_time</key>
|
||||
<string>0</string>
|
||||
<key>show_fb_ui_delay</key>
|
||||
<string>5000</string>
|
||||
<key>analytics_ratio</key>
|
||||
<string>100</string>
|
||||
<key>skiplevel</key>
|
||||
<string>-1</string>
|
||||
<key>newusertime</key>
|
||||
<string>600</string>
|
||||
<key>newuseradscount</key>
|
||||
<string>15</string>
|
||||
<key>config_id</key>
|
||||
<string>77</string>
|
||||
<key>analytics_show_ad_number</key>
|
||||
<string>1</string>
|
||||
<key>tkg_enable_log</key>
|
||||
<string>false</string>
|
||||
<key>inter_ad_rules</key>
|
||||
<string>[{"type":"0","overLevel":"0","interval":"10","skipLevel":"1"}]</string>
|
||||
<key>poplib_log_enable</key>
|
||||
<string>false</string>
|
||||
<key>newuseradsarpu</key>
|
||||
<string>0.05</string>
|
||||
<key>newuserecpm</key>
|
||||
<string>3</string>
|
||||
<key>newuserrvecpm</key>
|
||||
<string>4</string>
|
||||
<key>nativestatus</key>
|
||||
<string>1</string>
|
||||
<key>type</key>
|
||||
<string>0</string>
|
||||
<key>newuserpvcount</key>
|
||||
<string>2</string>
|
||||
<key>overlevel</key>
|
||||
<string>0</string>
|
||||
<key>interval</key>
|
||||
<string>30</string>
|
||||
<key>default_lock_screen_type</key>
|
||||
<string>0</string>
|
||||
<key>newuserpasslevel</key>
|
||||
<string>2</string>
|
||||
<key>newuserivecpm</key>
|
||||
<string>3</string>
|
||||
<key>analytics_init_revenue</key>
|
||||
<string>0</string>
|
||||
<key>newusertimeecpm</key>
|
||||
<string>3</string>
|
||||
<key>auto_show_fb_dialog_delay</key>
|
||||
<string>10000</string>
|
||||
<key>bannerstatus</key>
|
||||
<string>1</string>
|
||||
<key>fb_predownload_in_wifi</key>
|
||||
<string>false</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 542de8af1871448e8b21feae752cab29
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1 @@
|
|||
{"androidStore":"GooglePlay"}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0fad6ce3e5a5840a79c4ecabc5ec0ad8
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 280bc1f07de0b47dca18f2c1ae47b020
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d593d4318dbe74bc596a591549ee75d5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0382ea99170c4407c9567e7943eeb050
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,602 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Touka;
|
||||
|
||||
public class TKGSDKManager : TKGSingleton<TKGSDKManager>
|
||||
{
|
||||
public bool IsNoAllAD
|
||||
{
|
||||
get => mIsNoAllAD;
|
||||
set
|
||||
{
|
||||
mIsNoAllAD = value;
|
||||
if (mIsNoAllAD)
|
||||
{
|
||||
PurchasedRemoveAds();
|
||||
HideBanner();
|
||||
}
|
||||
}
|
||||
}
|
||||
private bool mIsNoAllAD = false;
|
||||
|
||||
public bool IsRemoveAds
|
||||
{
|
||||
get => mIsRemoveAds;
|
||||
set
|
||||
{
|
||||
mIsRemoveAds = value;
|
||||
if (mIsRemoveAds)
|
||||
{
|
||||
PurchasedRemoveAds();
|
||||
HideBanner();
|
||||
}
|
||||
}
|
||||
}
|
||||
private bool mIsRemoveAds = false;
|
||||
|
||||
public bool IsIAPEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
AppChannel tChannel = GetChannel();
|
||||
return (tChannel == AppChannel.AppStore_GB || tChannel == AppChannel.GooglePlay);
|
||||
}
|
||||
}
|
||||
|
||||
private int mLoginCount
|
||||
{
|
||||
get => PlayerPrefs.GetInt(nameof(mLoginCount), 0);
|
||||
set => PlayerPrefs.SetInt(nameof(mLoginCount), value);
|
||||
}
|
||||
|
||||
private int mPassCount
|
||||
{
|
||||
get => PlayerPrefs.GetInt(nameof(mPassCount), 0);
|
||||
set => PlayerPrefs.SetInt(nameof(mPassCount), value);
|
||||
}
|
||||
|
||||
private bool mHasPoppedReview
|
||||
{
|
||||
get => PlayerPrefs.GetInt(nameof(mHasPoppedReview), 0) == 1;
|
||||
set => PlayerPrefs.SetInt(nameof(mHasPoppedReview), value ? 1 : 0);
|
||||
}
|
||||
|
||||
private bool isInit = false;
|
||||
|
||||
private ITKGSDK m_sdkInterface;
|
||||
|
||||
protected override void OnInstanceCreate()
|
||||
{
|
||||
base.OnInstanceCreate();
|
||||
|
||||
m_sdkInterface = new TKGSDKNative();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// init sdk
|
||||
/// </summary>
|
||||
/// <param name="_initCallback"></param>
|
||||
public void InitSDK(Action _initCallback = null)
|
||||
{
|
||||
if (isInit) return;
|
||||
|
||||
m_sdkInterface.InitSDK(_initCallback);
|
||||
isInit = true;
|
||||
mLoginCount++;
|
||||
|
||||
if (IsIAPEnabled)
|
||||
{
|
||||
#if USE_IAP
|
||||
IAPTool.Instance.Initialize();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set game focus
|
||||
/// </summary>
|
||||
/// <param name="_gameFocusAction"></param>
|
||||
public void SetGameFocusListener(Action<bool> _gameFocusAction)
|
||||
{
|
||||
m_sdkInterface.SetGameFocusListener(_gameFocusAction);
|
||||
}
|
||||
|
||||
// reward click callback
|
||||
public void SetRewardClickListener(Action _clickCallback = null)
|
||||
{
|
||||
m_sdkInterface.SetRewardClickListener(_clickCallback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get channel
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public AppChannel GetChannel()
|
||||
{
|
||||
return m_sdkInterface.GetChannel();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set log enable
|
||||
/// </summary>
|
||||
public void SetLogEnable(bool _enable)
|
||||
{
|
||||
StaticOtherConfig.IsDebugLog = _enable;
|
||||
m_sdkInterface.SetLogEnable(_enable);
|
||||
}
|
||||
|
||||
#region Ads
|
||||
// 去广告接口调用
|
||||
public void PurchasedRemoveAds()
|
||||
{
|
||||
m_sdkInterface.PurchasedRemoveAds();
|
||||
}
|
||||
/// <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>
|
||||
public void ShowInterstitialAd(TKGIVAdPositionName _adPos, Action _callback = null, IVADType _IvType = IVADType.IV1)
|
||||
{
|
||||
#if UNITY_EDITOR || NO_AD
|
||||
if (null != _callback)
|
||||
{
|
||||
Debug.Log("Need Show IV, in editor directly invoke callback.");
|
||||
_callback.Invoke();
|
||||
}
|
||||
return;
|
||||
|
||||
#endif
|
||||
if (IsNoAllAD || IsRemoveAds)
|
||||
{
|
||||
_callback?.Invoke();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sdkInterface.ShowInterstitialAd(_adPos, _callback, _IvType);
|
||||
}
|
||||
}
|
||||
|
||||
/// <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>
|
||||
public void ShowRewardAd(TKGRVPositionName _adPos, Action<bool> _rewardCallback = null, Action _showFailedCallback = null)
|
||||
{
|
||||
#if UNITY_EDITOR || NO_AD
|
||||
if (null != _rewardCallback)
|
||||
{
|
||||
_rewardCallback.Invoke(true);
|
||||
}
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (IsNoAllAD)
|
||||
{
|
||||
_rewardCallback?.Invoke(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sdkInterface.ShowRewardAd(_adPos, _rewardCallback, _showFailedCallback);
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowNative(RectTransform pRect, Camera pCam = null, string pAdPos = "")
|
||||
{
|
||||
#if !NO_AD
|
||||
if (!IsNoAllAD && !IsRemoveAds)
|
||||
{
|
||||
m_sdkInterface.ShowNativeAd(pRect, pCam, pAdPos);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is Ready Interstitial
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool IsReadyInterstitialAd()
|
||||
{
|
||||
|
||||
return m_sdkInterface.IsReadyInterstitialAd();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is Ready Reward
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool IsReadyRewardAd()
|
||||
{
|
||||
return m_sdkInterface.IsReadyRewardAd();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is Ready Native Ad
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool IsReadyNativeAd()
|
||||
{
|
||||
#if NO_AD
|
||||
return false;
|
||||
#else
|
||||
return m_sdkInterface.IsReadyNativeAd();
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show banner
|
||||
/// </summary>
|
||||
/// <param name="_bannerAlign">bannerAlign</param>
|
||||
public void ShowBanner(TKGBannerAlign _bannerAlign)
|
||||
{
|
||||
#if !NO_AD
|
||||
if (!IsNoAllAD && !IsRemoveAds)
|
||||
{
|
||||
m_sdkInterface.ShowBanner(_bannerAlign);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hide banner
|
||||
/// </summary>
|
||||
public void HideBanner()
|
||||
{
|
||||
m_sdkInterface.HideBanner();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Remove Native
|
||||
/// </summary>
|
||||
public void RemoveNative()
|
||||
{
|
||||
m_sdkInterface.RemoveNativeAd();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Log Event
|
||||
|
||||
#region Normal
|
||||
|
||||
/// <summary>
|
||||
/// Log Event
|
||||
/// </summary>
|
||||
/// <param name="_eventSort"></param>
|
||||
public void LogEvent(string _eventSort)
|
||||
{
|
||||
m_sdkInterface.LogEvent(_eventSort);
|
||||
|
||||
}
|
||||
|
||||
/// <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)
|
||||
{
|
||||
m_sdkInterface.LogEvent(_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)
|
||||
{
|
||||
m_sdkInterface.LogEvent(_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)
|
||||
{
|
||||
m_sdkInterface.LogEvent(_eventSort, _eventDic);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Level Event
|
||||
|
||||
/// <summary>
|
||||
/// Level start
|
||||
/// </summary>
|
||||
/// <param name="_level"></param>
|
||||
public void LevelStart(int _level)
|
||||
{
|
||||
LevelStart(_level.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Level start
|
||||
/// </summary>
|
||||
/// <param name="_level"></param>
|
||||
public void LevelStart(string _level)
|
||||
{
|
||||
m_sdkInterface.LevelStart(_level);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Level end
|
||||
/// </summary>
|
||||
/// <param name="_level"></param>
|
||||
/// <param name="_win"></param>
|
||||
public bool LevelEnd(int _level, StageResult _stageResult)
|
||||
{
|
||||
return LevelEnd(_level.ToString(), _stageResult);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Level end,if return false, it means review pops up.
|
||||
/// </summary>
|
||||
/// <param name="_level"></param>
|
||||
/// <param name="_win"></param>
|
||||
public bool LevelEnd(string _level, StageResult _stageResult)
|
||||
{
|
||||
m_sdkInterface.LevelEnd(_level, _stageResult);
|
||||
|
||||
if (_stageResult == StageResult.StageSucc)
|
||||
{
|
||||
mPassCount++;
|
||||
#if UNITY_IOS//only ios has review popup
|
||||
return !CheckReviewPop(mPassCount);
|
||||
#endif
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool CheckReviewPop(int pLevel)
|
||||
{
|
||||
if (mHasPoppedReview)
|
||||
return false;
|
||||
|
||||
if (mLoginCount == 1 && pLevel == StaticOtherConfig.FirstLoginPopLevel)
|
||||
{
|
||||
Debug.Log("pop first review");
|
||||
mHasPoppedReview = true;
|
||||
Review();
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (mLoginCount > 1 && pLevel == StaticOtherConfig.OtherLoginPopLevel)
|
||||
{
|
||||
Debug.Log("pop other review");
|
||||
mHasPoppedReview = true;
|
||||
Review();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Reward Ad Button Show
|
||||
|
||||
/// <summary>
|
||||
/// Log Reward ad button show
|
||||
/// </summary>
|
||||
/// <param name="_pos"></param>
|
||||
public void LogRewardAdBtnShow(string _pos)
|
||||
{
|
||||
m_sdkInterface.LogRewardAdBtnShow(_pos);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Tracking Event
|
||||
|
||||
/// <summary>
|
||||
/// Log Tracking Event
|
||||
/// </summary>
|
||||
/// <param name="_eventType"></param>
|
||||
private void LogTrackingEvent(TrackingEventType _eventType)
|
||||
{
|
||||
//m_sdkInterface.LogTrackingEvent(_eventType);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Online Config
|
||||
|
||||
/// <summary>
|
||||
/// get config - string
|
||||
/// </summary>
|
||||
/// <param name="_key"></param>
|
||||
/// <returns></returns>
|
||||
public string GetConfigStr(TKGParamKey _key)
|
||||
{
|
||||
|
||||
return m_sdkInterface.GetConfigStr(_key.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get config - int
|
||||
/// </summary>
|
||||
/// <param name="_key"></param>
|
||||
/// <returns></returns>
|
||||
public int GetConfigInt(TKGParamKey _key)
|
||||
{
|
||||
|
||||
return m_sdkInterface.GetConfigInt(_key.ToString());
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// get config - bool
|
||||
/// </summary>
|
||||
/// <param name="_key"></param>
|
||||
/// <returns></returns>
|
||||
public bool GetConfigBool(TKGParamKey _key)
|
||||
{
|
||||
return m_sdkInterface.GetConfigBool(_key.ToString());
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Others (common)
|
||||
|
||||
/// <summary>
|
||||
/// review
|
||||
/// </summary>
|
||||
public void Review()
|
||||
{
|
||||
m_sdkInterface.Review();
|
||||
}
|
||||
|
||||
/// 使用 OpenPolicyPop 接口 === Use OpenPolicyPop
|
||||
/// 使用 OpenPolicyPop 接口 === Use OpenPolicyPop
|
||||
/// 使用 OpenPolicyPop 接口 === Use OpenPolicyPop
|
||||
/// <summary>
|
||||
/// open privacy url
|
||||
/// </summary>
|
||||
//public void OpenPrivacyURL()
|
||||
//{
|
||||
// m_sdkInterface.OpenPrivacyURL();
|
||||
//}
|
||||
|
||||
/// 使用 OpenPolicyPop 接口 === Use OpenPolicyPop
|
||||
/// 使用 OpenPolicyPop 接口 === Use OpenPolicyPop
|
||||
/// 使用 OpenPolicyPop 接口 === Use OpenPolicyPop
|
||||
|
||||
/// <summary>
|
||||
/// open user agreement url
|
||||
/// </summary>
|
||||
//public void OpenUserTermURL()
|
||||
//{
|
||||
// m_sdkInterface.OpenUserTermURL();
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// open more game
|
||||
/// </summary>
|
||||
public void OpenMoreGame()
|
||||
{
|
||||
m_sdkInterface.OpenMoreGame();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// open url by browser
|
||||
/// </summary>
|
||||
/// <param name="_url"></param>
|
||||
public void OpenUrlByBrowser(string _url)
|
||||
{
|
||||
m_sdkInterface.OpenUrlByBrowser(_url);
|
||||
}
|
||||
|
||||
public void OpenPolicyPop()
|
||||
{
|
||||
m_sdkInterface.OpenPolicyPop();
|
||||
}
|
||||
|
||||
/// <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)
|
||||
{
|
||||
m_sdkInterface.Shake(_shakeType, _intensity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// share txt
|
||||
/// </summary>
|
||||
/// <param name="_shareTxt"></param>
|
||||
public void Share(string shareText)
|
||||
{
|
||||
m_sdkInterface.ShareTxt(shareText);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// regist APNS
|
||||
/// </summary>
|
||||
public void RegistAPNS()
|
||||
{
|
||||
|
||||
m_sdkInterface.RegistAPNS();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// shake
|
||||
/// </summary>
|
||||
/// <param name="notiName">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 = 1, string title = "", string subTitle = "")
|
||||
{
|
||||
|
||||
m_sdkInterface.RegistNotification(notiId,body,fireDate,badge,title,subTitle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// remove all notification
|
||||
/// </summary>
|
||||
public void RemoveAllNotifications()
|
||||
{
|
||||
|
||||
m_sdkInterface.RemoveAllNotifications();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// remove notification by notification identifier
|
||||
/// </summary>
|
||||
/// <param name="notiId">notification identifier</param>
|
||||
public void RemoveNotification(string notiId)
|
||||
{
|
||||
|
||||
m_sdkInterface.RemoveNotification(notiId);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region others
|
||||
|
||||
/// <summary>
|
||||
/// Set user source listener
|
||||
/// only call first can back source
|
||||
/// </summary>
|
||||
/// <param name="_userSourceAction"> true : origin user,false : not origin user </param>
|
||||
public void SetUserSourceListener(Action<bool, string> _userSourceAction)
|
||||
{
|
||||
m_sdkInterface.SetUserSourceListener(_userSourceAction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// set common callback
|
||||
/// </summary>
|
||||
/// <param name="_commonCallbackAction"></param>
|
||||
public void SetTKGCommonCallback(Action<CommonCallbackCode, string> _commonCallbackAction)
|
||||
{
|
||||
m_sdkInterface.SetTKGCommonCallback(_commonCallbackAction);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region h5
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 76c8624dacb844b03bb8a32a7305348b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,164 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Touka;
|
||||
|
||||
public class TKGUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否首次触达某个事件
|
||||
/// </summary>
|
||||
/// <param name="_key"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IfFirstCheckPlayerPrefs(string _key)
|
||||
{
|
||||
var isFirstClick = GetPlayerPrefsIntByKey(_key) == 0;
|
||||
SavePlayerPrefsIntByKeyValue(_key, 1);
|
||||
|
||||
return isFirstClick;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 本地存int
|
||||
///
|
||||
/// key 内部拼接了前缀:Touka_
|
||||
/// </summary>
|
||||
/// <param name="_key"></param>
|
||||
/// <param name="_defaultValue"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetPlayerPrefsIntByKey(string _key, int _defaultValue = 0)
|
||||
{
|
||||
int value = PlayerPrefs.GetInt(string.Format("{0}{1}", TKGStringPlayerPrefs.TOUKA_PREFIX, _key), _defaultValue);
|
||||
return value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 本地取int
|
||||
///
|
||||
/// key 内部拼接了前缀:Touka_
|
||||
/// </summary>
|
||||
/// <param name="_key"></param>
|
||||
/// <param name="_newValue"></param>
|
||||
public static void SavePlayerPrefsIntByKeyValue(string _key, int _newValue)
|
||||
{
|
||||
PlayerPrefs.SetInt(string.Format("{0}{1}", TKGStringPlayerPrefs.TOUKA_PREFIX, _key), _newValue);
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 本地存string
|
||||
///
|
||||
/// key 内部拼接了前缀:Touka_
|
||||
/// </summary>
|
||||
/// <param name="_key"></param>
|
||||
/// <param name="_defaultValue"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetPlayerPrefsStringByKey(string _key, string _defaultValue = "")
|
||||
{
|
||||
string value = PlayerPrefs.GetString(string.Format("{0}{1}", TKGStringPlayerPrefs.TOUKA_PREFIX, _key), _defaultValue);
|
||||
return value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 本地取string
|
||||
///
|
||||
/// key 内部拼接了前缀:Touka_
|
||||
/// </summary>
|
||||
/// <param name="_key"></param>
|
||||
/// <param name="_newValue"></param>
|
||||
public static void SavePlayerPrefsStringByKeyValue(string _key, string _newValue)
|
||||
{
|
||||
PlayerPrefs.SetString(string.Format("{0}{1}", TKGStringPlayerPrefs.TOUKA_PREFIX, _key), _newValue);
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 缓存当前时间
|
||||
/// </summary>
|
||||
/// <param name="_key"></param>
|
||||
public static void SaveCurrTime2PlayerPrefs(string _key)
|
||||
{
|
||||
DateTime date1 = DateTime.Now;
|
||||
string s1 = date1.ToString();
|
||||
SavePlayerPrefsStringByKeyValue(_key, s1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 缓存本地时间为string
|
||||
/// </summary>
|
||||
/// <param name="_key"></param>
|
||||
/// <param name="_dateStr"></param>
|
||||
public static void SaveCurrTime2PlayerPrefsWithStringDate(string _key, string _dateStr)
|
||||
{
|
||||
SavePlayerPrefsStringByKeyValue(_key, _dateStr);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 取出缓存string时间为 DateTime
|
||||
/// </summary>
|
||||
/// <param name="_key"></param>
|
||||
/// <returns></returns>
|
||||
public static DateTime GetDateTimeFromPlayerPrefs(string _key)
|
||||
{
|
||||
string firstDateValue = GetPlayerPrefsStringByKey(_key);
|
||||
if (string.IsNullOrEmpty(firstDateValue))
|
||||
{
|
||||
return new DateTime(1990, 1, 1, 0, 0, 0);
|
||||
}
|
||||
DateTime dateOld = Convert.ToDateTime(firstDateValue);
|
||||
return dateOld;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// equal double
|
||||
/// </summary>
|
||||
/// <param name="a"></param>
|
||||
/// <param name="b"></param>
|
||||
/// <returns></returns>
|
||||
public static bool equalDouble(double a, double b)
|
||||
{
|
||||
if ((a - b > -0.000001) && (a - b) < 0.000001)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Floats the equal.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c>, if equal was floated, <c>false</c> otherwise.</returns>
|
||||
/// <param name="a">The alpha component.</param>
|
||||
/// <param name="b">The blue component.</param>
|
||||
public static bool FloatEqual(float a, float b)
|
||||
{
|
||||
if ((a - b > -0.000001) && (a - b) < 0.000001)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get Today data str
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string GetTodayDataStr()
|
||||
{
|
||||
string timeStr = DateTime.Now.ToString("yyyy-MM-dd");
|
||||
return timeStr;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Open Browser Url
|
||||
/// </summary>
|
||||
/// <param name="_url"></param>
|
||||
public static void OpenBrowserUrl(string _url)
|
||||
{
|
||||
Application.OpenURL(_url);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0c6bb316782354791a6df23332a4ee5e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6b84514263d4b4a8497e36e44442b7f5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,365 @@
|
|||
#if USE_IAP
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Purchasing;
|
||||
using Touka;
|
||||
|
||||
public class IAPTool : NormalSingleton<IAPTool>, IStoreListener
|
||||
{
|
||||
public event Action OnPurchaseBegin;
|
||||
public event Action<string, bool> OnPurchaseDone;
|
||||
public event Action<bool> OnRestoreDone;
|
||||
|
||||
public bool IsRestoring => mIsRestoring;
|
||||
private bool mIsRestoring = false;
|
||||
|
||||
private static IStoreController m_StoreController; // 存储商品信息;
|
||||
private static IExtensionProvider m_StoreExtensionProvider; // IAP扩展工具;
|
||||
private bool m_PurchaseInProgress = false; // 是否处于付费中;
|
||||
|
||||
private Dictionary<string, ProductType> mInitProductDic;
|
||||
private SubscriptionInfo mSubsInfo = null;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
if (m_StoreController == null && m_StoreExtensionProvider == null)
|
||||
InitUnityPurchase();
|
||||
}
|
||||
|
||||
private bool IsInitialized()
|
||||
{
|
||||
return m_StoreController != null && m_StoreExtensionProvider != null;
|
||||
}
|
||||
|
||||
public void AddProducts(Dictionary<string, ProductType> pInitProductDic)
|
||||
{
|
||||
mInitProductDic = pInitProductDic;
|
||||
}
|
||||
|
||||
// 初始化IAP;
|
||||
private void InitUnityPurchase()
|
||||
{
|
||||
if (IsInitialized()) return;
|
||||
|
||||
// 标准采购模块;
|
||||
StandardPurchasingModule module = StandardPurchasingModule.Instance();
|
||||
|
||||
// 配置模式;
|
||||
ConfigurationBuilder builder = ConfigurationBuilder.Instance(module);
|
||||
|
||||
// 注意ProductType的类型,Consumable是可以无限购买(比如水晶),NonConsumable是只能购买一次(比如关卡),Subscription是每月订阅(比如VIP);
|
||||
// 这里初始化没有添加平台信息,因为平台信息有的时候还存在bug,如果必须添加,也可以添加,没有问题,确保平台信息添加正确就行了。
|
||||
|
||||
foreach (string tID in IAPProducts.ProductDic.Keys)
|
||||
{
|
||||
builder.AddProduct(tID, IAPProducts.ProductDic[tID]);
|
||||
}
|
||||
|
||||
if (mInitProductDic != null && mInitProductDic.Count > 0)
|
||||
{
|
||||
foreach (string tID in mInitProductDic.Keys)
|
||||
{
|
||||
builder.AddProduct(tID, mInitProductDic[tID]);
|
||||
}
|
||||
}
|
||||
|
||||
//初始化;
|
||||
UnityPurchasing.Initialize(this, builder);
|
||||
}
|
||||
|
||||
#region Public Func
|
||||
// 根据ID给购买商品;
|
||||
public void BuyProductByID(string productId)
|
||||
{
|
||||
if (IsInitialized())
|
||||
{
|
||||
if (m_PurchaseInProgress == true) return;
|
||||
|
||||
Product product = m_StoreController.products.WithID(productId);
|
||||
if (product != null && product.availableToPurchase)
|
||||
{
|
||||
OnPurchaseBegin?.Invoke();
|
||||
m_PurchaseInProgress = true;
|
||||
TKGDebugger.LogDebug(string.Format("Purchasing product asychronously: '{0}'", product.definition.id));
|
||||
m_StoreController.InitiatePurchase(product);
|
||||
}
|
||||
else
|
||||
{
|
||||
TKGDebugger.LogDebug("BuyProductID: FAIL. Not purchasing product, either is not found or is not available for purchase");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TKGDebugger.LogDebug("BuyProductID FAIL. Not initialized.");
|
||||
}
|
||||
}
|
||||
|
||||
// 确认购买产品成功;
|
||||
public void DoConfirmPendingPurchaseByID(string productId)
|
||||
{
|
||||
Product product = m_StoreController.products.WithID(productId);
|
||||
if (product != null && product.availableToPurchase)
|
||||
{
|
||||
if (m_PurchaseInProgress)
|
||||
{
|
||||
m_StoreController.ConfirmPendingPurchase(product);
|
||||
m_PurchaseInProgress = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 恢复购买;
|
||||
public void RestorePurchases()
|
||||
{
|
||||
if (!IsInitialized())
|
||||
{
|
||||
OnRestoreDone?.Invoke(false);
|
||||
TKGDebugger.LogDebug("RestorePurchases FAIL. Not initialized.");
|
||||
return;
|
||||
}
|
||||
if (Application.platform == RuntimePlatform.IPhonePlayer ||
|
||||
Application.platform == RuntimePlatform.OSXPlayer)
|
||||
{
|
||||
TKGDebugger.LogDebug("RestorePurchases started ...");
|
||||
mIsRestoring = true;
|
||||
var apple = m_StoreExtensionProvider.GetExtension<IAppleExtensions>();
|
||||
apple.RestoreTransactions((result) => {
|
||||
mIsRestoring = false;
|
||||
OnRestoreDone?.Invoke(result);
|
||||
// 返回一个bool值,如果成功,则会多次调用支付回调,然后根据支付回调中的参数得到商品id,最后做处理(ProcessPurchase);
|
||||
TKGDebugger.LogDebug("RestorePurchases continuing: " + result + ". If no further messages, no purchases available to restore.");
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
TKGDebugger.LogDebug("RestorePurchases FAIL. Not supported on this platform. Current = " + Application.platform);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region IStoreListener Callback
|
||||
// IAP初始化成功回掉函数;
|
||||
public void OnInitialized(IStoreController controller, IExtensionProvider extensions)
|
||||
{
|
||||
TKGDebugger.LogDebug("IAP initialize Succeed!");
|
||||
|
||||
m_StoreController = controller;
|
||||
m_StoreExtensionProvider = extensions;
|
||||
|
||||
// 这里可以获取您在AppStore和Google Play 上配置的商品;
|
||||
ProductCollection products = m_StoreController.products;
|
||||
Product[] all = products.all;
|
||||
for (int i = 0; i < all.Length; i++)
|
||||
{
|
||||
TKGDebugger.LogDebug(all[i].metadata.localizedTitle + "|" + all[i].metadata.localizedPriceString + "|" + all[i].metadata.localizedDescription + "|" + all[i].metadata.isoCurrencyCode);
|
||||
}
|
||||
|
||||
#if UNITY_IOS
|
||||
m_StoreExtensionProvider.GetExtension<IAppleExtensions>().RegisterPurchaseDeferredListener(OnDeferred);
|
||||
#endif
|
||||
|
||||
/*
|
||||
Dictionary<string, string> introductory_info_dict = null;
|
||||
|
||||
#if UNITY_IOS
|
||||
introductory_info_dict = m_StoreExtensionProvider.GetExtension<IAppleExtensions>().GetIntroductoryPriceDictionary();
|
||||
#endif
|
||||
|
||||
TKGDebugger.LogDebug("IAP - Available items:");
|
||||
foreach (var item in controller.products.all)
|
||||
{
|
||||
if (item.availableToPurchase)
|
||||
{
|
||||
TKGDebugger.LogDebug("IAP - " + string.Join(" - ",
|
||||
new[]
|
||||
{
|
||||
item.metadata.localizedTitle,
|
||||
item.metadata.localizedDescription,
|
||||
item.metadata.isoCurrencyCode,
|
||||
item.metadata.localizedPrice.ToString(),
|
||||
item.metadata.localizedPriceString,
|
||||
item.transactionID,
|
||||
item.receipt
|
||||
}));
|
||||
|
||||
// this is the usage of SubscriptionManager class
|
||||
if (item.receipt != null)
|
||||
{
|
||||
if (item.definition.type == ProductType.Subscription)
|
||||
{
|
||||
if (CheckIfProductIsAvailableForSubscriptionManagerC(item.receipt))
|
||||
{
|
||||
string intro_json = (introductory_info_dict == null || !introductory_info_dict.ContainsKey(item.definition.storeSpecificId)) ? null : introductory_info_dict[item.definition.storeSpecificId];
|
||||
SubscriptionManager p = new SubscriptionManager(item, intro_json);
|
||||
SubscriptionInfo info = p.getSubscriptionInfo();
|
||||
mSubsInfo = info;
|
||||
TKGDebugger.LogDebug("product id is: " + info.getProductId());
|
||||
TKGDebugger.LogDebug("purchase date is: " + info.getPurchaseDate());
|
||||
TKGDebugger.LogDebug("subscription next billing date is: " + info.getExpireDate());
|
||||
TKGDebugger.LogDebug("is subscribed? " + info.isSubscribed().ToString());
|
||||
TKGDebugger.LogDebug("is expired? " + info.isExpired().ToString());
|
||||
TKGDebugger.LogDebug("is cancelled? " + info.isCancelled());
|
||||
TKGDebugger.LogDebug("product is in free trial peroid? " + info.isFreeTrial());
|
||||
TKGDebugger.LogDebug("product is auto renewing? " + info.isAutoRenewing());
|
||||
TKGDebugger.LogDebug("subscription remaining valid time until next billing date is: " + info.getRemainingTime());
|
||||
TKGDebugger.LogDebug("is this product in introductory price period? " + info.isIntroductoryPricePeriod());
|
||||
TKGDebugger.LogDebug("the product introductory localized price is: " + info.getIntroductoryPrice());
|
||||
TKGDebugger.LogDebug("the product introductory price period is: " + info.getIntroductoryPricePeriod());
|
||||
TKGDebugger.LogDebug("the number of product introductory price period cycles is: " + info.getIntroductoryPricePeriodCycles());
|
||||
}
|
||||
else
|
||||
{
|
||||
TKGDebugger.LogDebug("This product is not available for SubscriptionManager class, only products that are purchase by 1.19+ SDK can use this class.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TKGDebugger.LogDebug("the product is not a subscription product");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TKGDebugger.LogDebug("the product should have a valid receipt");
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
// IAP初始化失败回掉函数(没有网络的情况下并不会调起,而是一直等到有网络连接再尝试初始化);
|
||||
public void OnInitializeFailed(InitializationFailureReason error)
|
||||
{
|
||||
switch (error)
|
||||
{
|
||||
case InitializationFailureReason.AppNotKnown:
|
||||
TKGDebugger.LogError("Is your App correctly uploaded on the relevant publisher console?");
|
||||
break;
|
||||
case InitializationFailureReason.PurchasingUnavailable:
|
||||
TKGDebugger.LogDebug("Billing disabled! Ask the user if billing is disabled in device settings.");
|
||||
break;
|
||||
case InitializationFailureReason.NoProductsAvailable:
|
||||
TKGDebugger.LogDebug("No products available for purchase! Developer configuration error; check product metadata!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckIfProductIsAvailableForSubscriptionManagerC(string receipt)
|
||||
{
|
||||
var receipt_wrapper = (Dictionary<string, object>)MiniJson.JsonDecode(receipt);
|
||||
if (!receipt_wrapper.ContainsKey("Store") || !receipt_wrapper.ContainsKey("Payload"))
|
||||
{
|
||||
TKGDebugger.LogDebug("The product receipt does not contain enough information");
|
||||
return false;
|
||||
}
|
||||
var store = (string)receipt_wrapper ["Store"];
|
||||
var payload = (string)receipt_wrapper ["Payload"];
|
||||
|
||||
if (payload != null )
|
||||
{
|
||||
switch (store)
|
||||
{
|
||||
case GooglePlay.Name:
|
||||
{
|
||||
var payload_wrapper = (Dictionary<string, object>)MiniJson.JsonDecode(payload);
|
||||
if (!payload_wrapper.ContainsKey("json")) {
|
||||
TKGDebugger.LogDebug("The product receipt does not contain enough information, the 'json' field is missing");
|
||||
return false;
|
||||
}
|
||||
var original_json_payload_wrapper = (Dictionary<string, object>)MiniJson.JsonDecode((string)payload_wrapper["json"]);
|
||||
if (original_json_payload_wrapper == null || !original_json_payload_wrapper.ContainsKey("developerPayload")) {
|
||||
TKGDebugger.LogDebug("The product receipt does not contain enough information, the 'developerPayload' field is missing");
|
||||
return false;
|
||||
}
|
||||
var developerPayloadJSON = (string)original_json_payload_wrapper["developerPayload"];
|
||||
var developerPayload_wrapper = (Dictionary<string, object>)MiniJson.JsonDecode(developerPayloadJSON);
|
||||
if (developerPayload_wrapper == null || !developerPayload_wrapper.ContainsKey("is_free_trial") || !developerPayload_wrapper.ContainsKey("has_introductory_price_trial")) {
|
||||
TKGDebugger.LogDebug("The product receipt does not contain enough information, the product is not purchased using 1.19 or later");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case AppleAppStore.Name:
|
||||
case AmazonApps.Name:
|
||||
case MacAppStore.Name:
|
||||
{
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 支付成功处理函数;
|
||||
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs e)
|
||||
{
|
||||
m_PurchaseInProgress = false;
|
||||
|
||||
TKGDebugger.LogDebug("Purchase OK: " + e.purchasedProduct.definition.id);
|
||||
|
||||
// 消息结构 : Receipt: {"Store":"fake","TransactionID":"9c5c16a5-1ae4-468f-806d-bc709440448a","Payload":"{ \"this\" : \"is a fake receipt\" }"};
|
||||
TKGDebugger.LogDebug("Receipt: " + e.purchasedProduct.receipt);
|
||||
|
||||
OnPurchaseDone?.Invoke(e.purchasedProduct.definition.id, true);
|
||||
|
||||
// 我们自己后台完毕的话,通过代码设置成功(如果是不需要后台设置直接设置完毕,不要设置Pending);
|
||||
return PurchaseProcessingResult.Complete;
|
||||
}
|
||||
|
||||
// 支付失败回掉函数;
|
||||
public void OnPurchaseFailed(Product item, PurchaseFailureReason r)
|
||||
{
|
||||
TKGDebugger.LogDebug("Purchase OK: " + item.definition.id);
|
||||
m_PurchaseInProgress = false;
|
||||
OnPurchaseDone?.Invoke(item.definition.id, false);
|
||||
}
|
||||
|
||||
// 购买延迟提示(这个看自己项目情况是否处理);
|
||||
public void OnDeferred(Product item)
|
||||
{
|
||||
TKGDebugger.LogDebug("Purchase deferred: " + item.definition.id);
|
||||
OnPurchaseDone?.Invoke(item.definition.id, false);
|
||||
}
|
||||
|
||||
// 恢复购买功能执行回掉函数;
|
||||
public void OnTransactionsRestored(bool success)
|
||||
{
|
||||
TKGDebugger.LogDebug("Transactions restored : " + success);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region custom functions
|
||||
public string GetPriceByID(string pID)
|
||||
{
|
||||
if (m_StoreController == null && m_StoreExtensionProvider == null)
|
||||
return "";
|
||||
|
||||
Product[] tProducts = m_StoreController.products.all;
|
||||
for (int i = 0; i < tProducts.Length; i++)
|
||||
{
|
||||
TKGDebugger.LogDebug(tProducts[i].metadata.localizedTitle + "|" + tProducts[i].metadata.localizedPriceString + "|" + tProducts[i].metadata.localizedDescription + "|" + tProducts[i].metadata.isoCurrencyCode);
|
||||
Product tItem = tProducts[i];
|
||||
if (tItem.definition.id.Equals(pID))
|
||||
{
|
||||
#if UNITY_ANDROID
|
||||
return tItem.metadata.GetGoogleProductMetadata().localizedPriceString;
|
||||
#else
|
||||
return tItem.metadata.localizedPriceString;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public SubscriptionInfo GetSubscriptionInfo()
|
||||
{
|
||||
return mSubsInfo;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 491772b3b6ab14cc9ad93ca3372753d2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
|
||||
public abstract class NormalSingleton<T> where T : NormalSingleton<T>, new()
|
||||
{
|
||||
private static T mInstance = null;
|
||||
public static T Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (mInstance == null)
|
||||
{
|
||||
mInstance = new T();
|
||||
}
|
||||
|
||||
return mInstance;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5f879dddbadcb47c59a66e24e018e1b4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,20 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class TKGAndroidCNHide : MonoBehaviour
|
||||
{
|
||||
private void Awake()
|
||||
{
|
||||
#if UNITY_ANDROID
|
||||
if (TKGSDKManager.Instance.GetChannel() == Touka.AppChannel.GooglePlay)
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7d2f5b9bcc64b44b3a86f7c065e3de8a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e07f9cec6bb0d421da6895e9b6326e41
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,398 @@
|
|||
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>
|
||||
/// 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
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 622e60b39ae0b411f9b149c5f416bebe
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,40 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Touka
|
||||
{
|
||||
public class TKGDebugger
|
||||
{
|
||||
public static void LogDebug(string content)
|
||||
{
|
||||
if (StaticOtherConfig.IsDebugLog)
|
||||
{
|
||||
Debug.Log(content);
|
||||
}
|
||||
}
|
||||
|
||||
public static void LogWarning(string content)
|
||||
{
|
||||
if (StaticOtherConfig.IsDebugLog)
|
||||
{
|
||||
Debug.LogWarning(content);
|
||||
}
|
||||
}
|
||||
|
||||
public static void LogError(string content)
|
||||
{
|
||||
//if (StaticOtherConfig.IsDebugLog)
|
||||
{
|
||||
Debug.LogError("[Error] " + content);
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetUnityLogger(bool _logEnable)
|
||||
{
|
||||
Debug.unityLogger.logEnabled = _logEnable;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 169fefdadb00d497889c1805955ce461
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,662 @@
|
|||
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)
|
||||
{
|
||||
TKGNativeInterface.Instance.Init(_initCallback);
|
||||
SetOnlineConfigInit();
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
public void SetRewardClickListener(Action _rewardClickAction)
|
||||
{
|
||||
TKGNativeInterface.Instance.SetRewardClickListener(_rewardClickAction);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get channel
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public AppChannel GetChannel()
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
#region Ads
|
||||
|
||||
public void SetUnitySDKVersion(string sdkVersion)
|
||||
{
|
||||
TKGNativeInterface.Instance.SetUnitySDKVersion(sdkVersion);
|
||||
}
|
||||
|
||||
public void PurchasedRemoveAds()
|
||||
{
|
||||
TKGNativeInterface.Instance.PurchasedRemoveAds();
|
||||
}
|
||||
|
||||
public void RemoveNativeAd()
|
||||
{
|
||||
TKGNativeInterface.Instance.RemoveNativeAd();
|
||||
}
|
||||
|
||||
public bool IsReadyNativeAd()
|
||||
{
|
||||
return TKGNativeInterface.Instance.IsReadyNativeAd();
|
||||
}
|
||||
|
||||
public void ShowNativeAd(RectTransform pRect, Camera pCam = null, string pAdPos = "")
|
||||
{
|
||||
|
||||
TKGNativeInterface.Instance.ShowNativeAd(pRect,pCam,pAdPos);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show banner
|
||||
/// </summary>
|
||||
/// <param name="_bannerAlign">bannerAlign</param>
|
||||
public void ShowBanner(TKGBannerAlign _pos)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
TKGNativeInterface.Instance.showBannerAd(_pos);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hide banner
|
||||
/// </summary>
|
||||
public void HideBanner()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
TKGNativeInterface.Instance.hideBannerAd();
|
||||
}
|
||||
|
||||
/// <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>
|
||||
public void ShowInterstitialAd(TKGIVAdPositionName _adPos, Action _callback = null, IVADType _IvType = IVADType.IV1)
|
||||
{
|
||||
#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);
|
||||
}
|
||||
|
||||
/// <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>
|
||||
public void ShowRewardAd(TKGRVPositionName _adPos, Action<bool> _rewardCallback = null, Action _showFailedCallback = null)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
TKGDebugger.LogDebug("[TKGSDKNative] Show reward call, _adPos : " + _adPos);
|
||||
if (_rewardCallback != null) _rewardCallback(true);
|
||||
return;
|
||||
#endif
|
||||
|
||||
TKGSDKCallback.mRewardCallback = _rewardCallback;
|
||||
TKGSDKCallback.mRewardShowFailedCallback = _showFailedCallback;
|
||||
|
||||
TKGNativeInterface.Instance.showRewardAd(_adPos.ToString(), -1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is Ready Interstitial
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool IsReadyInterstitialAd()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
return true;
|
||||
#endif
|
||||
return TKGNativeInterface.Instance.isInterstitialAdReady();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is Ready Reward
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool IsReadyRewardAd()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
return true;
|
||||
#endif
|
||||
return TKGNativeInterface.Instance.isRewardAdReady();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Log Event
|
||||
|
||||
#region Normal
|
||||
|
||||
/// <summary>
|
||||
/// log event
|
||||
/// </summary>
|
||||
/// <param name="_eventSort"></param>
|
||||
public void LogEvent(string _eventSort)
|
||||
{
|
||||
TKGDebugger.LogDebug("[TKGSDKNative] logEvent : " + _eventSort);
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
TKGNativeInterface.Instance.onEvent(_eventSort);
|
||||
}
|
||||
|
||||
|
||||
/// <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)
|
||||
{
|
||||
TKGDebugger.LogDebug("[TKGSDKNative] logEvent : " + _eventSort + " , _key : " + _key + " , _value : " + _value);
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
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)
|
||||
{
|
||||
TKGDebugger.LogDebug("[TKGSDKNative] logEvent : " + _eventSort + " , _key01 : " + _key01 + " , _value01 : " + _value01 + " , _key2 : " + _key02 + " , _value02 : " + _value02);
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
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)
|
||||
{
|
||||
TKGDebugger.LogDebug("[TKGSDKNative] logEvent : " + _eventSort + " , _eventDic.count : " + _eventDic.Count);
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
TKGNativeInterface.Instance.onEvent(_eventSort, _eventDic);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Level Event
|
||||
|
||||
/// <summary>
|
||||
/// Notify game start
|
||||
/// </summary>
|
||||
/// <param name="_level"></param>
|
||||
public void LevelStart(int _level)
|
||||
{
|
||||
TKGDebugger.LogDebug("[TKGSDKNative] LevelStart _level : " + _level);
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
TKGNativeInterface.Instance.LevelStart(_level.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Notify game start
|
||||
/// </summary>
|
||||
/// <param name="_level"></param>
|
||||
public void LevelStart(string _level)
|
||||
{
|
||||
TKGDebugger.LogDebug("[TKGSDKNative] LevelStart _level : " + _level);
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
TKGNativeInterface.Instance.LevelStart(_level);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Notify game end
|
||||
/// </summary>
|
||||
/// <param name="_level"></param>
|
||||
/// <param name="_stageResult"></param>
|
||||
public bool LevelEnd(int _level, StageResult _stageResult)
|
||||
{
|
||||
TKGDebugger.LogDebug("[TKGSDKNative] LevelEnd _level : " + _level + " , _stageResult : " + _stageResult);
|
||||
#if UNITY_EDITOR
|
||||
return true;
|
||||
#endif
|
||||
TKGNativeInterface.Instance.LevelEnd(_level.ToString(), _stageResult);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Notify game end
|
||||
/// </summary>
|
||||
/// <param name="_level"></param>
|
||||
/// <param name="_stageResult"></param>
|
||||
public bool LevelEnd(string _level, StageResult _stageResult)
|
||||
{
|
||||
TKGDebugger.LogDebug("[TKGSDKNative] LevelEnd _level : " + _level + " , _win : " + _stageResult);
|
||||
#if UNITY_EDITOR
|
||||
return true;
|
||||
#endif
|
||||
TKGNativeInterface.Instance.LevelEnd(_level, _stageResult);
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Reward Ad Button Show
|
||||
|
||||
/// <summary>
|
||||
/// Log Reward ad button show
|
||||
/// </summary>
|
||||
/// <param name="_pos"></param>
|
||||
public void LogRewardAdBtnShow(string _pos)
|
||||
{
|
||||
TKGDebugger.LogDebug("[TKGSDKNative] LogRewardAdBtnShow _pos : " + _pos);
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
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)
|
||||
{
|
||||
TKGDebugger.LogDebug("[TKGSDKNative] LogTrackingEvent _eventType : " + _eventType);
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
TKGNativeInterface.Instance.LogTrackingEvent(_eventType);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Online Config
|
||||
|
||||
/// <summary>
|
||||
/// get config - string
|
||||
/// </summary>
|
||||
/// <param name="_key"></param>
|
||||
/// <returns></returns>
|
||||
public string GetConfigStr(string _key)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
return GetConfigDefaultValue(_key);
|
||||
#endif
|
||||
string tempOnline = TKGNativeInterface.Instance.GetConfigString(_key, GetConfigDefaultValue(_key));
|
||||
TKGDebugger.LogDebug("[TKGSDKNative] tempOnline , _key : " + _key + " , tempOnline : " + tempOnline);
|
||||
return tempOnline;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get config - int
|
||||
/// </summary>
|
||||
/// <param name="_key"></param>
|
||||
/// <returns></returns>
|
||||
public int GetConfigInt(string _key)
|
||||
{
|
||||
string tDefaultValue = GetConfigDefaultValue(_key);
|
||||
|
||||
#if UNITY_EDITOR
|
||||
|
||||
if (int.TryParse(tDefaultValue, out int tIntVal))
|
||||
{
|
||||
return tIntVal;
|
||||
}
|
||||
TKGDebugger.LogDebug("[TKGSDKNative]");
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
int defaultInt = 0;
|
||||
int.TryParse(tDefaultValue, out defaultInt);
|
||||
|
||||
int tempInt = TKGNativeInterface.Instance.GetConfigInt(_key, defaultInt);
|
||||
TKGDebugger.LogDebug("[TKGSDKNative] GetConfigInt , _key : " + _key + " , tempInt : " + tempInt);
|
||||
return tempInt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get config - bool
|
||||
/// </summary>
|
||||
/// <param name="_key"></param>
|
||||
/// <returns></returns>
|
||||
public bool GetConfigBool(string _key)
|
||||
{
|
||||
string tDefaultValue = GetConfigDefaultValue(_key);
|
||||
#if UNITY_EDITOR
|
||||
if (int.TryParse(tDefaultValue, out int tIntVal))
|
||||
{
|
||||
return tIntVal != 0;
|
||||
}
|
||||
TKGDebugger.LogDebug("[TKGSDKNative]");
|
||||
|
||||
return false;
|
||||
#endif
|
||||
|
||||
int defaultInt = 0;
|
||||
int.TryParse(tDefaultValue, out defaultInt);
|
||||
|
||||
bool tBoolValue = TKGNativeInterface.Instance.GetConfigBool(_key, defaultInt != 0);
|
||||
TKGDebugger.LogDebug("[TKGSDKNative] GetConfigBool , _key : " + _key + " , tBoolValue : " + tBoolValue);
|
||||
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()
|
||||
{
|
||||
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
|
||||
TKGNativeInterface.Instance.Review();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// open privacy url
|
||||
/// </summary>
|
||||
public void OpenPrivacyURL()
|
||||
{
|
||||
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
|
||||
TKGNativeInterface.Instance.OpenPrivacyURL();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// open user term url
|
||||
/// </summary>
|
||||
public void OpenUserTermURL()
|
||||
{
|
||||
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
|
||||
TKGNativeInterface.Instance.OpenUserTermURL();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// open policy pop
|
||||
/// </summary>
|
||||
public void OpenPolicyPop()
|
||||
{
|
||||
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
|
||||
TKGNativeInterface.Instance.OpenPolicyPop();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// open more game
|
||||
/// </summary>
|
||||
public void OpenMoreGame()
|
||||
{
|
||||
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
|
||||
TKGNativeInterface.Instance.OpenMoreGame();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// open url browser
|
||||
/// </summary>
|
||||
/// <param name="_url"></param>
|
||||
public void OpenUrlByBrowser(string _url)
|
||||
{
|
||||
TKGDebugger.LogDebug("[TKGSDKNative] OpenUrlByBrowser");
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
TKGUtils.OpenBrowserUrl(_url);
|
||||
}
|
||||
|
||||
|
||||
/// <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)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
TKGNativeInterface.Instance.shake(_shakeType, _intensity);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region others(uncommon)
|
||||
|
||||
/// <summary>
|
||||
/// SetUserSourceListener
|
||||
/// </summary>
|
||||
/// <param name="_userSourceAction"></param>
|
||||
public void SetUserSourceListener(Action<bool, string> _userSourceAction)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
TKGSDKCallback.mTKGUserSourceCallback = _userSourceAction;
|
||||
TKGNativeInterface.Instance.SetUserSourceCallback(new AndroidTKGUserSourceCalllback());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set TKG Common callback
|
||||
/// </summary>
|
||||
/// <param name="_commonCallback"></param>
|
||||
public void SetTKGCommonCallback(Action<CommonCallbackCode, string> _commonCallback)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
TKGSDKCallback.mTKGCommonCallback = _commonCallback;
|
||||
TKGNativeInterface.Instance.SetSDKCommonCallback(new AndroidTKGCommonCalllback());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set log enable
|
||||
/// </summary>
|
||||
public void SetLogEnable(bool _enable)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
TKGNativeInterface.Instance.SetLogEnable(_enable);
|
||||
}
|
||||
/// <summary>
|
||||
/// share txt
|
||||
/// </summary>
|
||||
public void ShareTxt(string _shareTxt)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
#if UNITY_ANDROID
|
||||
TKGNativeInterface.Instance.ShareTxt(_shareTxt);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <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
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1b56a352663e54b7da21c98ee4f04919
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,45 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
namespace Touka
|
||||
{
|
||||
/// <summary>
|
||||
/// 单例类
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public class TKGSingleton<T> : MonoBehaviour where T : MonoBehaviour
|
||||
{
|
||||
private static T _instance;
|
||||
|
||||
public static T Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (null == _instance)
|
||||
{
|
||||
_instance = Object.FindObjectOfType(typeof(T)) as T;
|
||||
if (null != _instance) return _instance;
|
||||
|
||||
GameObject container = new GameObject
|
||||
{
|
||||
name = typeof(T).ToString()
|
||||
};
|
||||
container.hideFlags = HideFlags.HideInHierarchy;
|
||||
_instance = container.AddComponent(typeof(T)) as T;
|
||||
Object.DontDestroyOnLoad(container);
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
OnInstanceCreate();
|
||||
}
|
||||
|
||||
protected virtual void OnInstanceCreate()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: da622b24dd1d24cfe97ee17033dd2cb0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,24 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Touka
|
||||
{
|
||||
public static class TKGStringConst
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static class TKGStringEvent
|
||||
{
|
||||
public const string Event_Sort_TKGInner_ad_button_show = "ad_button_show"; // ad button show
|
||||
public const string Event_Type_TKGInner_ad_position = "ad_position"; // ad position
|
||||
|
||||
}
|
||||
|
||||
public static class TKGStringPlayerPrefs
|
||||
{
|
||||
public const string TOUKA_PREFIX = "Touka_";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1c289d50c594c4d34864ee763e184865
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d9516873035bb45598c991827ce79e3b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,90 @@
|
|||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System.Runtime.InteropServices;
|
||||
using System;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
||||
public class TGUniversalFunc : MonoBehaviour {
|
||||
|
||||
//banner
|
||||
public static Action onSetBannerListener_onAdLoaded;
|
||||
|
||||
public static Action onSetBannerListener_onAdFailedToLoad;
|
||||
|
||||
public static Action onSetBannerListener_onShowSuccess;
|
||||
|
||||
public static Action onSetBannerListener_onClick;
|
||||
|
||||
public static Action onSetBannerListener_onAdClosed;
|
||||
|
||||
//interstitial
|
||||
public static Action onSetInterstitialListener_onAdLoaded;
|
||||
|
||||
public static Action onSetInterstitialListener_onAdFailedToLoad;
|
||||
|
||||
public static Action onSetInterstitialListener_onShowSuccess;
|
||||
|
||||
public static Action onSetInterstitialListener_onShowFailed;
|
||||
|
||||
public static Action onSetInterstitialListener_onAdClosed;
|
||||
|
||||
public static Action onSetInterstitialListener_onClick;
|
||||
|
||||
public static Action onSetIntersititalAdsEndPlaying;
|
||||
|
||||
public static Action onSetInterstitialListener_onFailedToPlay;
|
||||
|
||||
public static Action onSetInterstitialListener_onStartPlayVideo;
|
||||
|
||||
public static Action onSetInterstitialListener_onEndPlaying;
|
||||
|
||||
//Native
|
||||
public static Action onSetNativeListener_onAdLoaded;
|
||||
|
||||
public static Action onSetNativeListener_onAdFailedToLoad;
|
||||
|
||||
public static Action onSetNativeListener_onClick;
|
||||
|
||||
public static Action onSetNativeListener_onShowSuccess;
|
||||
|
||||
//reward
|
||||
public static Action onSetRewardListener_onRewardedVideoAdLoaded;
|
||||
|
||||
public static Action onSetRewardListener_onRewardedVideoAdFailedToLoad;
|
||||
|
||||
public static Action onSetRewardListener_onRewardedVideoStarted;
|
||||
|
||||
public static Action<string> onSetRewardListener_onRewardedVideoAdClosed;
|
||||
|
||||
public static Action onSetRewardListener_onRewardedVideoClickAd;
|
||||
|
||||
public static Action onSetRewardListener_onRewardedVideoAdEnd;
|
||||
|
||||
public static Action onSetRewardListener_onRewardedVideoAdPlayFail;
|
||||
|
||||
public static Action onSetRewardListener_onRewarded;
|
||||
|
||||
|
||||
//splash
|
||||
public static Action onSetSplashListener_onAdLoaded;
|
||||
|
||||
public static Action onSetSplashListener_onAdLoadFail;
|
||||
|
||||
public static Action onSetSplashListener_onAdDidShow;
|
||||
|
||||
public static Action onSetSplashListener_onAdDidClick;
|
||||
|
||||
public static Action onSetSplashListener_onAdDidClose;
|
||||
|
||||
//native banner
|
||||
public static Action onSetNativeBannerListener_onAdLoaded;
|
||||
|
||||
public static Action onSetNativeBannerListener_onAdLoadFail;
|
||||
|
||||
|
||||
// User Source
|
||||
public static Action<string> onSetUserSourceListener_onSuccess;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7afbc8428cb074050bc3b66567a276f9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,570 @@
|
|||
#if UNITY_IOS
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System.Runtime.InteropServices;
|
||||
using System;
|
||||
using Touka;
|
||||
using System.Text;
|
||||
|
||||
public class TGiOSAdManager : MonoBehaviour
|
||||
{
|
||||
|
||||
private static TGiOSAdManager s_instance;
|
||||
|
||||
public Action onAntiSuccessHander;
|
||||
private System.Action<bool, string> m_userSourceCallback;
|
||||
|
||||
public static TGiOSAdManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_instance == null)
|
||||
{
|
||||
GameObject TGGameObject = new GameObject
|
||||
{
|
||||
name = "AdObject"
|
||||
};
|
||||
s_instance = TGGameObject.AddComponent<TGiOSAdManager>();
|
||||
DontDestroyOnLoad(TGGameObject);
|
||||
}
|
||||
return s_instance;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void InitSDK()
|
||||
{
|
||||
// 暂停恢复声音
|
||||
pauseGameDelegate handler = new pauseGameDelegate(pauseGameHandle);
|
||||
IntPtr pauseGame = Marshal.GetFunctionPointerForDelegate(handler);
|
||||
pauseGameCallback(pauseGame);
|
||||
|
||||
// 初始化设置
|
||||
initSDKDelegate inithandler = new initSDKDelegate(initSDKHandle);
|
||||
IntPtr initSdk = Marshal.GetFunctionPointerForDelegate(inithandler);
|
||||
initSDKCallback(initSdk);
|
||||
|
||||
// 用户来源设置
|
||||
TKG_UsersourceDelegate usHandler = new TKG_UsersourceDelegate(userSourceHandle);
|
||||
IntPtr us = Marshal.GetFunctionPointerForDelegate(usHandler);
|
||||
userSourceCallback(us);
|
||||
|
||||
// rv close
|
||||
rewardCloseDelegate rvCloseHandler = new rewardCloseDelegate(rewardAdCloseHandle);
|
||||
IntPtr rewardClose = Marshal.GetFunctionPointerForDelegate(rvCloseHandler);
|
||||
rewardAdCloseCallback(rewardClose);
|
||||
|
||||
// show fail
|
||||
rewardShowFailDelegate rvfailHandler = new rewardShowFailDelegate(rewardAdShowFailHandle);
|
||||
IntPtr rewardShowFail = Marshal.GetFunctionPointerForDelegate(rvfailHandler);
|
||||
rewardAdShowFailCallback(rewardShowFail);
|
||||
|
||||
// iv close
|
||||
interCloseDelegate ivCloseHandler = new interCloseDelegate(interAdCloseHandle);
|
||||
IntPtr interClose = Marshal.GetFunctionPointerForDelegate(ivCloseHandler);
|
||||
interAdCloseCallback(interClose);
|
||||
|
||||
// rv click
|
||||
rewardClickDelegate rvClickHandler = new rewardClickDelegate(rewardAdClickHandle);
|
||||
IntPtr rvClick = Marshal.GetFunctionPointerForDelegate(rvClickHandler);
|
||||
rewardAdClickCallback(rvClick);
|
||||
|
||||
TKG_InitSDK();
|
||||
|
||||
}
|
||||
|
||||
// 通知
|
||||
public void registAPNS()
|
||||
{
|
||||
TKG_RegistAPNS();
|
||||
}
|
||||
|
||||
public void registNotification(string notiId, string body, string fireDate, int badge, string title, string subTitle)
|
||||
{
|
||||
TKG_RegistNotification(notiId,body,fireDate,badge,title,subTitle);
|
||||
}
|
||||
|
||||
public void removeNotification(string notiId)
|
||||
{
|
||||
TKG_RemoveNotification(notiId);
|
||||
}
|
||||
|
||||
public void removeAllNotifications()
|
||||
{
|
||||
TKG_RemoveAllNotification();
|
||||
}
|
||||
// 震动
|
||||
public void shake(int mType, float mIntensity = 1)
|
||||
{
|
||||
TKG_Shake(mType,mIntensity);
|
||||
}
|
||||
|
||||
// ads
|
||||
|
||||
public void RemoveAllAds()
|
||||
{
|
||||
TKG_RemoveAds();
|
||||
}
|
||||
|
||||
//banner
|
||||
public void LoadBanner()
|
||||
{
|
||||
TKG_LoadBanner();
|
||||
}
|
||||
|
||||
public bool IsReadyBanner()
|
||||
{
|
||||
return TKG_IsReadyBanner();
|
||||
}
|
||||
|
||||
public void ShowBanner(int align)
|
||||
{
|
||||
TKG_ShowBanner(align);
|
||||
}
|
||||
|
||||
public void HideBanner()
|
||||
{
|
||||
TKG_HideBanner();
|
||||
}
|
||||
|
||||
// iv
|
||||
public void LoadIntersititial()
|
||||
{
|
||||
TKG_LoadIntersititial();
|
||||
}
|
||||
|
||||
public bool IsReadyIntersititial()
|
||||
{
|
||||
return TKG_IsReadyIntersititial();
|
||||
}
|
||||
|
||||
public void ShowIntersititial(string _adPos, int ivType)
|
||||
{
|
||||
TKG_ShowIntersititial(_adPos,ivType);
|
||||
}
|
||||
|
||||
// rv
|
||||
public void LoadRewardVideo()
|
||||
{
|
||||
TKG_LoadRewardVideo();
|
||||
}
|
||||
|
||||
public bool IsReadyRewardVideo()
|
||||
{
|
||||
return TKG_IsReadyRewardVideo();
|
||||
}
|
||||
|
||||
public void ShowRewardVideo(string adPos)
|
||||
{
|
||||
|
||||
TKG_ShowRewardVideo(adPos);
|
||||
}
|
||||
|
||||
// native
|
||||
public void LoadNative(float width, float height)
|
||||
{
|
||||
TKG_LoadNative(width, height);
|
||||
}
|
||||
|
||||
public bool IsReadyNative()
|
||||
{
|
||||
return TKG_IsReadyNative();
|
||||
}
|
||||
|
||||
public void ShowNative(RectTransform pRect, Camera pCam = null, string pAdPos = "")
|
||||
{
|
||||
TKG_TurnNativePosition(pRect, pCam, pAdPos);
|
||||
}
|
||||
|
||||
public void RemoveNative()
|
||||
{
|
||||
TKG_RemoveNative();
|
||||
}
|
||||
|
||||
// other
|
||||
public void Review()
|
||||
{
|
||||
TKG_Review();
|
||||
}
|
||||
|
||||
public void OpenPrivacyURL()
|
||||
{
|
||||
TKG_OpenPrivacyURL();
|
||||
}
|
||||
|
||||
public void OpenUserTermURL()
|
||||
{
|
||||
TKG_OpenUserTermURL();
|
||||
}
|
||||
|
||||
public void OpenPolicyPop()
|
||||
{
|
||||
TKG_OpenPolicyPop();
|
||||
}
|
||||
public void OpenMoreGame()
|
||||
{
|
||||
TKG_OpenMoreGame();
|
||||
}
|
||||
|
||||
|
||||
// 在线参数
|
||||
public int GetConfigInt(string key, int defaultValue)
|
||||
{
|
||||
return TKG_GetConfigInt(key, defaultValue);
|
||||
}
|
||||
|
||||
public string GetConfigString(string key, string defaultValue)
|
||||
{
|
||||
return TKG_GetConfigString(key, defaultValue);
|
||||
}
|
||||
|
||||
public bool GetConfigBool(string key, bool defaultValue)
|
||||
{
|
||||
return TKG_GetConfigBool(key, defaultValue);
|
||||
}
|
||||
|
||||
// 游戏事件上报
|
||||
public void onEvent_GameStart(string levelId)
|
||||
{
|
||||
TKG_OnEvent_GameStart(levelId);
|
||||
}
|
||||
|
||||
public void onEvent_GameEnd(string levelId, int result)
|
||||
{
|
||||
TKG_OnEvent_GameEnd(levelId,result);
|
||||
}
|
||||
|
||||
// umeng 事件上报
|
||||
public void onEvent_UMeng(string eventSort)
|
||||
{
|
||||
TKG_OnEvent_UMeng1(eventSort);
|
||||
}
|
||||
|
||||
public void onEvent_UMeng(string eventSort, Dictionary<string, string> _keyValues)
|
||||
{
|
||||
TKG_OnEvent_UMeng2(eventSort, TKG_DictionaryToJson(_keyValues));
|
||||
}
|
||||
|
||||
public void onEvent_UMeng(string eventSort,string key,string value)
|
||||
{
|
||||
TKG_OnEvent_UMeng3(eventSort,key,value);
|
||||
}
|
||||
|
||||
public void onEvent_UMeng(string eventSort, string key1, string value1,string key2,string value2)
|
||||
{
|
||||
TKG_OnEvent_UMeng4(eventSort, key1, value1,key2,value2);
|
||||
}
|
||||
|
||||
// tenjin事件上报
|
||||
public void onEvent_Tenjin(int eventType)
|
||||
{
|
||||
TKG_OnEvent_Tenjin(eventType);
|
||||
}
|
||||
|
||||
// unity 字典转 json string
|
||||
static string TKG_DictionaryToJson(Dictionary<string, string> dict)
|
||||
{
|
||||
|
||||
var builder = new StringBuilder("{");
|
||||
foreach (KeyValuePair<string, string> kv in dict)
|
||||
{
|
||||
builder.AppendFormat("\"{0}\":\"{1}\",", kv.Key, kv.Value);
|
||||
}
|
||||
builder[builder.Length - 1] = '}';
|
||||
return builder.ToString();
|
||||
}
|
||||
|
||||
// 坐标转换
|
||||
public void TKG_TurnNativePosition(RectTransform pRect, Camera pCam = null, string pAdPos = "")
|
||||
{
|
||||
Vector3[] tWorldCorners = new Vector3[4];
|
||||
pRect.GetWorldCorners(tWorldCorners);
|
||||
|
||||
Vector2 tTopLeft = RectTransformUtility.WorldToScreenPoint(pCam, tWorldCorners[1]);
|
||||
Vector2 tBottomRight = RectTransformUtility.WorldToScreenPoint(pCam, tWorldCorners[3]);
|
||||
float tWidth = Mathf.Abs(tBottomRight.x - tTopLeft.x);
|
||||
float tHeight = Mathf.Abs(tBottomRight.y - tTopLeft.y);
|
||||
//Debug.Log("x:" + tTopLeft.x + "y:" + (Screen.height - tTopLeft.y) + "width" + tWidth + "hei:" + tHeight);
|
||||
|
||||
TKG_ShowNative(tTopLeft.x, Screen.height - tTopLeft.y, tWidth, tHeight, pAdPos);
|
||||
}
|
||||
|
||||
// callback
|
||||
// iv callback
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate void interCloseDelegate();
|
||||
[AOT.MonoPInvokeCallback(typeof(interCloseDelegate))]
|
||||
static void interAdCloseHandle()
|
||||
{
|
||||
if (TKGSDKCallback.mInterAdCallback != null)
|
||||
{
|
||||
TKGSDKCallback.mInterAdCallback.Invoke();
|
||||
TKGSDKCallback.mInterAdCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
// rv close-reward callback
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate void rewardCloseDelegate(bool isReward);
|
||||
[AOT.MonoPInvokeCallback(typeof(rewardCloseDelegate))]
|
||||
static void rewardAdCloseHandle(bool isReward)
|
||||
{
|
||||
if (isReward)
|
||||
{
|
||||
if (TKGSDKCallback.mRewardCallback != null)
|
||||
{
|
||||
TKGSDKCallback.mRewardCallback.Invoke(true);
|
||||
TKGSDKCallback.mRewardCallback = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (TKGSDKCallback.mRewardCallback != null)
|
||||
{
|
||||
TKGSDKCallback.mRewardCallback.Invoke(false);
|
||||
TKGSDKCallback.mRewardCallback = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// rv show fail callback
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate void rewardShowFailDelegate();
|
||||
[AOT.MonoPInvokeCallback(typeof(rewardShowFailDelegate))]
|
||||
static void rewardAdShowFailHandle()
|
||||
{
|
||||
if (TKGSDKCallback.mRewardShowFailedCallback != null)
|
||||
{
|
||||
TKGSDKCallback.mRewardShowFailedCallback();
|
||||
TKGSDKCallback.mRewardShowFailedCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
// rv click callback
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate void rewardClickDelegate();
|
||||
[AOT.MonoPInvokeCallback(typeof(rewardClickDelegate))]
|
||||
static void rewardAdClickHandle()
|
||||
{
|
||||
if (TKGSDKCallback.mRewardClickCallback != null)
|
||||
{
|
||||
TKGSDKCallback.mRewardClickCallback();
|
||||
}
|
||||
}
|
||||
|
||||
// pause game
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate void pauseGameDelegate(bool m_pause);
|
||||
[AOT.MonoPInvokeCallback(typeof(pauseGameDelegate))]
|
||||
static void pauseGameHandle(bool m_pause)
|
||||
{
|
||||
TKGSDKCallback.mGameFocusCallback?.Invoke(!m_pause);
|
||||
}
|
||||
|
||||
// init sdk
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate void initSDKDelegate();
|
||||
[AOT.MonoPInvokeCallback(typeof(initSDKDelegate))]
|
||||
static void initSDKHandle()
|
||||
{
|
||||
if (TKGSDKCallback.mInitCallback != null)
|
||||
{
|
||||
TKGSDKCallback.mInitCallback();
|
||||
TKGSDKCallback.mInitCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
// user source
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate void TKG_UsersourceDelegate(bool isOrganic,string source);
|
||||
[AOT.MonoPInvokeCallback(typeof(TKG_UsersourceDelegate))]
|
||||
static void userSourceHandle(bool isOrganic, string source)
|
||||
{
|
||||
if (TKGSDKCallback.mTKGUserSourceCallback != null)
|
||||
{
|
||||
TKGSDKCallback.mTKGUserSourceCallback(isOrganic,source);
|
||||
TKGSDKCallback.mTKGUserSourceCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
// dll
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_Shake(int mType, float mIntensity);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_InitSDK();
|
||||
|
||||
// event umeng
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_OnEvent_UMeng1(string s1);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_OnEvent_UMeng2(string s1, string s2);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_OnEvent_UMeng3(string s1, string key, string value);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_OnEvent_UMeng4(string s1, string key1, string value1, string key2, string value2);
|
||||
|
||||
// event tenjin
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_OnEvent_Tenjin(int eventType);
|
||||
|
||||
// event game
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_OnEvent_GameStart(string levelId);
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_OnEvent_GameEnd(string levelId, int result);
|
||||
|
||||
// other
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_Review();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_OpenPrivacyURL();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_OpenUserTermURL();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_OpenPolicyPop();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_OpenMoreGame();
|
||||
|
||||
// ads
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_LoadBanner();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool TKG_IsReadyBanner();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_ShowBanner(int align);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_HideBanner();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_LoadIntersititial();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool TKG_IsReadyIntersititial();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_ShowIntersititial(string adPos,int ivType);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_LoadRewardVideo();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool TKG_IsReadyRewardVideo();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_ShowRewardVideo(string adPos);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_LoadNative(float width, float height);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool TKG_IsReadyNative();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_ShowNative(float x, float y, float w, float h, string adPos);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_RemoveNative();
|
||||
|
||||
// remote config
|
||||
[DllImport("__Internal")]
|
||||
private static extern int TKG_GetConfigInt(string key, int defaultValue);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern string TKG_GetConfigString(string key, string defaultValue);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool TKG_GetConfigBool(string key, bool defaultValue);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool TKG_SetLogged(bool enable);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern bool TKG_RemoveAds();
|
||||
|
||||
// callback
|
||||
// iv close
|
||||
[DllImport("__Internal")]
|
||||
public static extern void interAdCloseCallback(
|
||||
IntPtr interClose
|
||||
);
|
||||
|
||||
// rv close
|
||||
[DllImport("__Internal")]
|
||||
public static extern void rewardAdCloseCallback(
|
||||
IntPtr rewardClose
|
||||
);
|
||||
|
||||
// rv click
|
||||
[DllImport("__Internal")]
|
||||
public static extern void rewardAdClickCallback(
|
||||
IntPtr rewardClick
|
||||
);
|
||||
|
||||
// rv show fail
|
||||
[DllImport("__Internal")]
|
||||
public static extern void rewardAdShowFailCallback(
|
||||
IntPtr rewardShowFail
|
||||
);
|
||||
|
||||
// pause game
|
||||
[DllImport("__Internal")]
|
||||
public static extern void pauseGameCallback(
|
||||
IntPtr pauseGame
|
||||
);
|
||||
|
||||
// init sdk
|
||||
[DllImport("__Internal")]
|
||||
public static extern void initSDKCallback(
|
||||
IntPtr initSdk
|
||||
);
|
||||
|
||||
// user source
|
||||
[DllImport("__Internal")]
|
||||
public static extern void userSourceCallback(
|
||||
IntPtr userSource
|
||||
);
|
||||
|
||||
// 设置unity版本
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_SetUnityVersion(string version);
|
||||
|
||||
// 通知
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_RegistAPNS();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_RemoveAllNotification();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_RemoveNotification(string notiId);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
private static extern void TKG_RegistNotification(string notiId, string body, string fireDate, int badge, string title, string subTitle);
|
||||
|
||||
// ============================ old sdk todo ========================
|
||||
|
||||
//设置log开关
|
||||
public void SetLogEnable(bool enable)
|
||||
{
|
||||
TKG_SetLogged(enable);
|
||||
}
|
||||
|
||||
public void SetUnitySDKVersion(string version)
|
||||
{
|
||||
TKG_SetUnityVersion(version);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c4796c003fbf746869238b54b37eab3b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6fb27b1d36bb84b9784a282b702a3ce0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,79 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Touka
|
||||
{
|
||||
public class ConfigKeys
|
||||
{
|
||||
#region App info
|
||||
|
||||
// app name
|
||||
public const string KEY_AppName = "app_name";
|
||||
// bundle id
|
||||
public const string KEY_BunldId = "package_name";
|
||||
|
||||
#endregion
|
||||
|
||||
#region Analytics
|
||||
// umeng
|
||||
public const string KEY_UMENG_APPKEY = "um_app_key";
|
||||
public const string KEY_UMENG_CHANNELID = "channel";
|
||||
|
||||
// ga
|
||||
public const string KEY_GA_gameKey = "ga_key";
|
||||
public const string KEY_GA_secretKey = "ga_secretkey";
|
||||
|
||||
// tenjin
|
||||
public const string KEY_TENJIN_KEY = "tenjin_api_key";
|
||||
|
||||
#endregion
|
||||
|
||||
#region Ads
|
||||
|
||||
// admob id
|
||||
public const string KEY_Admob_AppID = "admob_id";
|
||||
|
||||
// app id
|
||||
public const string KEY_TOUKA_SDK_APPID = "ad_appid";
|
||||
// app key
|
||||
public const string KEY_TOUKA_SDK_APPKEY = "ad_appkey";
|
||||
|
||||
// iv id
|
||||
public const string KEY_TOUKA_SDK_INTERID = "ad_interstital_id";
|
||||
// rv id
|
||||
public const string KEY_TOUKA_SDK_REWARDID = "ad_reward_id";
|
||||
// splash id
|
||||
public const string KEY_TOUKA_SDK_SPLASHID = "ad_splash_id";
|
||||
|
||||
// template native id // iOS use
|
||||
public const string KEY_TOUKA_SDK_NATIVEID = "ad_templete_natvie_id";
|
||||
// render native id
|
||||
public const string KEY_TOUKA_SDK_RENDERNATIVEID = "ad_render_native_id";
|
||||
// banner id
|
||||
public const string KEY_TOUKA_SDK_BANNERID = "ad_banner_id";
|
||||
// native banner id
|
||||
public const string KEY_TOUKA_SDK_NATIVEBANNERID = "ad_native_banner_id";
|
||||
// native splash id
|
||||
public const string KEY_TOUKA_SDK_NATIVESPLASHID = "ad_native_splash_id";
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Basic Config
|
||||
// PlayerAge
|
||||
public const string KEY_PlayerAge = "tka_age";
|
||||
// GameTheme
|
||||
public const string KEY_GameTheme = "tka_theme";
|
||||
// privacy url
|
||||
public const string KEY_PrivacyURL = "tka_url_privacy";
|
||||
// agreement url
|
||||
public const string KEY_AgreementURL = "tka_url_agreement";
|
||||
// more game url
|
||||
public const string KEY_MoreGameURL = "tka_url_moregame";
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f6f1983a87ac847b694ceaea128c3867
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8dbadde55b7344be28aa3c3093247c8f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,58 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
namespace Touka
|
||||
{
|
||||
public class TKGFileTools
|
||||
{
|
||||
/// <summary>
|
||||
/// 通过UnityWebRequest获取本地StreamingAssets文件夹中的文件
|
||||
///
|
||||
/// only for android .properties
|
||||
/// </summary>
|
||||
/// <param name="fileName">文件名称</param>
|
||||
/// <returns></returns>
|
||||
public static string UnityWebRequestFile(string fileName)
|
||||
{
|
||||
string url = GetFileURL(fileName);
|
||||
TKGDebugger.LogError("Warning: If an exception occurs, check whether the 「Assets/StreamingAssets/Configs/tkg_config.properties」 file exists : " + url);
|
||||
UnityWebRequest request = UnityWebRequest.Get(url);
|
||||
request.SendWebRequest();//读取数据
|
||||
while (true)
|
||||
{
|
||||
if (request.downloadHandler.isDone)//是否读取完数据
|
||||
{
|
||||
return request.downloadHandler.text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get file url
|
||||
/// </summary>
|
||||
/// <param name="fileName"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetFileURL(string fileName)
|
||||
{
|
||||
string url = "";
|
||||
|
||||
#region 分平台判断 StreamingAssets 路径
|
||||
//如果在编译器或者单机中
|
||||
#endregion
|
||||
|
||||
#if UNITY_EDITOR || UNITY_STANDALONE
|
||||
url = "file://" + Application.dataPath + "/StreamingAssets/" + fileName;
|
||||
//否则如果在Iphone下
|
||||
#elif UNITY_IPHONE
|
||||
url = "file://" + Application.dataPath + "/Raw/"+ fileName;
|
||||
//否则如果在android下
|
||||
#elif UNITY_ANDROID
|
||||
url = "jar:file://" + Application.dataPath + "!/assets/"+ fileName;
|
||||
#endif
|
||||
return url;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b3f79e2611bd44fde98da03664dc68ea
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,93 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Touka
|
||||
{
|
||||
public class TKGLoadPlistConfig
|
||||
{
|
||||
static string resourcePath = Application.dataPath;
|
||||
static string extraStr = ".plist";
|
||||
|
||||
public static PlayerPrefPair[] GetToukaConfig( string _configFile , string region)
|
||||
{
|
||||
return GetAllFromPlist(resourcePath + "/Configs/"+region+"/" + _configFile + extraStr);
|
||||
}
|
||||
|
||||
public static PlayerPrefPair[] GetAllFromPlist(string _configPath)
|
||||
{
|
||||
if (File.Exists(_configPath))
|
||||
{
|
||||
object plist = TKGPlist.readPlist(_configPath);
|
||||
Dictionary<string, object> parsed = plist as Dictionary<string, object>;
|
||||
|
||||
PlayerPrefPair[] tempPlayerPrefs = new PlayerPrefPair[parsed.Count];
|
||||
int i = 0;
|
||||
foreach (KeyValuePair<string, object> pair in parsed)
|
||||
{
|
||||
if (pair.Value.GetType() == typeof(double))
|
||||
{
|
||||
// Some float values may come back as double, so convert them back to floats
|
||||
tempPlayerPrefs[i] = new PlayerPrefPair() { Key = pair.Key, Value = (float)(double)pair.Value };
|
||||
}
|
||||
else
|
||||
{
|
||||
tempPlayerPrefs[i] = new PlayerPrefPair() { Key = pair.Key, Value = pair.Value };
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
return tempPlayerPrefs;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError(_configPath + " Not Exist!");
|
||||
return new PlayerPrefPair[0];
|
||||
}
|
||||
}
|
||||
|
||||
public static PlayerPrefPair[] GetAllFromXML(string _configPath)
|
||||
{
|
||||
if (File.Exists(resourcePath + _configPath + ".xml"))
|
||||
{
|
||||
TextAsset configText = (TextAsset)Resources.Load(_configPath);
|
||||
|
||||
object plist = TKGPlist.readPlistSource(configText.text);
|
||||
Dictionary<string, object> parsed = plist as Dictionary<string, object>;
|
||||
|
||||
PlayerPrefPair[] tempPlayerPrefs = new PlayerPrefPair[parsed.Count];
|
||||
int i = 0;
|
||||
foreach (KeyValuePair<string, object> pair in parsed)
|
||||
{
|
||||
if (pair.Value.GetType() == typeof(double))
|
||||
{
|
||||
// Some float values may come back as double, so convert them back to floats
|
||||
tempPlayerPrefs[i] = new PlayerPrefPair() { Key = pair.Key, Value = (float)(double)pair.Value };
|
||||
}
|
||||
else
|
||||
{
|
||||
tempPlayerPrefs[i] = new PlayerPrefPair() { Key = pair.Key, Value = pair.Value };
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
return tempPlayerPrefs;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError(_configPath + " Not Exist!");
|
||||
return new PlayerPrefPair[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public struct PlayerPrefPair
|
||||
{
|
||||
public string Key { get; set; }
|
||||
|
||||
public object Value { get; set; }
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fc8e0e50a0f134006ba379d27b5e42ea
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,61 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Touka
|
||||
{
|
||||
public class TKGLoadPropertiesConfig : MonoBehaviour
|
||||
{
|
||||
static string resourcePath = Application.dataPath + "/"; // + "Configs/";
|
||||
static string toukaconfigConfigPath = "Configs/";
|
||||
static string toukaconfigPathCN = "CN/";
|
||||
static string toukaconfigPathGB = "GB/";
|
||||
static string toukaConfigFileName = "tkg_config";
|
||||
|
||||
static string extraStr = ".properties";
|
||||
|
||||
public static PlayerPrefPair[] GetToukaConfig(AppChannel _appChannel)
|
||||
{
|
||||
string configpath = "";
|
||||
if(_appChannel == AppChannel.GooglePlay)
|
||||
{
|
||||
configpath = toukaconfigPathGB;
|
||||
}
|
||||
else
|
||||
{
|
||||
configpath = toukaconfigPathCN;
|
||||
}
|
||||
|
||||
return GetAllFromProperties(toukaconfigConfigPath + configpath + toukaConfigFileName + extraStr);
|
||||
}
|
||||
|
||||
public static PlayerPrefPair[] GetAllFromProperties(string _configPath)
|
||||
{
|
||||
string path = resourcePath + _configPath;
|
||||
TKGDebugger.LogDebug("GetAllFromProperties path : " + path + " , _configPath : " + _configPath);
|
||||
|
||||
Hashtable ht = TKGProperties.Load(path);
|
||||
if(ht.Count > 0)
|
||||
{
|
||||
PlayerPrefPair[] tempPlayerPrefs = new PlayerPrefPair[ht.Count];
|
||||
int i = 0;
|
||||
foreach (string key in ht.Keys)
|
||||
{
|
||||
tempPlayerPrefs[i] = new PlayerPrefPair() { Key = key, Value = ht[key] };
|
||||
i++;
|
||||
}
|
||||
|
||||
return tempPlayerPrefs;
|
||||
}
|
||||
else
|
||||
{
|
||||
TKGDebugger.LogDebug("Config is null, path : " + path);
|
||||
return new PlayerPrefPair[0];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1033ac15a5e2645579fa3e884ef3db23
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,961 @@
|
|||
//
|
||||
// PlistCS Property List (plist) serialization and parsing library.
|
||||
//
|
||||
// https://github.com/animetrics/PlistCS
|
||||
//
|
||||
// Copyright (c) 2011 Animetrics Inc. (marc@animetrics.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
|
||||
namespace Touka
|
||||
{
|
||||
public static class TKGPlist
|
||||
{
|
||||
private static List<int> offsetTable = new List<int>();
|
||||
private static List<byte> objectTable = new List<byte>();
|
||||
private static int refCount;
|
||||
private static int objRefSize;
|
||||
private static int offsetByteSize;
|
||||
private static long offsetTableOffset;
|
||||
|
||||
#region Public Functions
|
||||
|
||||
public static object readPlist(string path)
|
||||
{
|
||||
using (FileStream f = new FileStream(path, FileMode.Open, FileAccess.Read))
|
||||
{
|
||||
return readPlist(f, plistType.Auto);
|
||||
}
|
||||
}
|
||||
|
||||
public static object readPlistSource(string source)
|
||||
{
|
||||
return readPlist(System.Text.Encoding.UTF8.GetBytes(source));
|
||||
}
|
||||
|
||||
public static object readPlist(byte[] data)
|
||||
{
|
||||
return readPlist(new MemoryStream(data), plistType.Auto);
|
||||
}
|
||||
|
||||
public static plistType getPlistType(Stream stream)
|
||||
{
|
||||
byte[] magicHeader = new byte[8];
|
||||
stream.Read(magicHeader, 0, 8);
|
||||
|
||||
if (BitConverter.ToInt64(magicHeader, 0) == 3472403351741427810)
|
||||
{
|
||||
return plistType.Binary;
|
||||
}
|
||||
else
|
||||
{
|
||||
return plistType.Xml;
|
||||
}
|
||||
}
|
||||
|
||||
public static object readPlist(Stream stream, plistType type)
|
||||
{
|
||||
if (type == plistType.Auto)
|
||||
{
|
||||
type = getPlistType(stream);
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
}
|
||||
|
||||
if (type == plistType.Binary)
|
||||
{
|
||||
using (BinaryReader reader = new BinaryReader(stream))
|
||||
{
|
||||
byte[] data = reader.ReadBytes((int) reader.BaseStream.Length);
|
||||
return readBinary(data);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
XmlDocument xml = new XmlDocument();
|
||||
xml.XmlResolver = null;
|
||||
xml.Load(stream);
|
||||
return readXml(xml);
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeXml(object value, string path)
|
||||
{
|
||||
using (StreamWriter writer = new StreamWriter(path))
|
||||
{
|
||||
writer.Write(writeXml(value));
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeXml(object value, Stream stream)
|
||||
{
|
||||
using (StreamWriter writer = new StreamWriter(stream))
|
||||
{
|
||||
writer.Write(writeXml(value));
|
||||
}
|
||||
}
|
||||
|
||||
public static string writeXml(object value)
|
||||
{
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
XmlWriterSettings xmlWriterSettings = new XmlWriterSettings();
|
||||
xmlWriterSettings.Encoding = new System.Text.UTF8Encoding(false);
|
||||
xmlWriterSettings.ConformanceLevel = ConformanceLevel.Document;
|
||||
xmlWriterSettings.Indent = true;
|
||||
|
||||
using (XmlWriter xmlWriter = XmlWriter.Create(ms, xmlWriterSettings))
|
||||
{
|
||||
xmlWriter.WriteStartDocument();
|
||||
//xmlWriter.WriteComment("DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" " + "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"");
|
||||
xmlWriter.WriteDocType("plist", "-//Apple Computer//DTD PLIST 1.0//EN", "http://www.apple.com/DTDs/PropertyList-1.0.dtd", null);
|
||||
xmlWriter.WriteStartElement("plist");
|
||||
xmlWriter.WriteAttributeString("version", "1.0");
|
||||
compose(value, xmlWriter);
|
||||
xmlWriter.WriteEndElement();
|
||||
xmlWriter.WriteEndDocument();
|
||||
xmlWriter.Flush();
|
||||
xmlWriter.Close();
|
||||
return System.Text.Encoding.UTF8.GetString(ms.ToArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeBinary(object value, string path)
|
||||
{
|
||||
using (BinaryWriter writer = new BinaryWriter(new FileStream(path, FileMode.Create)))
|
||||
{
|
||||
writer.Write(writeBinary(value));
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeBinary(object value, Stream stream)
|
||||
{
|
||||
using (BinaryWriter writer = new BinaryWriter(stream))
|
||||
{
|
||||
writer.Write(writeBinary(value));
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] writeBinary(object value)
|
||||
{
|
||||
offsetTable.Clear();
|
||||
objectTable.Clear();
|
||||
refCount = 0;
|
||||
objRefSize = 0;
|
||||
offsetByteSize = 0;
|
||||
offsetTableOffset = 0;
|
||||
|
||||
//Do not count the root node, subtract by 1
|
||||
int totalRefs = countObject(value) - 1;
|
||||
|
||||
refCount = totalRefs;
|
||||
|
||||
objRefSize = RegulateNullBytes(BitConverter.GetBytes(refCount)).Length;
|
||||
|
||||
composeBinary(value);
|
||||
|
||||
writeBinaryString("bplist00", false);
|
||||
|
||||
offsetTableOffset = (long)objectTable.Count;
|
||||
|
||||
offsetTable.Add(objectTable.Count - 8);
|
||||
|
||||
offsetByteSize = RegulateNullBytes(BitConverter.GetBytes(offsetTable[offsetTable.Count-1])).Length;
|
||||
|
||||
List<byte> offsetBytes = new List<byte>();
|
||||
|
||||
offsetTable.Reverse();
|
||||
|
||||
for (int i = 0; i < offsetTable.Count; i++)
|
||||
{
|
||||
offsetTable[i] = objectTable.Count - offsetTable[i];
|
||||
byte[] buffer = RegulateNullBytes(BitConverter.GetBytes(offsetTable[i]), offsetByteSize);
|
||||
Array.Reverse(buffer);
|
||||
offsetBytes.AddRange(buffer);
|
||||
}
|
||||
|
||||
objectTable.AddRange(offsetBytes);
|
||||
|
||||
objectTable.AddRange(new byte[6]);
|
||||
objectTable.Add(Convert.ToByte(offsetByteSize));
|
||||
objectTable.Add(Convert.ToByte(objRefSize));
|
||||
|
||||
var a = BitConverter.GetBytes((long) totalRefs + 1);
|
||||
Array.Reverse(a);
|
||||
objectTable.AddRange(a);
|
||||
|
||||
objectTable.AddRange(BitConverter.GetBytes((long)0));
|
||||
a = BitConverter.GetBytes(offsetTableOffset);
|
||||
Array.Reverse(a);
|
||||
objectTable.AddRange(a);
|
||||
|
||||
return objectTable.ToArray();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Functions
|
||||
|
||||
private static object readXml(XmlDocument xml)
|
||||
{
|
||||
XmlNode rootNode = xml.DocumentElement.ChildNodes[0];
|
||||
return parse(rootNode);
|
||||
}
|
||||
|
||||
private static object readBinary(byte[] data)
|
||||
{
|
||||
offsetTable.Clear();
|
||||
List<byte> offsetTableBytes = new List<byte>();
|
||||
objectTable.Clear();
|
||||
refCount = 0;
|
||||
objRefSize = 0;
|
||||
offsetByteSize = 0;
|
||||
offsetTableOffset = 0;
|
||||
|
||||
List<byte> bList = new List<byte>(data);
|
||||
|
||||
List<byte> trailer = bList.GetRange(bList.Count - 32, 32);
|
||||
|
||||
parseTrailer(trailer);
|
||||
|
||||
objectTable = bList.GetRange(0, (int)offsetTableOffset);
|
||||
|
||||
offsetTableBytes = bList.GetRange((int)offsetTableOffset, bList.Count - (int)offsetTableOffset - 32);
|
||||
|
||||
parseOffsetTable(offsetTableBytes);
|
||||
|
||||
return parseBinary(0);
|
||||
}
|
||||
|
||||
private static Dictionary<string, object> parseDictionary(XmlNode node)
|
||||
{
|
||||
XmlNodeList children = node.ChildNodes;
|
||||
if (children.Count % 2 != 0)
|
||||
{
|
||||
throw new DataMisalignedException("Dictionary elements must have an even number of child nodes");
|
||||
}
|
||||
|
||||
Dictionary<string, object> dict = new Dictionary<string, object>();
|
||||
|
||||
for (int i = 0; i < children.Count; i += 2)
|
||||
{
|
||||
XmlNode keynode = children[i];
|
||||
XmlNode valnode = children[i + 1];
|
||||
|
||||
if (keynode.Name != "key")
|
||||
{
|
||||
throw new ApplicationException("expected a key node");
|
||||
}
|
||||
|
||||
object result = parse(valnode);
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
dict.Add(keynode.InnerText, result);
|
||||
}
|
||||
}
|
||||
|
||||
return dict;
|
||||
}
|
||||
|
||||
private static List<object> parseArray(XmlNode node)
|
||||
{
|
||||
List<object> array = new List<object>();
|
||||
|
||||
foreach (XmlNode child in node.ChildNodes)
|
||||
{
|
||||
object result = parse(child);
|
||||
if (result != null)
|
||||
{
|
||||
array.Add(result);
|
||||
}
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
private static void composeArray(List<object> value, XmlWriter writer)
|
||||
{
|
||||
writer.WriteStartElement("array");
|
||||
foreach (object obj in value)
|
||||
{
|
||||
compose(obj, writer);
|
||||
}
|
||||
writer.WriteEndElement();
|
||||
}
|
||||
|
||||
private static object parse(XmlNode node)
|
||||
{
|
||||
switch (node.Name)
|
||||
{
|
||||
case "dict":
|
||||
return parseDictionary(node);
|
||||
case "array":
|
||||
return parseArray(node);
|
||||
case "string":
|
||||
return node.InnerText;
|
||||
case "integer":
|
||||
// int result;
|
||||
//int.TryParse(node.InnerText, System.Globalization.NumberFormatInfo.InvariantInfo, out result);
|
||||
return Convert.ToInt32(node.InnerText, System.Globalization.NumberFormatInfo.InvariantInfo);
|
||||
case "real":
|
||||
return Convert.ToDouble(node.InnerText,System.Globalization.NumberFormatInfo.InvariantInfo);
|
||||
case "false":
|
||||
return false;
|
||||
case "true":
|
||||
return true;
|
||||
case "null":
|
||||
return null;
|
||||
case "date":
|
||||
return XmlConvert.ToDateTime(node.InnerText, XmlDateTimeSerializationMode.Utc);
|
||||
case "data":
|
||||
return Convert.FromBase64String(node.InnerText);
|
||||
}
|
||||
|
||||
throw new ApplicationException(String.Format("Plist Node `{0}' is not supported", node.Name));
|
||||
}
|
||||
|
||||
private static void compose(object value, XmlWriter writer)
|
||||
{
|
||||
|
||||
if (value == null || value is string)
|
||||
{
|
||||
writer.WriteElementString("string", value as string);
|
||||
}
|
||||
else if (value is int || value is long)
|
||||
{
|
||||
writer.WriteElementString("integer", ((int)value).ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
|
||||
}
|
||||
else if (value is System.Collections.Generic.Dictionary<string, object> ||
|
||||
value.GetType().ToString().StartsWith("System.Collections.Generic.Dictionary`2[System.String"))
|
||||
{
|
||||
//Convert to Dictionary<string, object>
|
||||
Dictionary<string, object> dic = value as Dictionary<string, object>;
|
||||
if (dic == null)
|
||||
{
|
||||
dic = new Dictionary<string, object>();
|
||||
IDictionary idic = (IDictionary)value;
|
||||
foreach (var key in idic.Keys)
|
||||
{
|
||||
dic.Add(key.ToString(), idic[key]);
|
||||
}
|
||||
}
|
||||
writeDictionaryValues(dic, writer);
|
||||
}
|
||||
else if (value is List<object>)
|
||||
{
|
||||
composeArray((List<object>)value, writer);
|
||||
}
|
||||
else if (value is byte[])
|
||||
{
|
||||
writer.WriteElementString("data", Convert.ToBase64String((Byte[])value));
|
||||
}
|
||||
else if (value is float || value is double)
|
||||
{
|
||||
writer.WriteElementString("real", ((double)value).ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
|
||||
}
|
||||
else if (value is DateTime)
|
||||
{
|
||||
DateTime time = (DateTime)value;
|
||||
string theString = XmlConvert.ToString(time, XmlDateTimeSerializationMode.Utc);
|
||||
writer.WriteElementString("date", theString);//, "yyyy-MM-ddTHH:mm:ssZ"));
|
||||
}
|
||||
else if (value is bool)
|
||||
{
|
||||
writer.WriteElementString(value.ToString().ToLower(), "");
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(String.Format("Value type '{0}' is unhandled", value.GetType().ToString()));
|
||||
}
|
||||
}
|
||||
|
||||
private static void writeDictionaryValues(Dictionary<string, object> dictionary, XmlWriter writer)
|
||||
{
|
||||
writer.WriteStartElement("dict");
|
||||
foreach (string key in dictionary.Keys)
|
||||
{
|
||||
object value = dictionary[key];
|
||||
writer.WriteElementString("key", key);
|
||||
compose(value, writer);
|
||||
}
|
||||
writer.WriteEndElement();
|
||||
}
|
||||
|
||||
private static int countObject(object value)
|
||||
{
|
||||
int count = 0;
|
||||
switch (value.GetType().ToString())
|
||||
{
|
||||
case "System.Collections.Generic.Dictionary`2[System.String,System.Object]":
|
||||
Dictionary<string, object> dict = (Dictionary<string, object>)value;
|
||||
foreach (string key in dict.Keys)
|
||||
{
|
||||
count += countObject(dict[key]);
|
||||
}
|
||||
count += dict.Keys.Count;
|
||||
count++;
|
||||
break;
|
||||
case "System.Collections.Generic.List`1[System.Object]":
|
||||
List<object> list = (List<object>)value;
|
||||
foreach (object obj in list)
|
||||
{
|
||||
count += countObject(obj);
|
||||
}
|
||||
count++;
|
||||
break;
|
||||
default:
|
||||
count++;
|
||||
break;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
private static byte[] writeBinaryDictionary(Dictionary<string, object> dictionary)
|
||||
{
|
||||
List<byte> buffer = new List<byte>();
|
||||
List<byte> header = new List<byte>();
|
||||
List<int> refs = new List<int>();
|
||||
for (int i = dictionary.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var o = new object[dictionary.Count];
|
||||
dictionary.Values.CopyTo(o, 0);
|
||||
composeBinary(o[i]);
|
||||
offsetTable.Add(objectTable.Count);
|
||||
refs.Add(refCount);
|
||||
refCount--;
|
||||
}
|
||||
for (int i = dictionary.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var o = new string[dictionary.Count];
|
||||
dictionary.Keys.CopyTo(o, 0);
|
||||
composeBinary(o[i]);//);
|
||||
offsetTable.Add(objectTable.Count);
|
||||
refs.Add(refCount);
|
||||
refCount--;
|
||||
}
|
||||
|
||||
if (dictionary.Count < 15)
|
||||
{
|
||||
header.Add(Convert.ToByte(0xD0 | Convert.ToByte(dictionary.Count)));
|
||||
}
|
||||
else
|
||||
{
|
||||
header.Add(0xD0 | 0xf);
|
||||
header.AddRange(writeBinaryInteger(dictionary.Count, false));
|
||||
}
|
||||
|
||||
|
||||
foreach (int val in refs)
|
||||
{
|
||||
byte[] refBuffer = RegulateNullBytes(BitConverter.GetBytes(val), objRefSize);
|
||||
Array.Reverse(refBuffer);
|
||||
buffer.InsertRange(0, refBuffer);
|
||||
}
|
||||
|
||||
buffer.InsertRange(0, header);
|
||||
|
||||
|
||||
objectTable.InsertRange(0, buffer);
|
||||
|
||||
return buffer.ToArray();
|
||||
}
|
||||
|
||||
private static byte[] composeBinaryArray(List<object> objects)
|
||||
{
|
||||
List<byte> buffer = new List<byte>();
|
||||
List<byte> header = new List<byte>();
|
||||
List<int> refs = new List<int>();
|
||||
|
||||
for (int i = objects.Count - 1; i >= 0; i--)
|
||||
{
|
||||
composeBinary(objects[i]);
|
||||
offsetTable.Add(objectTable.Count);
|
||||
refs.Add(refCount);
|
||||
refCount--;
|
||||
}
|
||||
|
||||
if (objects.Count < 15)
|
||||
{
|
||||
header.Add(Convert.ToByte(0xA0 | Convert.ToByte(objects.Count)));
|
||||
}
|
||||
else
|
||||
{
|
||||
header.Add(0xA0 | 0xf);
|
||||
header.AddRange(writeBinaryInteger(objects.Count, false));
|
||||
}
|
||||
|
||||
foreach (int val in refs)
|
||||
{
|
||||
byte[] refBuffer = RegulateNullBytes(BitConverter.GetBytes(val), objRefSize);
|
||||
Array.Reverse(refBuffer);
|
||||
buffer.InsertRange(0, refBuffer);
|
||||
}
|
||||
|
||||
buffer.InsertRange(0, header);
|
||||
|
||||
objectTable.InsertRange(0, buffer);
|
||||
|
||||
return buffer.ToArray();
|
||||
}
|
||||
|
||||
private static byte[] composeBinary(object obj)
|
||||
{
|
||||
byte[] value;
|
||||
switch (obj.GetType().ToString())
|
||||
{
|
||||
case "System.Collections.Generic.Dictionary`2[System.String,System.Object]":
|
||||
value = writeBinaryDictionary((Dictionary<string, object>)obj);
|
||||
return value;
|
||||
|
||||
case "System.Collections.Generic.List`1[System.Object]":
|
||||
value = composeBinaryArray((List<object>)obj);
|
||||
return value;
|
||||
|
||||
case "System.Byte[]":
|
||||
value = writeBinaryByteArray((byte[])obj);
|
||||
return value;
|
||||
|
||||
case "System.Double":
|
||||
value = writeBinaryDouble((double)obj);
|
||||
return value;
|
||||
|
||||
case "System.Int32":
|
||||
value = writeBinaryInteger((int)obj, true);
|
||||
return value;
|
||||
|
||||
case "System.String":
|
||||
value = writeBinaryString((string)obj, true);
|
||||
return value;
|
||||
|
||||
case "System.DateTime":
|
||||
value = writeBinaryDate((DateTime)obj);
|
||||
return value;
|
||||
|
||||
case "System.Boolean":
|
||||
value = writeBinaryBool((bool)obj);
|
||||
return value;
|
||||
|
||||
default:
|
||||
return new byte[0];
|
||||
}
|
||||
}
|
||||
|
||||
public static byte[] writeBinaryDate(DateTime obj)
|
||||
{
|
||||
List<byte> buffer =new List<byte>(RegulateNullBytes(BitConverter.GetBytes(PlistDateConverter.ConvertToAppleTimeStamp(obj)), 8));
|
||||
buffer.Reverse();
|
||||
buffer.Insert(0, 0x33);
|
||||
objectTable.InsertRange(0, buffer);
|
||||
return buffer.ToArray();
|
||||
}
|
||||
|
||||
public static byte[] writeBinaryBool(bool obj)
|
||||
{
|
||||
List<byte> buffer = new List<byte>(new byte[1] { (bool)obj ? (byte)9 : (byte)8 });
|
||||
objectTable.InsertRange(0, buffer);
|
||||
return buffer.ToArray();
|
||||
}
|
||||
|
||||
private static byte[] writeBinaryInteger(int value, bool write)
|
||||
{
|
||||
List<byte> buffer = new List<byte>(BitConverter.GetBytes((long) value));
|
||||
buffer =new List<byte>(RegulateNullBytes(buffer.ToArray()));
|
||||
while (buffer.Count != Math.Pow(2, Math.Log(buffer.Count) / Math.Log(2)))
|
||||
buffer.Add(0);
|
||||
int header = 0x10 | (int)(Math.Log(buffer.Count) / Math.Log(2));
|
||||
|
||||
buffer.Reverse();
|
||||
|
||||
buffer.Insert(0, Convert.ToByte(header));
|
||||
|
||||
if (write)
|
||||
objectTable.InsertRange(0, buffer);
|
||||
|
||||
return buffer.ToArray();
|
||||
}
|
||||
|
||||
private static byte[] writeBinaryDouble(double value)
|
||||
{
|
||||
List<byte> buffer =new List<byte>(RegulateNullBytes(BitConverter.GetBytes(value), 4));
|
||||
while (buffer.Count != Math.Pow(2, Math.Log(buffer.Count) / Math.Log(2)))
|
||||
buffer.Add(0);
|
||||
int header = 0x20 | (int)(Math.Log(buffer.Count) / Math.Log(2));
|
||||
|
||||
buffer.Reverse();
|
||||
|
||||
buffer.Insert(0, Convert.ToByte(header));
|
||||
|
||||
objectTable.InsertRange(0, buffer);
|
||||
|
||||
return buffer.ToArray();
|
||||
}
|
||||
|
||||
private static byte[] writeBinaryByteArray(byte[] value)
|
||||
{
|
||||
List<byte> buffer = new List<byte>(value);
|
||||
List<byte> header = new List<byte>();
|
||||
if (value.Length < 15)
|
||||
{
|
||||
header.Add(Convert.ToByte(0x40 | Convert.ToByte(value.Length)));
|
||||
}
|
||||
else
|
||||
{
|
||||
header.Add(0x40 | 0xf);
|
||||
header.AddRange(writeBinaryInteger(buffer.Count, false));
|
||||
}
|
||||
|
||||
buffer.InsertRange(0, header);
|
||||
|
||||
objectTable.InsertRange(0, buffer);
|
||||
|
||||
return buffer.ToArray();
|
||||
}
|
||||
|
||||
private static byte[] writeBinaryString(string value, bool head)
|
||||
{
|
||||
List<byte> buffer = new List<byte>();
|
||||
List<byte> header = new List<byte>();
|
||||
foreach (char chr in value.ToCharArray())
|
||||
buffer.Add(Convert.ToByte(chr));
|
||||
|
||||
if (head)
|
||||
{
|
||||
if (value.Length < 15)
|
||||
{
|
||||
header.Add(Convert.ToByte(0x50 | Convert.ToByte(value.Length)));
|
||||
}
|
||||
else
|
||||
{
|
||||
header.Add(0x50 | 0xf);
|
||||
header.AddRange(writeBinaryInteger(buffer.Count, false));
|
||||
}
|
||||
}
|
||||
|
||||
buffer.InsertRange(0, header);
|
||||
|
||||
objectTable.InsertRange(0, buffer);
|
||||
|
||||
return buffer.ToArray();
|
||||
}
|
||||
|
||||
private static byte[] RegulateNullBytes(byte[] value)
|
||||
{
|
||||
return RegulateNullBytes(value, 1);
|
||||
}
|
||||
|
||||
private static byte[] RegulateNullBytes(byte[] value, int minBytes)
|
||||
{
|
||||
Array.Reverse(value);
|
||||
List<byte> bytes = new List<byte>(value);
|
||||
for (int i = 0; i < bytes.Count; i++)
|
||||
{
|
||||
if (bytes[i] == 0 && bytes.Count > minBytes)
|
||||
{
|
||||
bytes.Remove(bytes[i]);
|
||||
i--;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (bytes.Count < minBytes)
|
||||
{
|
||||
int dist = minBytes - bytes.Count;
|
||||
for (int i = 0; i < dist; i++)
|
||||
bytes.Insert(0, 0);
|
||||
}
|
||||
|
||||
value = bytes.ToArray();
|
||||
Array.Reverse(value);
|
||||
return value;
|
||||
}
|
||||
|
||||
private static void parseTrailer(List<byte> trailer)
|
||||
{
|
||||
offsetByteSize = BitConverter.ToInt32(RegulateNullBytes(trailer.GetRange(6, 1).ToArray(), 4), 0);
|
||||
objRefSize = BitConverter.ToInt32(RegulateNullBytes(trailer.GetRange(7, 1).ToArray(), 4), 0);
|
||||
byte[] refCountBytes = trailer.GetRange(12, 4).ToArray();
|
||||
Array.Reverse(refCountBytes);
|
||||
refCount = BitConverter.ToInt32(refCountBytes, 0);
|
||||
byte[] offsetTableOffsetBytes = trailer.GetRange(24, 8).ToArray();
|
||||
Array.Reverse(offsetTableOffsetBytes);
|
||||
offsetTableOffset = BitConverter.ToInt64(offsetTableOffsetBytes, 0);
|
||||
}
|
||||
|
||||
private static void parseOffsetTable(List<byte> offsetTableBytes)
|
||||
{
|
||||
for (int i = 0; i < offsetTableBytes.Count; i += offsetByteSize)
|
||||
{
|
||||
byte[] buffer = offsetTableBytes.GetRange(i, offsetByteSize).ToArray();
|
||||
Array.Reverse(buffer);
|
||||
offsetTable.Add(BitConverter.ToInt32(RegulateNullBytes(buffer, 4), 0));
|
||||
}
|
||||
}
|
||||
|
||||
private static object parseBinaryDictionary(int objRef)
|
||||
{
|
||||
Dictionary<string, object> buffer = new Dictionary<string, object>();
|
||||
List<int> refs = new List<int>();
|
||||
int refCount = 0;
|
||||
|
||||
int refStartPosition;
|
||||
refCount = getCount(offsetTable[objRef], out refStartPosition);
|
||||
|
||||
|
||||
if (refCount < 15)
|
||||
refStartPosition = offsetTable[objRef] + 1;
|
||||
else
|
||||
refStartPosition = offsetTable[objRef] + 2 + RegulateNullBytes(BitConverter.GetBytes(refCount), 1).Length;
|
||||
|
||||
for (int i = refStartPosition; i < refStartPosition + refCount * 2 * objRefSize; i += objRefSize)
|
||||
{
|
||||
byte[] refBuffer = objectTable.GetRange(i, objRefSize).ToArray();
|
||||
Array.Reverse(refBuffer);
|
||||
refs.Add(BitConverter.ToInt32(RegulateNullBytes(refBuffer, 4), 0));
|
||||
}
|
||||
|
||||
for (int i = 0; i < refCount; i++)
|
||||
{
|
||||
buffer.Add((string)parseBinary(refs[i]), parseBinary(refs[i + refCount]));
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
private static object parseBinaryArray(int objRef)
|
||||
{
|
||||
List<object> buffer = new List<object>();
|
||||
List<int> refs = new List<int>();
|
||||
int refCount = 0;
|
||||
|
||||
int refStartPosition;
|
||||
refCount = getCount(offsetTable[objRef], out refStartPosition);
|
||||
|
||||
|
||||
if (refCount < 15)
|
||||
refStartPosition = offsetTable[objRef] + 1;
|
||||
else
|
||||
//The following integer has a header aswell so we increase the refStartPosition by two to account for that.
|
||||
refStartPosition = offsetTable[objRef] + 2 + RegulateNullBytes(BitConverter.GetBytes(refCount), 1).Length;
|
||||
|
||||
for (int i = refStartPosition; i < refStartPosition + refCount * objRefSize; i += objRefSize)
|
||||
{
|
||||
byte[] refBuffer = objectTable.GetRange(i, objRefSize).ToArray();
|
||||
Array.Reverse(refBuffer);
|
||||
refs.Add(BitConverter.ToInt32(RegulateNullBytes(refBuffer, 4), 0));
|
||||
}
|
||||
|
||||
for (int i = 0; i < refCount; i++)
|
||||
{
|
||||
buffer.Add(parseBinary(refs[i]));
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
private static int getCount(int bytePosition, out int newBytePosition)
|
||||
{
|
||||
byte headerByte = objectTable[bytePosition];
|
||||
byte headerByteTrail = Convert.ToByte(headerByte & 0xf);
|
||||
int count;
|
||||
if (headerByteTrail < 15)
|
||||
{
|
||||
count = headerByteTrail;
|
||||
newBytePosition = bytePosition + 1;
|
||||
}
|
||||
else
|
||||
count = (int)parseBinaryInt(bytePosition + 1, out newBytePosition);
|
||||
return count;
|
||||
}
|
||||
|
||||
private static object parseBinary(int objRef)
|
||||
{
|
||||
byte header = objectTable[offsetTable[objRef]];
|
||||
switch (header & 0xF0)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
//If the byte is
|
||||
//0 return null
|
||||
//9 return true
|
||||
//8 return false
|
||||
return (objectTable[offsetTable[objRef]] == 0) ? (object)null : ((objectTable[offsetTable[objRef]] == 9) ? true : false);
|
||||
}
|
||||
case 0x10:
|
||||
{
|
||||
return parseBinaryInt(offsetTable[objRef]);
|
||||
}
|
||||
case 0x20:
|
||||
{
|
||||
return parseBinaryReal(offsetTable[objRef]);
|
||||
}
|
||||
case 0x30:
|
||||
{
|
||||
return parseBinaryDate(offsetTable[objRef]);
|
||||
}
|
||||
case 0x40:
|
||||
{
|
||||
return parseBinaryByteArray(offsetTable[objRef]);
|
||||
}
|
||||
case 0x50://String ASCII
|
||||
{
|
||||
return parseBinaryAsciiString(offsetTable[objRef]);
|
||||
}
|
||||
case 0x60://String Unicode
|
||||
{
|
||||
return parseBinaryUnicodeString(offsetTable[objRef]);
|
||||
}
|
||||
case 0xD0:
|
||||
{
|
||||
return parseBinaryDictionary(objRef);
|
||||
}
|
||||
case 0xA0:
|
||||
{
|
||||
return parseBinaryArray(objRef);
|
||||
}
|
||||
}
|
||||
throw new Exception("This type is not supported");
|
||||
}
|
||||
|
||||
public static object parseBinaryDate(int headerPosition)
|
||||
{
|
||||
byte[] buffer = objectTable.GetRange(headerPosition + 1, 8).ToArray();
|
||||
Array.Reverse(buffer);
|
||||
double appleTime = BitConverter.ToDouble(buffer, 0);
|
||||
DateTime result = PlistDateConverter.ConvertFromAppleTimeStamp(appleTime);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static object parseBinaryInt(int headerPosition)
|
||||
{
|
||||
int output;
|
||||
return parseBinaryInt(headerPosition, out output);
|
||||
}
|
||||
|
||||
private static object parseBinaryInt(int headerPosition, out int newHeaderPosition)
|
||||
{
|
||||
byte header = objectTable[headerPosition];
|
||||
int byteCount = (int)Math.Pow(2, header & 0xf);
|
||||
byte[] buffer = objectTable.GetRange(headerPosition + 1, byteCount).ToArray();
|
||||
Array.Reverse(buffer);
|
||||
//Add one to account for the header byte
|
||||
newHeaderPosition = headerPosition + byteCount + 1;
|
||||
return BitConverter.ToInt32(RegulateNullBytes(buffer, 4), 0);
|
||||
}
|
||||
|
||||
private static object parseBinaryReal(int headerPosition)
|
||||
{
|
||||
byte header = objectTable[headerPosition];
|
||||
int byteCount = (int)Math.Pow(2, header & 0xf);
|
||||
byte[] buffer = objectTable.GetRange(headerPosition + 1, byteCount).ToArray();
|
||||
Array.Reverse(buffer);
|
||||
|
||||
return BitConverter.ToDouble(RegulateNullBytes(buffer, 8), 0);
|
||||
}
|
||||
|
||||
private static object parseBinaryAsciiString(int headerPosition)
|
||||
{
|
||||
int charStartPosition;
|
||||
int charCount = getCount(headerPosition, out charStartPosition);
|
||||
|
||||
var buffer = objectTable.GetRange(charStartPosition, charCount);
|
||||
return buffer.Count > 0 ? Encoding.ASCII.GetString(buffer.ToArray()) : string.Empty;
|
||||
}
|
||||
|
||||
private static object parseBinaryUnicodeString(int headerPosition)
|
||||
{
|
||||
int charStartPosition;
|
||||
int charCount = getCount(headerPosition, out charStartPosition);
|
||||
charCount = charCount * 2;
|
||||
|
||||
byte[] buffer = new byte[charCount];
|
||||
byte one, two;
|
||||
|
||||
for (int i = 0; i < charCount; i+=2)
|
||||
{
|
||||
one = objectTable.GetRange(charStartPosition+i,1)[0];
|
||||
two = objectTable.GetRange(charStartPosition + i+1, 1)[0];
|
||||
|
||||
if (BitConverter.IsLittleEndian)
|
||||
{
|
||||
buffer[i] = two;
|
||||
buffer[i + 1] = one;
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer[i] = one;
|
||||
buffer[i + 1] = two;
|
||||
}
|
||||
}
|
||||
|
||||
return Encoding.Unicode.GetString(buffer);
|
||||
}
|
||||
|
||||
private static object parseBinaryByteArray(int headerPosition)
|
||||
{
|
||||
int byteStartPosition;
|
||||
int byteCount = getCount(headerPosition, out byteStartPosition);
|
||||
return objectTable.GetRange(byteStartPosition, byteCount).ToArray();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public enum plistType
|
||||
{
|
||||
Auto, Binary, Xml
|
||||
}
|
||||
|
||||
public static class PlistDateConverter
|
||||
{
|
||||
public static long timeDifference = 978307200;
|
||||
|
||||
public static long GetAppleTime(long unixTime)
|
||||
{
|
||||
return unixTime - timeDifference;
|
||||
}
|
||||
|
||||
public static long GetUnixTime(long appleTime)
|
||||
{
|
||||
return appleTime + timeDifference;
|
||||
}
|
||||
|
||||
public static DateTime ConvertFromAppleTimeStamp(double timestamp)
|
||||
{
|
||||
DateTime origin = new DateTime(2001, 1, 1, 0, 0, 0, 0);
|
||||
return origin.AddSeconds(timestamp);
|
||||
}
|
||||
|
||||
public static double ConvertToAppleTimeStamp(DateTime date)
|
||||
{
|
||||
DateTime begin = new DateTime(2001, 1, 1, 0, 0, 0, 0);
|
||||
TimeSpan diff = date - begin;
|
||||
return Math.Floor(diff.TotalSeconds);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 381bd318429f34fab8edc6eb1d38d997
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,42 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Touka
|
||||
{
|
||||
public class TKGProperties
|
||||
{
|
||||
public static Hashtable Load(string file)
|
||||
{
|
||||
Hashtable ht = new Hashtable(16);
|
||||
string content = null;
|
||||
try
|
||||
{
|
||||
content = File.ReadAllText(file, Encoding.UTF8);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
string[] rows = content.Split('\n');
|
||||
string[] kv = null;
|
||||
foreach (string c in rows)
|
||||
{
|
||||
if (c.Trim().Length == 0)
|
||||
continue;
|
||||
kv = c.Split('=');
|
||||
if (kv.Length == 1)
|
||||
{
|
||||
ht[kv[0].Trim()] = "";
|
||||
}
|
||||
else if (kv.Length == 2)
|
||||
{
|
||||
ht[kv[0].Trim()] = kv[1].Trim();
|
||||
}
|
||||
}
|
||||
return ht;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 11fe57842d0ce30478249f770ab1bf06
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9d379b89fde4f4ad4812b7f41a3cf719
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,16 @@
|
|||
#if USE_IAP
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Purchasing;
|
||||
|
||||
public static class IAPProducts//商品ID统一小写
|
||||
{
|
||||
public const string NoAds = "com.hotpotgames.lovepuzzle.global.noads";//去广告商品ID
|
||||
|
||||
public static readonly Dictionary<string, ProductType> ProductDic = new Dictionary<string, ProductType>()
|
||||
{
|
||||
{ NoAds, ProductType.NonConsumable}
|
||||
};
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 273966118b1974c51a4f05ecbad30d15
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,24 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public static class StaticOtherConfig
|
||||
{
|
||||
#region // #define
|
||||
|
||||
/*
|
||||
NO_SDK : If there are no SDK related library files in the project, it will not cause error reporting
|
||||
*/
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// isDebug
|
||||
/// </summary>
|
||||
public static bool IsDebugLog = true;
|
||||
|
||||
#region Review popup
|
||||
public static int FirstLoginPopLevel = -1;//首次进入游戏弹出评价的关卡
|
||||
public static int OtherLoginPopLevel = -1;//非首次进入游戏弹出评价的关卡
|
||||
#endregion
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7109073540d94454b818a71ae1cb02c6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,41 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// InterstitialAd PositionName
|
||||
/// (get from the product requirements)
|
||||
/// </summary>
|
||||
public enum TKGIVAdPositionName
|
||||
{
|
||||
Game_Autoiv,
|
||||
|
||||
IV_Success,
|
||||
IV_Fail,
|
||||
IV_Retry,
|
||||
IV_NextLevel,
|
||||
IV_Back,
|
||||
}
|
||||
|
||||
public enum TKGNativePositionName
|
||||
{
|
||||
Native_Stage_Success,
|
||||
Native_Stage_Fail
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// RewardAd PositionName
|
||||
/// (get from the product requirements)
|
||||
/// </summary>
|
||||
public enum TKGRVPositionName
|
||||
{
|
||||
RV_GetDoubleCoin,
|
||||
RV_GetTips,
|
||||
RV_Get_Tips,
|
||||
RV_Get_Skip,
|
||||
RV_Get_Revive,
|
||||
RV_Get_SpecialLevel,
|
||||
RV_sound_unlock,
|
||||
RV_level_unlock,
|
||||
RV_end_skip,
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 26998be7ea9744ef4b965699148ba132
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,26 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
/*
|
||||
Custom Remote Config
|
||||
1. add TKGParamKey below
|
||||
2. add key and default value to dic
|
||||
3. use online param
|
||||
|
||||
*/
|
||||
public static class TKGParams
|
||||
{
|
||||
public static readonly Dictionary<string, object> OnlineParamDic = new Dictionary<string, object>()
|
||||
{
|
||||
// key - default value
|
||||
{ TKGParamKey.RemoveAdsShowCount.ToString(), 4 }, // int value //
|
||||
{ TKGParamKey.LevelList.ToString(), "1,78,72,70,64,65,4,66" }, // string value
|
||||
{ TKGParamKey.HasBlock.ToString(), 0 }, // bool value // 1:true 0:false
|
||||
};
|
||||
}
|
||||
|
||||
public enum TKGParamKey
|
||||
{
|
||||
RemoveAdsShowCount,
|
||||
LevelList,
|
||||
HasBlock,
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8f40c87431a324172941102c4817923e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,81 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Touka {
|
||||
/// <summary>
|
||||
/// Ads SDK Param
|
||||
/// </summary>
|
||||
public static class StaticStringsKey
|
||||
{
|
||||
#region App info
|
||||
|
||||
// app name
|
||||
public static string AppName = "";
|
||||
// bundle id
|
||||
public static string BundleId = "";
|
||||
|
||||
#endregion
|
||||
|
||||
#region Analytics
|
||||
// umeng
|
||||
public static string UMENG_APPKEY = "";
|
||||
public static string UMENG_CHANNELID = "";
|
||||
|
||||
// ga
|
||||
public static string GA_gameKey = "";
|
||||
public static string GA_secretKey = "";
|
||||
|
||||
// tenjin
|
||||
public static string TENJIN_KEY = "";
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Ads
|
||||
|
||||
// admob id
|
||||
public static string Admob_AppID = "";
|
||||
|
||||
// app id
|
||||
public static string TOUKA_SDK_APPID = "";
|
||||
// app key
|
||||
public static string TOUKA_SDK_APPKEY = "";
|
||||
|
||||
// iv id
|
||||
public static string TOUKA_SDK_INTERID = "";
|
||||
// rv id
|
||||
public static string TOUKA_SDK_REWARDID = "";
|
||||
// splash id
|
||||
public static string TOUKA_SDK_SPLASHID = "";
|
||||
|
||||
// native id // iOS use
|
||||
public static string TOUKA_SDK_NATIVEID = "";
|
||||
//// render native id
|
||||
//public static string TOUKA_SDK_RENDERNATIVEID = "";
|
||||
// banner id
|
||||
public static string TOUKA_SDK_BANNERID = "";
|
||||
// native banner id
|
||||
public static string TOUKA_SDK_NATIVEBANNERID = "";
|
||||
// native splash id
|
||||
public static string TOUKA_SDK_NATIVESPLASHID = "";
|
||||
|
||||
#endregion
|
||||
|
||||
#region Basic Config
|
||||
|
||||
// PlayerAge
|
||||
public static string PlayerAge = "";
|
||||
// GameTheme
|
||||
public static string GameTheme = "";
|
||||
// privacy url
|
||||
public static string PrivacyURL = "";
|
||||
// agreement url
|
||||
public static string AgreementURL = "";
|
||||
// more game url
|
||||
public static string MoreGameURL = "";
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c69a34df2d87c47a4ba9349c64b3562f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,241 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Touka
|
||||
{
|
||||
public static class TKGLoadConfig
|
||||
{
|
||||
static string toukaconfigFile = "tkg_config";
|
||||
static string toukaconfigPathCN = "CN";
|
||||
static string toukaconfigPathGB = "GB";
|
||||
|
||||
/// <summary>
|
||||
/// Load SDK Config
|
||||
/// </summary>
|
||||
public static void LoadSDKConfig()
|
||||
{
|
||||
#if UNITY_IOS
|
||||
ParseiOSConfig();
|
||||
#elif UNITY_ANDROID
|
||||
ParseAndroidConfig();
|
||||
#else
|
||||
ParseiOSConfig();
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parse iOS Config
|
||||
/// .plist file
|
||||
/// </summary>
|
||||
private static PlayerPrefPair[] ParseiOSConfig()
|
||||
{
|
||||
PlayerPrefPair[] configs = TKGLoadConfig.ParseiOSConfigInner();
|
||||
return configs;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parse Android Config
|
||||
/// </summary>
|
||||
private static PlayerPrefPair[] ParseAndroidConfig()
|
||||
{
|
||||
#if GooglePlay
|
||||
PlayerPrefPair[] configs = TKGLoadPropertiesConfig.GetToukaConfig(AppChannel.GooglePlay);
|
||||
ParseConfigsInner(configs);
|
||||
return configs;
|
||||
#else
|
||||
PlayerPrefPair[] configs = TKGLoadPropertiesConfig.GetToukaConfig(AppChannel.GW002);
|
||||
ParseConfigsInner(configs);
|
||||
return configs;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parse iOS Config
|
||||
/// .plist file
|
||||
/// </summary>
|
||||
private static PlayerPrefPair[] ParseiOSConfigInner()
|
||||
{
|
||||
#if AppStore_GB
|
||||
PlayerPrefPair[] configs = TKGLoadPlistConfig.GetToukaConfig(toukaconfigFile,toukaconfigPathGB);
|
||||
#else
|
||||
PlayerPrefPair[] configs = TKGLoadPlistConfig.GetToukaConfig(toukaconfigFile, toukaconfigPathCN);
|
||||
#endif
|
||||
ParseConfigsInner(configs);
|
||||
return configs;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parse Android Config
|
||||
/// </summary>
|
||||
private static PlayerPrefPair[] ParseAndroidConfig(AppChannel _appChannel)
|
||||
{
|
||||
PlayerPrefPair[] configs = TKGLoadPropertiesConfig.GetToukaConfig(_appChannel);
|
||||
ParseConfigsInner(configs);
|
||||
return configs;
|
||||
}
|
||||
|
||||
|
||||
// get config value by key
|
||||
public static string GetConfigByKey(string _key, AppChannel _appChannel)
|
||||
{
|
||||
PlayerPrefPair[] configs = new PlayerPrefPair[0];
|
||||
#if UNITY_IOS
|
||||
configs = ParseiOSConfigInner();
|
||||
#elif UNITY_ANDROID
|
||||
configs = ParseAndroidConfig(_appChannel);
|
||||
#endif
|
||||
for (int i = 0; i < configs.Length; i++)
|
||||
{
|
||||
if (configs[i].Key.Equals(_key))
|
||||
{
|
||||
return configs[i].Value.ToString();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
#region parse inner
|
||||
|
||||
// parse config
|
||||
private static void ParseConfigsInner(PlayerPrefPair[] _configs)
|
||||
{
|
||||
TKGDebugger.LogDebug("----------- config content begin-----------");
|
||||
for (int i = 0; i < _configs.Length; i++)
|
||||
{
|
||||
bool isDebug = false;
|
||||
string valueTemp = _configs[i].Value.ToString();
|
||||
// app info
|
||||
if (_configs[i].Key.ToLower() == ConfigKeys.KEY_AppName.ToLower())
|
||||
{
|
||||
StaticStringsKey.AppName = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_BunldId.ToLower())
|
||||
{
|
||||
StaticStringsKey.BundleId = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
// Analytics
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_UMENG_APPKEY.ToLower())
|
||||
{
|
||||
StaticStringsKey.UMENG_APPKEY = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_UMENG_CHANNELID.ToLower())
|
||||
{
|
||||
StaticStringsKey.UMENG_CHANNELID = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_GA_gameKey.ToLower())
|
||||
{
|
||||
StaticStringsKey.GA_gameKey = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_GA_secretKey.ToLower())
|
||||
{
|
||||
StaticStringsKey.GA_secretKey = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_TENJIN_KEY.ToLower())
|
||||
{
|
||||
StaticStringsKey.TENJIN_KEY = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
// Ads
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_Admob_AppID.ToLower())
|
||||
{
|
||||
StaticStringsKey.Admob_AppID = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_TOUKA_SDK_APPID.ToLower())
|
||||
{
|
||||
StaticStringsKey.TOUKA_SDK_APPID = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_TOUKA_SDK_APPKEY.ToLower())
|
||||
{
|
||||
StaticStringsKey.TOUKA_SDK_APPKEY = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_TOUKA_SDK_INTERID.ToLower())
|
||||
{
|
||||
StaticStringsKey.TOUKA_SDK_INTERID = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_TOUKA_SDK_REWARDID.ToLower())
|
||||
{
|
||||
StaticStringsKey.TOUKA_SDK_REWARDID = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_TOUKA_SDK_SPLASHID.ToLower())
|
||||
{
|
||||
StaticStringsKey.TOUKA_SDK_SPLASHID = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_TOUKA_SDK_NATIVEID.ToLower())
|
||||
{
|
||||
StaticStringsKey.TOUKA_SDK_NATIVEID = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_TOUKA_SDK_RENDERNATIVEID.ToLower())
|
||||
{
|
||||
StaticStringsKey.TOUKA_SDK_NATIVEID = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_TOUKA_SDK_BANNERID.ToLower())
|
||||
{
|
||||
StaticStringsKey.TOUKA_SDK_BANNERID = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_TOUKA_SDK_NATIVEBANNERID.ToLower())
|
||||
{
|
||||
StaticStringsKey.TOUKA_SDK_NATIVEBANNERID = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_TOUKA_SDK_NATIVESPLASHID.ToLower())
|
||||
{
|
||||
StaticStringsKey.TOUKA_SDK_NATIVESPLASHID = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
// Basic Config
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_PlayerAge.ToLower())
|
||||
{
|
||||
StaticStringsKey.PlayerAge = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_GameTheme.ToLower())
|
||||
{
|
||||
StaticStringsKey.GameTheme = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_PrivacyURL.ToLower())
|
||||
{
|
||||
StaticStringsKey.PrivacyURL = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_AgreementURL.ToLower())
|
||||
{
|
||||
StaticStringsKey.AgreementURL = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
else if (_configs[i].Key.ToLower() == ConfigKeys.KEY_MoreGameURL.ToLower())
|
||||
{
|
||||
StaticStringsKey.MoreGameURL = valueTemp;
|
||||
isDebug = true;
|
||||
}
|
||||
|
||||
if (isDebug)
|
||||
{
|
||||
TKGDebugger.LogDebug(_configs[i].Key + " - " + _configs[i].Value);
|
||||
}
|
||||
}
|
||||
TKGDebugger.LogDebug("----------- config content end -----------");
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2bd116d0b8ee64d9599a1033dd163600
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e5f9fc490b051448298138ce3172b399
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,311 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Touka
|
||||
{
|
||||
public class ToukaSDKDemo : MonoBehaviour
|
||||
{
|
||||
|
||||
|
||||
public Image nativeImage;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
InitSDK();
|
||||
}
|
||||
|
||||
#region Init
|
||||
|
||||
public void OnShowNativeAd()
|
||||
{
|
||||
TKGSDKManager.Instance.ShowNative(nativeImage.rectTransform);
|
||||
}
|
||||
|
||||
public void OnButton_Init()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_Init click, InitSDK auto Callfirst");
|
||||
|
||||
}
|
||||
|
||||
private void InitSDK()
|
||||
{
|
||||
OnButton_UserSource();
|
||||
OnButton_SetLogEnable();
|
||||
|
||||
TKGSDKManager.Instance.InitSDK(initCallback);
|
||||
TKGSDKManager.Instance.SetLogEnable(true);
|
||||
TKGSDKManager.Instance.SetRewardClickListener(ClickRewardCallback);
|
||||
TKGSDKManager.Instance.RegistAPNS();
|
||||
}
|
||||
|
||||
private void ClickRewardCallback()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] click reward callback");
|
||||
}
|
||||
private void initCallback()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] init callback");
|
||||
}
|
||||
|
||||
public void OnButton_SetLogEnable()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] SetLogEnable btn click");
|
||||
//TKGSDKManager.Instance.SetLogEnable(true);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Ads
|
||||
|
||||
public void OnButton_ShowInterstitialAd()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_ShowInterstitialAd click");
|
||||
//TKGSDKManager.Instance.ShowInterstitialAd(TKGIVAdPositionName.IV_Retry, IVCallback);
|
||||
DateTime now;
|
||||
DateTime delay;
|
||||
now = DateTime.Now;
|
||||
TKGSDKManager.Instance.RegistNotification("yangwu","hello world", now.AddDays(1).ToString("yyyy-MM-dd HH:mm:ss"),1,"Title","SubTitle");
|
||||
}
|
||||
|
||||
|
||||
private void IV2Callback()
|
||||
{
|
||||
Debug.Log("unity [ToukaSDKDemo] IVCallback");
|
||||
}
|
||||
|
||||
private void IVCallback()
|
||||
{
|
||||
Debug.Log("unity [ToukaSDKDemo] IVCallback 2" );
|
||||
}
|
||||
|
||||
public void OnButton_ShowRewardAd()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_ShowRewardAd click");
|
||||
TKGSDKManager.Instance.ShowRewardAd(TKGRVPositionName.RV_GetDoubleCoin, RewardResult, RvShowFailed);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reward result
|
||||
/// </summary>
|
||||
/// <param name="pSucceed"> true:reward succ, false: reward failed </param>
|
||||
private void RewardResult(bool pSucceed)
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] Reward result:" + pSucceed);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Callback of reward ad show fail
|
||||
/// </summary>
|
||||
private void RvShowFailed()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] Reward ads show failed");
|
||||
}
|
||||
|
||||
public void OnButton_IsReadyIV()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_IsReadyIV click");
|
||||
bool isReadyIV = TKGSDKManager.Instance.IsReadyInterstitialAd();
|
||||
Debug.Log("[ToukaSDKDemo] isReadyIV : " + isReadyIV);
|
||||
}
|
||||
|
||||
public void OnButton_IsReadyRV()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_IsReadyRV click");
|
||||
bool isReadyRV = TKGSDKManager.Instance.IsReadyRewardAd();
|
||||
Debug.Log("[ToukaSDKDemo] isReadyRV : " + isReadyRV);
|
||||
}
|
||||
|
||||
public void OnButton_ShowBanner()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_ShowBanner click");
|
||||
TKGSDKManager.Instance.ShowBanner(TKGBannerAlign.BannerCenterBottomAlign);
|
||||
}
|
||||
|
||||
public void OnButton_HideBanner()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_HideBanner click");
|
||||
TKGSDKManager.Instance.HideBanner();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Event Tracking
|
||||
|
||||
public void OnButton_LevelStart()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_LevelStart click");
|
||||
TKGSDKManager.Instance.LevelStart(1);
|
||||
}
|
||||
|
||||
public void OnButton_LevelSucc()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_LevelSucc click");
|
||||
TKGSDKManager.Instance.LevelEnd(1, StageResult.StageSucc);
|
||||
}
|
||||
|
||||
public void OnButton_LevelFailed()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_LevelFailed click");
|
||||
TKGSDKManager.Instance.LevelEnd(2, StageResult.StageFail);
|
||||
}
|
||||
|
||||
public void OnButton_LevelRetry()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_LevelRetry click");
|
||||
TKGSDKManager.Instance.LevelEnd(3, StageResult.StageRetry);
|
||||
}
|
||||
|
||||
public void OnButton_LevelBack()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_LevelBack click");
|
||||
TKGSDKManager.Instance.LevelEnd("S_1", StageResult.StageBack);
|
||||
}
|
||||
|
||||
public void OnButton_LogEventClick()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_LogEventClick click");
|
||||
TKGSDKManager.Instance.LogEvent("logEvent01");
|
||||
TKGSDKManager.Instance.LogEvent("logEvent02", "key02", "value02");
|
||||
TKGSDKManager.Instance.LogEvent("logEvent03", "key03-1", "value03-1", "key03-2", "value03-2");
|
||||
TKGSDKManager.Instance.LogEvent("logEvent04", new Dictionary<string, string> { { "DicKey04", "DicKey04" } });
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Get Remote Config
|
||||
|
||||
public void OnButton_GetConfigInt()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_GetConfigInt click");
|
||||
int onlineIntValue = TKGSDKManager.Instance.GetConfigInt(TKGParamKey.RemoveAdsShowCount);
|
||||
Debug.Log("online int value : " + onlineIntValue);
|
||||
}
|
||||
|
||||
public void OnButton_GetConfigStr()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_GetConfigStr click");
|
||||
string onlineStrValue = TKGSDKManager.Instance.GetConfigStr(TKGParamKey.LevelList);
|
||||
Debug.Log("online string value : " + onlineStrValue);
|
||||
}
|
||||
|
||||
public void OnButton_GetConfigBool()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_GetConfigBool click");
|
||||
bool onlineBoolValue = TKGSDKManager.Instance.GetConfigBool(TKGParamKey.HasBlock);
|
||||
Debug.Log("online bool value : " + onlineBoolValue);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Privacy Compliance
|
||||
|
||||
public void OnButton_OpenPrivacyUrl()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_OpenPrivacyUrl click");
|
||||
TKGSDKManager.Instance.OpenPolicyPop();
|
||||
}
|
||||
|
||||
public void OnButton_OpenUserTermBtn()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_OpenUserTermBtn click");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Others
|
||||
|
||||
public void OnButton_OpenMoreGame()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_OpenMoreGame click");
|
||||
TKGSDKManager.Instance.OpenMoreGame();
|
||||
}
|
||||
|
||||
public void OnButton_ReviewBtn()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_ReviewBtn click");
|
||||
TKGSDKManager.Instance.Review();
|
||||
}
|
||||
|
||||
|
||||
public void OnButton_SetGameFocusListener()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_SetGameFocusListener click");
|
||||
TKGSDKManager.Instance.SetGameFocusListener((_flg) => {
|
||||
if (_flg)
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_SetGameFocusListener false flg");
|
||||
PauseGame();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OnButton_SetGameFocusListener true flg");
|
||||
ResumeGame();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void PauseGame()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] pause game callback");
|
||||
}
|
||||
|
||||
private void ResumeGame()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] resume game callback");
|
||||
}
|
||||
|
||||
public void OnButton_OpenLocalPush()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] OpenLocalPush click");
|
||||
|
||||
/*
|
||||
* Assets/TKGSDK/Config/Scripts/StaticOtherConfig.cs
|
||||
1. set LocalNotitcifaction_Switch = true;
|
||||
2. set pushContent; // copy from product requirements
|
||||
MorrowMsgCN = "";
|
||||
Day357MsgCN = "";
|
||||
Day468MsgCN = "";
|
||||
*/
|
||||
}
|
||||
|
||||
public void OnButton_UserSource()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] Set UserSource Click, call before init");
|
||||
|
||||
TKGSDKManager.Instance.SetUserSourceListener((_isOrigin, _source) =>
|
||||
{
|
||||
Debug.Log("usersource"+_isOrigin+_source);
|
||||
if (_isOrigin)
|
||||
{
|
||||
Debug.Log("is origin user");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("is not origin user");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void OnButton_CommonCallback()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] Set commonCallback Click");
|
||||
TKGSDKManager.Instance.SetTKGCommonCallback((code, msg) => {
|
||||
Debug.Log("common callback, code : " + code + " , msg : " + msg);
|
||||
});
|
||||
}
|
||||
|
||||
public void OnButton_GetChannel()
|
||||
{
|
||||
Debug.Log("[ToukaSDKDemo] getChannel click");
|
||||
Debug.Log("channel : " + TKGSDKManager.Instance.GetChannel());
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 542a9563293ba47b4b6070cc9197f431
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6981b962eb4cd450398514e00a5f7a11
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3b72e726f1d95467aa884508bee4f00e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,55 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public class MyAllPostprocessor : AssetPostprocessor
|
||||
{
|
||||
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
|
||||
{
|
||||
foreach (string str in importedAssets)
|
||||
{
|
||||
if (str.Contains("tkg_game_configs.json"))
|
||||
{
|
||||
Debug.Log("Reimported Asset: " + str);
|
||||
|
||||
TKGInnerGameConfig configs = LoadJson.LoadJsonFromFile<TKGInnerGameConfig>(str);
|
||||
Debug.Log("configs : " + configs.TKGParams.Count);
|
||||
|
||||
for(int i = 0; i < configs.TKGParams.Count; i++)
|
||||
{
|
||||
Debug.Log("param key : " + configs.TKGParams[i].key + " , value : " + configs.TKGParams[i].value);
|
||||
}
|
||||
|
||||
for (int i = 0; i < configs.TKGAdPositionName.TKGIVAdPositionName.Count; i++)
|
||||
{
|
||||
Debug.Log("iv pos : " + configs.TKGAdPositionName.TKGIVAdPositionName[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < configs.TKGAdPositionName.TKGRVPositionName.Count; i++)
|
||||
{
|
||||
Debug.Log("rv pos : " + configs.TKGAdPositionName.TKGRVPositionName[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class PlayerState : MonoBehaviour
|
||||
{
|
||||
public string playerName;
|
||||
public int lives;
|
||||
public float health;
|
||||
|
||||
public string SaveToString()
|
||||
{
|
||||
return JsonUtility.ToJson(this);
|
||||
}
|
||||
|
||||
// Given:
|
||||
// playerName = "Dr Charles"
|
||||
// lives = 3
|
||||
// health = 0.8f
|
||||
// SaveToString returns:
|
||||
// {"playerName":"Dr Charles","lives":3,"health":0.8}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8fcede2e4317b4d1197e85047dbbd880
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,98 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
||||
public class TKGParseGameConfig
|
||||
{
|
||||
public static void Test()
|
||||
{
|
||||
TKGInnerParamsKey paramKey01 = new TKGInnerParamsKey();
|
||||
paramKey01.key = "LevelList";
|
||||
paramKey01.value = "1,78,72,70,64,65,4,66";
|
||||
|
||||
TKGInnerParamsKey paramKey02 = new TKGInnerParamsKey();
|
||||
paramKey02.key = "HasBlock";
|
||||
paramKey02.value = "0";
|
||||
|
||||
TKGInnerGameConfig config01 = new TKGInnerGameConfig();
|
||||
config01.TKGParams.Add(paramKey01);
|
||||
config01.TKGParams.Add(paramKey02);
|
||||
|
||||
config01.TKGAdPositionName = new TKGInnerAdPositionName();
|
||||
|
||||
config01.TKGAdPositionName.TKGIVAdPositionName.Add("IV_Success");
|
||||
config01.TKGAdPositionName.TKGIVAdPositionName.Add("IV_Fail");
|
||||
|
||||
config01.TKGAdPositionName.TKGRVPositionName.Add("RV_GetDoubleCoin");
|
||||
config01.TKGAdPositionName.TKGRVPositionName.Add("RV_GetTips");
|
||||
|
||||
|
||||
string ss = config01.SaveToString();
|
||||
Debug.Log("ss : " + ss);
|
||||
}
|
||||
}
|
||||
|
||||
#region Inner Class
|
||||
|
||||
[Serializable]
|
||||
public class TKGInnerParamsKey
|
||||
{
|
||||
public string key;
|
||||
public string value;
|
||||
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class TKGInnerAdPositionName
|
||||
{
|
||||
public List<string> TKGIVAdPositionName = new List<string>();
|
||||
public List<string> TKGRVPositionName = new List<string>();
|
||||
}
|
||||
|
||||
|
||||
[Serializable]
|
||||
public class TKGInnerGameConfig
|
||||
{
|
||||
public List<TKGInnerParamsKey> TKGParams = new List<TKGInnerParamsKey>();
|
||||
public TKGInnerAdPositionName TKGAdPositionName;
|
||||
|
||||
public string SaveToString()
|
||||
{
|
||||
return JsonUtility.ToJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region load json
|
||||
|
||||
public class LoadJson
|
||||
{
|
||||
public static T LoadJsonFromFile<T>(string _path) where T : class
|
||||
{
|
||||
if (!File.Exists(_path))
|
||||
{
|
||||
Debug.LogError("Don't Find " + _path);
|
||||
return null;
|
||||
}
|
||||
|
||||
StreamReader sr = new StreamReader(_path);
|
||||
if (sr == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
string json = sr.ReadToEnd();
|
||||
|
||||
if (json.Length > 0)
|
||||
{
|
||||
return JsonUtility.FromJson<T>(json);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 069e18db978ff4c3cbf25edac908307d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,733 @@
|
|||
using System.IO;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Callbacks;
|
||||
#if UNITY_IOS
|
||||
using UnityEditor.iOS.Xcode;
|
||||
#endif
|
||||
using UnityEngine;
|
||||
#if UNITY_IOS
|
||||
namespace Touka
|
||||
{
|
||||
public partial class ToukaAdsBuildPostProcessor
|
||||
{
|
||||
[PostProcessBuild]
|
||||
public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
|
||||
{
|
||||
if (buildTarget != BuildTarget.iOS) return;
|
||||
|
||||
#if UNITY_IOS
|
||||
ModifyURLTypes(path);
|
||||
ModifyCode(path);
|
||||
ModifyBundle(path);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if UNITY_IOS
|
||||
private static void ModifyURLTypes(string _path)
|
||||
{
|
||||
var plistPath = Path.Combine(_path, "Info.plist");
|
||||
var plist = new PlistDocument();
|
||||
plist.ReadFromFile(plistPath);
|
||||
|
||||
|
||||
plist.root.SetBoolean("GADIsAdManagerApp", true);
|
||||
|
||||
#if !AppStore_GB
|
||||
plist.root.SetString("GADApplicationIdentifier", TKGLoadConfig.GetConfigByKey(ConfigKeys.KEY_Admob_AppID, AppChannel.AppStore_CN));
|
||||
plist.root.SetString("AppId", TKGLoadConfig.GetConfigByKey(ConfigKeys.KEY_TOUKA_SDK_APPID, AppChannel.AppStore_CN));
|
||||
|
||||
plist.root.SetString("AppKey", TKGLoadConfig.GetConfigByKey(ConfigKeys.KEY_TOUKA_SDK_APPKEY, AppChannel.AppStore_CN) );
|
||||
plist.root.SetString("splashPlacement", TKGLoadConfig.GetConfigByKey(ConfigKeys.KEY_TOUKA_SDK_SPLASHID, AppChannel.AppStore_CN));
|
||||
|
||||
|
||||
#else
|
||||
plist.root.SetString("GADApplicationIdentifier", TKGLoadConfig.GetConfigByKey(ConfigKeys.KEY_Admob_AppID, AppChannel.AppStore_GB));
|
||||
plist.root.SetString("AppLovinSdkKey", TKGLoadConfig.GetConfigByKey(ConfigKeys.KEY_TOUKA_SDK_APPKEY, AppChannel.AppStore_GB));
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
plist.root.SetBoolean("ITSAppUsesNonExemptEncryption", false);
|
||||
|
||||
//NSAppTransportSecurity set yes
|
||||
PlistElementDict atf = plist.root["NSAppTransportSecurity"].AsDict();
|
||||
atf.SetBoolean("NSAllowsArbitraryLoads", true);
|
||||
|
||||
#region iOS 14
|
||||
//SKAdnetwork追加
|
||||
PlistElementArray URLWhiteListArr2 = plist.root.CreateArray("SKAdNetworkItems");
|
||||
|
||||
//admob (1)
|
||||
PlistElementDict dic01;
|
||||
dic01 = URLWhiteListArr2.AddDict();
|
||||
dic01.SetString("SKAdNetworkIdentifier", "cstr6suwn9.skadnetwork");
|
||||
|
||||
//ironsource(1)
|
||||
PlistElementDict dic02;
|
||||
dic02 = URLWhiteListArr2.AddDict();
|
||||
dic02.SetString("SKAdNetworkIdentifier", "su67r6k2v3.skadnetwork");
|
||||
|
||||
//mintegral (19)
|
||||
PlistElementDict dic03;
|
||||
dic03 = URLWhiteListArr2.AddDict();
|
||||
dic03.SetString("SKAdNetworkIdentifier", "kbd757ywx3.skadnetwork");
|
||||
|
||||
PlistElementDict dic04;
|
||||
dic04 = URLWhiteListArr2.AddDict();
|
||||
dic04.SetString("SKAdNetworkIdentifier", "wg4vff78zm.skadnetwork");
|
||||
|
||||
PlistElementDict dic05;
|
||||
dic05 = URLWhiteListArr2.AddDict();
|
||||
dic05.SetString("SKAdNetworkIdentifier", "737z793b9f.skadnetwork");
|
||||
|
||||
PlistElementDict dic06;
|
||||
dic06 = URLWhiteListArr2.AddDict();
|
||||
dic06.SetString("SKAdNetworkIdentifier", "ydx93a7ass.skadnetwork");
|
||||
|
||||
PlistElementDict dic07;
|
||||
dic07 = URLWhiteListArr2.AddDict();
|
||||
dic07.SetString("SKAdNetworkIdentifier", "prcb7njmu6.skadnetwork");
|
||||
|
||||
PlistElementDict dic08;
|
||||
dic08 = URLWhiteListArr2.AddDict();
|
||||
dic08.SetString("SKAdNetworkIdentifier", "7ug5zh24hu.skadnetwork");
|
||||
|
||||
PlistElementDict dic09;
|
||||
dic09 = URLWhiteListArr2.AddDict();
|
||||
dic09.SetString("SKAdNetworkIdentifier", "44jx6755aq.skadnetwork");
|
||||
|
||||
|
||||
PlistElementDict dic10;
|
||||
dic10 = URLWhiteListArr2.AddDict();
|
||||
dic10.SetString("SKAdNetworkIdentifier", "w9q455wk68.skadnetwork");
|
||||
|
||||
|
||||
|
||||
PlistElementDict dic11;
|
||||
dic11 = URLWhiteListArr2.AddDict();
|
||||
dic11.SetString("SKAdNetworkIdentifier", "8s468mfl3y.skadnetwork");
|
||||
|
||||
PlistElementDict dic12;
|
||||
dic12 = URLWhiteListArr2.AddDict();
|
||||
dic12.SetString("SKAdNetworkIdentifier", "glqzh8vgby.skadnetwork");
|
||||
|
||||
PlistElementDict dic13;
|
||||
dic13 = URLWhiteListArr2.AddDict();
|
||||
dic13.SetString("SKAdNetworkIdentifier", "c6k4g5qg8m.skadnetwork");
|
||||
|
||||
PlistElementDict dic14;
|
||||
dic14 = URLWhiteListArr2.AddDict();
|
||||
dic14.SetString("SKAdNetworkIdentifier", "mlmmfzh3r3.skadnetwork");
|
||||
|
||||
PlistElementDict dic15;
|
||||
dic15 = URLWhiteListArr2.AddDict();
|
||||
dic15.SetString("SKAdNetworkIdentifier", "4pfyvq9l8r.skadnetwork");
|
||||
|
||||
PlistElementDict dic16;
|
||||
dic16 = URLWhiteListArr2.AddDict();
|
||||
dic16.SetString("SKAdNetworkIdentifier", "av6w8kgt66.skadnetwork");
|
||||
|
||||
PlistElementDict dic17;
|
||||
dic17 = URLWhiteListArr2.AddDict();
|
||||
dic17.SetString("SKAdNetworkIdentifier", "6xzpu9s2p8.skadnetwork");
|
||||
|
||||
PlistElementDict dic18;
|
||||
dic18 = URLWhiteListArr2.AddDict();
|
||||
dic18.SetString("SKAdNetworkIdentifier", "hs6bdukanm.skadnetwork");
|
||||
|
||||
|
||||
//adcolony (19)
|
||||
PlistElementDict dic19;
|
||||
dic19 = URLWhiteListArr2.AddDict();
|
||||
dic19.SetString("SKAdNetworkIdentifier", "v72qych5uu.skadnetwork");
|
||||
|
||||
|
||||
|
||||
PlistElementDict dic20;
|
||||
dic20 = URLWhiteListArr2.AddDict();
|
||||
dic20.SetString("SKAdNetworkIdentifier", "ppxm28t8ap.skadnetwork");
|
||||
|
||||
|
||||
|
||||
PlistElementDict dic21;
|
||||
dic21 = URLWhiteListArr2.AddDict();
|
||||
dic21.SetString("SKAdNetworkIdentifier", "klf5c3l5u5.skadnetwork");
|
||||
|
||||
|
||||
|
||||
PlistElementDict dic22;
|
||||
dic22 = URLWhiteListArr2.AddDict();
|
||||
dic22.SetString("SKAdNetworkIdentifier", "4468km3ulz.skadnetwork");
|
||||
|
||||
PlistElementDict dic23;
|
||||
dic23 = URLWhiteListArr2.AddDict();
|
||||
dic23.SetString("SKAdNetworkIdentifier", "3rd42ekr43.skadnetwork");
|
||||
|
||||
//unity ads (2)
|
||||
PlistElementDict dic24;
|
||||
dic24 = URLWhiteListArr2.AddDict();
|
||||
dic24.SetString("SKAdNetworkIdentifier", "4dzt52r2t5.skadnetwork");
|
||||
|
||||
PlistElementDict dic25;
|
||||
dic25 = URLWhiteListArr2.AddDict();
|
||||
dic25.SetString("SKAdNetworkIdentifier", "bvpn9ufa9b.skadnetwork");
|
||||
|
||||
//maio (1)
|
||||
PlistElementDict dic26;
|
||||
dic26 = URLWhiteListArr2.AddDict();
|
||||
dic26.SetString("SKAdNetworkIdentifier", "V4NXQHLYQP.skadnetwork");
|
||||
|
||||
//facebook(2)
|
||||
PlistElementDict dic27;
|
||||
dic27 = URLWhiteListArr2.AddDict();
|
||||
dic27.SetString("SKAdNetworkIdentifier", "v9wttpbfk9.skadnetwork");
|
||||
|
||||
PlistElementDict dic28;
|
||||
dic28 = URLWhiteListArr2.AddDict();
|
||||
dic28.SetString("SKAdNetworkIdentifier", "n38lu8286q.skadnetwork");
|
||||
//vungle (1)
|
||||
PlistElementDict dic29;
|
||||
dic29 = URLWhiteListArr2.AddDict();
|
||||
dic29.SetString("SKAdNetworkIdentifier", "gta9lk7p23.skadnetwork");
|
||||
|
||||
//pangle (2)
|
||||
PlistElementDict dic30;
|
||||
dic30 = URLWhiteListArr2.AddDict();
|
||||
dic30.SetString("SKAdNetworkIdentifier", "238da6jt44.skadnetwork");
|
||||
|
||||
PlistElementDict dic31;
|
||||
dic31 = URLWhiteListArr2.AddDict();
|
||||
dic31.SetString("SKAdNetworkIdentifier", "22mmun2rn5.skadnetwork");
|
||||
|
||||
//applovin(19)
|
||||
|
||||
PlistElementDict dic32;
|
||||
dic32 = URLWhiteListArr2.AddDict();
|
||||
dic32.SetString("SKAdNetworkIdentifier", "2u9pt9hc89.skadnetwork");
|
||||
|
||||
PlistElementDict dic33;
|
||||
dic33 = URLWhiteListArr2.AddDict();
|
||||
dic33.SetString("SKAdNetworkIdentifier", "275upjj5gd.skadnetwork");
|
||||
|
||||
PlistElementDict dic34;
|
||||
dic34 = URLWhiteListArr2.AddDict();
|
||||
dic34.SetString("SKAdNetworkIdentifier", "4fzdc2evr5.skadnetwork");
|
||||
|
||||
|
||||
PlistElementDict dic35;
|
||||
dic35 = URLWhiteListArr2.AddDict();
|
||||
dic35.SetString("SKAdNetworkIdentifier", "9rd848q2bz.skadnetwork");
|
||||
|
||||
PlistElementDict dic36;
|
||||
dic36 = URLWhiteListArr2.AddDict();
|
||||
dic36.SetString("SKAdNetworkIdentifier", "9t245vhmpl.skadnetwork");
|
||||
|
||||
|
||||
|
||||
PlistElementDict dic37;
|
||||
dic37 = URLWhiteListArr2.AddDict();
|
||||
dic37.SetString("SKAdNetworkIdentifier", "f38h382jlk.skadnetwork");
|
||||
|
||||
PlistElementDict dic38;
|
||||
dic38 = URLWhiteListArr2.AddDict();
|
||||
dic38.SetString("SKAdNetworkIdentifier", "ludvb6z3bs.skadnetwork");
|
||||
|
||||
PlistElementDict dic39;
|
||||
dic39 = URLWhiteListArr2.AddDict();
|
||||
dic39.SetString("SKAdNetworkIdentifier", "m8dbw4sv7c.skadnetwork");
|
||||
|
||||
PlistElementDict dic40;
|
||||
dic40 = URLWhiteListArr2.AddDict();
|
||||
dic40.SetString("SKAdNetworkIdentifier", "t38b2kh725.skadnetwork");
|
||||
|
||||
PlistElementDict dic41;
|
||||
dic41 = URLWhiteListArr2.AddDict();
|
||||
dic41.SetString("SKAdNetworkIdentifier", "tl55sbb4fm.skadnetwork");
|
||||
|
||||
PlistElementDict dic42;
|
||||
dic42 = URLWhiteListArr2.AddDict();
|
||||
dic42.SetString("SKAdNetworkIdentifier", "wzmmz9fp6w.skadnetwork");
|
||||
|
||||
PlistElementDict dic43;
|
||||
dic43 = URLWhiteListArr2.AddDict();
|
||||
dic43.SetString("SKAdNetworkIdentifier", "yclnxrl5pm.skadnetwork");
|
||||
|
||||
PlistElementDict dic44;
|
||||
dic44 = URLWhiteListArr2.AddDict();
|
||||
dic44.SetString("SKAdNetworkIdentifier", "2fnua5tdw4.skadnetwork");
|
||||
|
||||
PlistElementDict dic45;
|
||||
dic45 = URLWhiteListArr2.AddDict();
|
||||
dic45.SetString("SKAdNetworkIdentifier", "3qcr597p9d.skadnetwork");
|
||||
|
||||
PlistElementDict dic46;
|
||||
dic46 = URLWhiteListArr2.AddDict();
|
||||
dic46.SetString("SKAdNetworkIdentifier", "3qy4746246.skadnetwork");
|
||||
|
||||
PlistElementDict dic47;
|
||||
dic47 = URLWhiteListArr2.AddDict();
|
||||
dic47.SetString("SKAdNetworkIdentifier", "3sh42y64q3.skadnetwork");
|
||||
|
||||
PlistElementDict dic48;
|
||||
dic48 = URLWhiteListArr2.AddDict();
|
||||
dic48.SetString("SKAdNetworkIdentifier", "424m5254lk.skadnetwork");
|
||||
|
||||
PlistElementDict dic49;
|
||||
dic49 = URLWhiteListArr2.AddDict();
|
||||
dic49.SetString("SKAdNetworkIdentifier", "5a6flpkh64.skadnetwork");
|
||||
|
||||
PlistElementDict dic50;
|
||||
dic50 = URLWhiteListArr2.AddDict();
|
||||
dic50.SetString("SKAdNetworkIdentifier", "e5fvkxwrpn.skadnetwork");
|
||||
|
||||
PlistElementDict dic51;
|
||||
dic51 = URLWhiteListArr2.AddDict();
|
||||
dic51.SetString("SKAdNetworkIdentifier", "ecpz2srf59.skadnetwork");
|
||||
|
||||
PlistElementDict dic52;
|
||||
dic52 = URLWhiteListArr2.AddDict();
|
||||
dic52.SetString("SKAdNetworkIdentifier", "hjevpa356n.skadnetwork");
|
||||
PlistElementDict dic53;
|
||||
dic53 = URLWhiteListArr2.AddDict();
|
||||
dic53.SetString("SKAdNetworkIdentifier", "k674qkevps.skadnetwork");
|
||||
|
||||
|
||||
PlistElementDict dic54;
|
||||
dic54 = URLWhiteListArr2.AddDict();
|
||||
dic54.SetString("SKAdNetworkIdentifier", "n6fk4nfna4.skadnetwork");
|
||||
|
||||
PlistElementDict dic55;
|
||||
dic55 = URLWhiteListArr2.AddDict();
|
||||
dic55.SetString("SKAdNetworkIdentifier", "p78axxw29g.skadnetwork");
|
||||
|
||||
PlistElementDict dic56;
|
||||
dic56 = URLWhiteListArr2.AddDict();
|
||||
dic56.SetString("SKAdNetworkIdentifier", "s39g8k73mm.skadnetwork");
|
||||
PlistElementDict dic57;
|
||||
dic57 = URLWhiteListArr2.AddDict();
|
||||
dic57.SetString("SKAdNetworkIdentifier", "uw77j35x4d.skadnetwork");
|
||||
|
||||
PlistElementDict dic58;
|
||||
dic58 = URLWhiteListArr2.AddDict();
|
||||
dic58.SetString("SKAdNetworkIdentifier", "y2ed4ez56y.skadnetwork");
|
||||
|
||||
PlistElementDict dic59;
|
||||
dic59 = URLWhiteListArr2.AddDict();
|
||||
dic59.SetString("SKAdNetworkIdentifier", "zq492l623r.skadnetwork");
|
||||
|
||||
PlistElementDict dic60;
|
||||
dic60 = URLWhiteListArr2.AddDict();
|
||||
dic60.SetString("SKAdNetworkIdentifier", "24t9a8vw3c.skadnetwork");
|
||||
|
||||
PlistElementDict dic61;
|
||||
dic61 = URLWhiteListArr2.AddDict();
|
||||
dic61.SetString("SKAdNetworkIdentifier", "32z4fx6l9h.skadnetwork");
|
||||
|
||||
PlistElementDict dic62;
|
||||
dic62 = URLWhiteListArr2.AddDict();
|
||||
dic62.SetString("SKAdNetworkIdentifier", "523jb4fst2.skadnetwork");
|
||||
|
||||
PlistElementDict dic63;
|
||||
dic63 = URLWhiteListArr2.AddDict();
|
||||
dic63.SetString("SKAdNetworkIdentifier", "54nzkqm89y.skadnetwork");
|
||||
|
||||
PlistElementDict dic64;
|
||||
dic64 = URLWhiteListArr2.AddDict();
|
||||
dic64.SetString("SKAdNetworkIdentifier", "578prtvx9j.skadnetwork");
|
||||
|
||||
PlistElementDict dic65;
|
||||
dic65 = URLWhiteListArr2.AddDict();
|
||||
dic65.SetString("SKAdNetworkIdentifier", "5l3tpt7t6e.skadnetwork");
|
||||
|
||||
PlistElementDict dic66;
|
||||
dic66 = URLWhiteListArr2.AddDict();
|
||||
dic66.SetString("SKAdNetworkIdentifier", "5lm9lj6jb7.skadnetwork");
|
||||
|
||||
PlistElementDict dic67;
|
||||
dic67 = URLWhiteListArr2.AddDict();
|
||||
dic67.SetString("SKAdNetworkIdentifier", "79pbpufp6p.skadnetwork");
|
||||
|
||||
PlistElementDict dic68;
|
||||
dic68 = URLWhiteListArr2.AddDict();
|
||||
dic68.SetString("SKAdNetworkIdentifier", "7rz58n8ntl.skadnetwork");
|
||||
|
||||
PlistElementDict dic69;
|
||||
dic69 = URLWhiteListArr2.AddDict();
|
||||
dic69.SetString("SKAdNetworkIdentifier", "n66cz3y3bx.skadnetwork");
|
||||
|
||||
PlistElementDict dic70;
|
||||
dic70 = URLWhiteListArr2.AddDict();
|
||||
dic70.SetString("SKAdNetworkIdentifier", "9b89h5y424.skadnetwork");
|
||||
|
||||
PlistElementDict dic71;
|
||||
dic71 = URLWhiteListArr2.AddDict();
|
||||
dic71.SetString("SKAdNetworkIdentifier", "9nlqeag3gk.skadnetwork");
|
||||
|
||||
PlistElementDict dic72;
|
||||
dic72 = URLWhiteListArr2.AddDict();
|
||||
dic72.SetString("SKAdNetworkIdentifier", "cg4yq2srnc.skadnetwork");
|
||||
|
||||
PlistElementDict dic73;
|
||||
dic73 = URLWhiteListArr2.AddDict();
|
||||
dic73.SetString("SKAdNetworkIdentifier", "cj5566h2ga.skadnetwork");
|
||||
|
||||
PlistElementDict dic74;
|
||||
dic74 = URLWhiteListArr2.AddDict();
|
||||
dic74.SetString("SKAdNetworkIdentifier", "5tjdwbrq8w.skadnetwork");
|
||||
PlistElementDict dic75;
|
||||
dic75 = URLWhiteListArr2.AddDict();
|
||||
dic75.SetString("SKAdNetworkIdentifier", "ejvt5qm6ak.skadnetwork");
|
||||
|
||||
PlistElementDict dic76;
|
||||
dic76 = URLWhiteListArr2.AddDict();
|
||||
dic76.SetString("SKAdNetworkIdentifier", "feyaarzu9v.skadnetwork");
|
||||
|
||||
PlistElementDict dic77;
|
||||
dic77 = URLWhiteListArr2.AddDict();
|
||||
dic77.SetString("SKAdNetworkIdentifier", "g28c52eehv.skadnetwork");
|
||||
|
||||
PlistElementDict dic78;
|
||||
dic78 = URLWhiteListArr2.AddDict();
|
||||
dic78.SetString("SKAdNetworkIdentifier", "ggvn48r87g.skadnetwork");
|
||||
|
||||
PlistElementDict dic79;
|
||||
dic79 = URLWhiteListArr2.AddDict();
|
||||
dic79.SetString("SKAdNetworkIdentifier", "mtkv5xtk9e.skadnetwork");
|
||||
|
||||
PlistElementDict dic80;
|
||||
dic80 = URLWhiteListArr2.AddDict();
|
||||
dic80.SetString("SKAdNetworkIdentifier", "n9x2a789qt.skadnetwork");
|
||||
|
||||
PlistElementDict dic81;
|
||||
dic81 = URLWhiteListArr2.AddDict();
|
||||
dic81.SetString("SKAdNetworkIdentifier", "pwa73g5rt2.skadnetwork");
|
||||
|
||||
PlistElementDict dic82;
|
||||
dic82 = URLWhiteListArr2.AddDict();
|
||||
dic82.SetString("SKAdNetworkIdentifier", "xy9t38ct57.skadnetwork");
|
||||
|
||||
PlistElementDict dic83;
|
||||
dic83 = URLWhiteListArr2.AddDict();
|
||||
dic83.SetString("SKAdNetworkIdentifier", "zmvfpc5aq8.skadnetwork");
|
||||
|
||||
PlistElementDict dic84;
|
||||
dic84 = URLWhiteListArr2.AddDict();
|
||||
dic84.SetString("SKAdNetworkIdentifier", "44n7hlldy6.skadnetwork");
|
||||
|
||||
PlistElementDict dic85;
|
||||
dic85 = URLWhiteListArr2.AddDict();
|
||||
dic85.SetString("SKAdNetworkIdentifier", "488r3q3dtq.skadnetwork");
|
||||
|
||||
PlistElementDict dic86;
|
||||
dic86 = URLWhiteListArr2.AddDict();
|
||||
dic86.SetString("SKAdNetworkIdentifier", "f73kdq92p3.skadnetwork");
|
||||
|
||||
PlistElementDict dic87;
|
||||
dic87 = URLWhiteListArr2.AddDict();
|
||||
dic87.SetString("SKAdNetworkIdentifier", "f7s53z58qe.skadnetwork");
|
||||
|
||||
PlistElementDict dic88;
|
||||
dic88 = URLWhiteListArr2.AddDict();
|
||||
dic88.SetString("SKAdNetworkIdentifier", "lr83yxwka7.skadnetwork");
|
||||
|
||||
PlistElementDict dic89;
|
||||
dic89 = URLWhiteListArr2.AddDict();
|
||||
dic89.SetString("SKAdNetworkIdentifier", "v79kvwwj4g.skadnetwork");
|
||||
|
||||
PlistElementDict dic90;
|
||||
dic90 = URLWhiteListArr2.AddDict();
|
||||
dic90.SetString("SKAdNetworkIdentifier", "7953jerfzd.skadnetwork");
|
||||
|
||||
PlistElementDict dic91;
|
||||
dic91 = URLWhiteListArr2.AddDict();
|
||||
dic91.SetString("SKAdNetworkIdentifier", "9yg77x724h.skadnetwork");
|
||||
|
||||
PlistElementDict dic92;
|
||||
dic92 = URLWhiteListArr2.AddDict();
|
||||
dic92.SetString("SKAdNetworkIdentifier", "mls7yz5dvl.skadnetwork");
|
||||
|
||||
PlistElementDict dic93;
|
||||
dic93 = URLWhiteListArr2.AddDict();
|
||||
dic93.SetString("SKAdNetworkIdentifier", "x8jxxk4ff5.skadnetwork");
|
||||
|
||||
PlistElementDict dic94;
|
||||
dic94 = URLWhiteListArr2.AddDict();
|
||||
dic94.SetString("SKAdNetworkIdentifier", "mp6xlyr22a.skadnetwork");
|
||||
|
||||
PlistElementDict dic95;
|
||||
dic95 = URLWhiteListArr2.AddDict();
|
||||
dic95.SetString("SKAdNetworkIdentifier", "x44k69ngh6.skadnetwork");
|
||||
|
||||
PlistElementDict dic96;
|
||||
dic96 = URLWhiteListArr2.AddDict();
|
||||
dic96.SetString("SKAdNetworkIdentifier", "6g9af3uyq4.skadnetwork");
|
||||
|
||||
PlistElementDict dic97;
|
||||
dic97 = URLWhiteListArr2.AddDict();
|
||||
dic97.SetString("SKAdNetworkIdentifier", "qqp299437r.skadnetwork");
|
||||
|
||||
PlistElementDict dic98;
|
||||
dic98 = URLWhiteListArr2.AddDict();
|
||||
dic98.SetString("SKAdNetworkIdentifier", "252b5q8x7y.skadnetwork");
|
||||
|
||||
PlistElementDict dic99;
|
||||
dic99 = URLWhiteListArr2.AddDict();
|
||||
dic99.SetString("SKAdNetworkIdentifier", "rx5hdcabgc.skadnetwork");
|
||||
|
||||
PlistElementDict dic100;
|
||||
dic100 = URLWhiteListArr2.AddDict();
|
||||
dic100.SetString("SKAdNetworkIdentifier", "294l99pt4k.skadnetwork");
|
||||
|
||||
PlistElementDict dic101;
|
||||
dic101 = URLWhiteListArr2.AddDict();
|
||||
dic101.SetString("SKAdNetworkIdentifier", "kbmxgpxpgc.skadnetwork");
|
||||
|
||||
PlistElementDict dic102;
|
||||
dic102 = URLWhiteListArr2.AddDict();
|
||||
dic102.SetString("SKAdNetworkIdentifier", "52fl2v3hgk.skadnetwork");
|
||||
|
||||
PlistElementDict dic103;
|
||||
dic103 = URLWhiteListArr2.AddDict();
|
||||
dic103.SetString("SKAdNetworkIdentifier", "r45fhb6rf7.skadnetwork");
|
||||
|
||||
PlistElementDict dic104;
|
||||
dic104 = URLWhiteListArr2.AddDict();
|
||||
dic104.SetString("SKAdNetworkIdentifier", "rvh3l7un93.skadnetwork");
|
||||
|
||||
PlistElementDict dic105;
|
||||
dic105 = URLWhiteListArr2.AddDict();
|
||||
dic105.SetString("SKAdNetworkIdentifier", "97r2b46745.skadnetwork");
|
||||
|
||||
PlistElementDict dic106;
|
||||
dic106 = URLWhiteListArr2.AddDict();
|
||||
dic106.SetString("SKAdNetworkIdentifier", "9g2aggbj52.skadnetwork");
|
||||
|
||||
PlistElementDict dic107;
|
||||
dic107 = URLWhiteListArr2.AddDict();
|
||||
dic107.SetString("SKAdNetworkIdentifier", "dzg6xy7pwj.skadnetwork");
|
||||
|
||||
PlistElementDict dic108;
|
||||
dic108 = URLWhiteListArr2.AddDict();
|
||||
dic108.SetString("SKAdNetworkIdentifier", "x8uqf25wch.skadnetwork");
|
||||
|
||||
PlistElementDict dic109;
|
||||
dic109 = URLWhiteListArr2.AddDict();
|
||||
dic109.SetString("SKAdNetworkIdentifier", "58922nb4gd.skadnetwork");
|
||||
|
||||
PlistElementDict dic110;
|
||||
dic110 = URLWhiteListArr2.AddDict();
|
||||
dic110.SetString("SKAdNetworkIdentifier", "gvmwg8q7h5.skadnetwork");
|
||||
|
||||
PlistElementDict dic111;
|
||||
dic111 = URLWhiteListArr2.AddDict();
|
||||
dic111.SetString("SKAdNetworkIdentifier", "hdw39hrw9y.skadnetwork");
|
||||
|
||||
PlistElementDict dic112;
|
||||
dic112 = URLWhiteListArr2.AddDict();
|
||||
dic112.SetString("SKAdNetworkIdentifier", "8c4e2ghe7u.skadnetwork");
|
||||
|
||||
PlistElementDict dic113;
|
||||
dic113 = URLWhiteListArr2.AddDict();
|
||||
dic113.SetString("SKAdNetworkIdentifier", "v4nxqhlyqp.skadnetwork");
|
||||
|
||||
PlistElementDict dic114;
|
||||
dic114 = URLWhiteListArr2.AddDict();
|
||||
dic114.SetString("SKAdNetworkIdentifier", "c3frkrj4fj.skadnetwork");
|
||||
|
||||
PlistElementDict dic115;
|
||||
dic115 = URLWhiteListArr2.AddDict();
|
||||
dic115.SetString("SKAdNetworkIdentifier", "nzq8sh4pbs.skadnetwork");
|
||||
|
||||
PlistElementDict dic116;
|
||||
dic116 = URLWhiteListArr2.AddDict();
|
||||
dic116.SetString("SKAdNetworkIdentifier", "pu4na253f3.skadnetwork");
|
||||
|
||||
PlistElementDict dic117;
|
||||
dic117 = URLWhiteListArr2.AddDict();
|
||||
dic117.SetString("SKAdNetworkIdentifier", "6964rsfnh4.skadnetwork");
|
||||
|
||||
PlistElementDict dic118;
|
||||
dic118 = URLWhiteListArr2.AddDict();
|
||||
dic118.SetString("SKAdNetworkIdentifier", "74b6s63p6l.skadnetwork");
|
||||
|
||||
PlistElementDict dic119;
|
||||
dic119 = URLWhiteListArr2.AddDict();
|
||||
dic119.SetString("SKAdNetworkIdentifier", "84993kbrcf.skadnetwork");
|
||||
|
||||
PlistElementDict dic120;
|
||||
dic120 = URLWhiteListArr2.AddDict();
|
||||
dic120.SetString("SKAdNetworkIdentifier", "y45688jllp.skadnetwork");
|
||||
|
||||
PlistElementDict dic121;
|
||||
dic121 = URLWhiteListArr2.AddDict();
|
||||
dic121.SetString("SKAdNetworkIdentifier", "yrqqpx2mcb.skadnetwork");
|
||||
|
||||
PlistElementDict dic122;
|
||||
dic122 = URLWhiteListArr2.AddDict();
|
||||
dic122.SetString("SKAdNetworkIdentifier", "z4gj7hsk7h.skadnetwork");
|
||||
|
||||
PlistElementDict dic123;
|
||||
dic123 = URLWhiteListArr2.AddDict();
|
||||
dic123.SetString("SKAdNetworkIdentifier", "u679fj5vs4.skadnetwork");
|
||||
|
||||
PlistElementDict dic124;
|
||||
dic124 = URLWhiteListArr2.AddDict();
|
||||
dic124.SetString("SKAdNetworkIdentifier", "a7xqa6mtl2.skadnetwork");
|
||||
|
||||
PlistElementDict dic125;
|
||||
dic125 = URLWhiteListArr2.AddDict();
|
||||
dic125.SetString("SKAdNetworkIdentifier", "g2y4y55b64.skadnetwork");
|
||||
|
||||
PlistElementDict dic126;
|
||||
dic126 = URLWhiteListArr2.AddDict();
|
||||
dic126.SetString("SKAdNetworkIdentifier", "pwdxu55a5a.skadnetwork");
|
||||
#endregion
|
||||
|
||||
PlistElementArray urlTypes = plist.root.CreateArray("CFBundleURLTypes");
|
||||
|
||||
PlistElementDict dict = urlTypes.AddDict();
|
||||
dict.SetString("CFBundleURLName", Application.identifier);
|
||||
PlistElementArray schemesArray = dict.CreateArray("CFBundleURLSchemes");
|
||||
schemesArray.AddString(Application.identifier);
|
||||
|
||||
File.WriteAllText(plistPath, plist.WriteToString());
|
||||
}
|
||||
|
||||
private static void ModifyBundle(string _path)
|
||||
{
|
||||
#if !AppStore_GB
|
||||
string projectPath = PBXProject.GetPBXProjectPath(_path);
|
||||
|
||||
PBXProject pbxProject = new PBXProject();
|
||||
pbxProject.ReadFromFile(projectPath);
|
||||
// 获取主 target
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
string mainTarget = pbxProject.GetUnityMainTargetGuid();
|
||||
#else
|
||||
string targetName = UnityEditor.iOS.Xcode.PBXProject.GetUnityTargetName();
|
||||
string mainTarget = pbxProject.TargetGuidByName(targetName);
|
||||
#endif
|
||||
pbxProject.AddFileToBuild(mainTarget, pbxProject.AddFile("Frameworks/Plugins/ToukaGames/Plugins/iOS/ToponSDK/Core/AnyThinkSDK.bundle", "Frameworks/Plugins/ToukaGames/Plugins/iOS/ToponSDK/Core/AnyThinkSDK.bundle", PBXSourceTree.Sdk));
|
||||
pbxProject.AddFileToBuild(mainTarget, pbxProject.AddFile("Frameworks/Plugins/ToukaGames/Plugins/iOS/ToponSDK/pangle_China/BUAdSDK.bundle", "Frameworks/Plugins/ToukaGames/Plugins/iOS/ToponSDK/pangle_China/BUAdSDK.bundle", PBXSourceTree.Sdk));
|
||||
pbxProject.WriteToFile(projectPath);
|
||||
#endif
|
||||
}
|
||||
|
||||
private static void ModifyCode(string _path)
|
||||
{
|
||||
#if !AppStore_GB
|
||||
ToukaClassHelper SplashScreenController = new ToukaClassHelper(_path + "/Classes/UI/SplashScreen.mm");
|
||||
|
||||
if (!SplashScreenController.HasBolow("#import <TKGUNITYSDK/TONativeSplashHelper.h>"))
|
||||
{
|
||||
|
||||
SplashScreenController.WriteBelow("#include \"SplashScreen.h\"", "#import <TKGUNITYSDK/TONativeSplashHelper.h>");
|
||||
SplashScreenController.WriteBelow("void HideSplashScreen()\n{", "[[TONativeSplashHelper helper]showSplashInLaunch];");
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#if USE_SPLASH
|
||||
|
||||
ToukaClassHelper SplashScreenControllers = new ToukaClassHelper(_path + "/Classes/UI/SplashScreen.mm");
|
||||
|
||||
if (!SplashScreenControllers.HasBolow("#import <TKGSplashSDK/TKGSplashManager.h>"))
|
||||
{
|
||||
|
||||
SplashScreenControllers.WriteBelow("#include \"SplashScreen.h\"", "#import <TKGSplashSDK/TKGSplashManager.h>");
|
||||
SplashScreenControllers.WriteBelow("void HideSplashScreen()\n{", "[[TKGSplashManager manager]showSplashInLaunch];");
|
||||
|
||||
}
|
||||
|
||||
ToukaClassHelper UnityAppController = new ToukaClassHelper(_path + "/Classes/UnityAppController.mm");
|
||||
if (!UnityAppController.HasBolow("[[TKGSplashManager manager] showSplashInEnterForground];"))
|
||||
{
|
||||
UnityAppController.WriteBelow("#import \"UnityAppController.h\"", "\n#import <TKGSplashSDK/TKGSplashManager.h>");
|
||||
UnityAppController.WriteBelow("UnityPause(0);", "\n[[TKGSplashManager manager] showSplashInEnterForground];");
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public partial class ToukaClassHelper
|
||||
{
|
||||
|
||||
private string filePath;
|
||||
|
||||
public ToukaClassHelper(string fPath)
|
||||
{
|
||||
filePath = fPath;
|
||||
if (!System.IO.File.Exists(filePath))
|
||||
{
|
||||
TKGDebugger.LogError(filePath + "路径下文件不存在");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void WriteBelow(string below, string text)
|
||||
{
|
||||
StreamReader streamReader = new StreamReader(filePath);
|
||||
string text_all = streamReader.ReadToEnd();
|
||||
streamReader.Close();
|
||||
|
||||
int beginIndex = text_all.IndexOf(below);
|
||||
if (beginIndex == -1)
|
||||
{
|
||||
TKGDebugger.LogError(filePath + "中没有找到标致" + below);
|
||||
return;
|
||||
}
|
||||
|
||||
int endIndex = text_all.LastIndexOf("\n", beginIndex + below.Length);
|
||||
|
||||
text_all = text_all.Substring(0, endIndex) + "\n" + text + "\n" + text_all.Substring(endIndex);
|
||||
|
||||
StreamWriter streamWriter = new StreamWriter(filePath);
|
||||
streamWriter.Write(text_all);
|
||||
streamWriter.Close();
|
||||
}
|
||||
|
||||
public void Replace(string below, string newText)
|
||||
{
|
||||
StreamReader streamReader = new StreamReader(filePath);
|
||||
string text_all = streamReader.ReadToEnd();
|
||||
streamReader.Close();
|
||||
|
||||
int beginIndex = text_all.IndexOf(below);
|
||||
if (beginIndex == -1)
|
||||
{
|
||||
TKGDebugger.LogError(filePath + "中没有找到标致" + below);
|
||||
return;
|
||||
}
|
||||
|
||||
text_all = text_all.Replace(below, newText);
|
||||
StreamWriter streamWriter = new StreamWriter(filePath);
|
||||
streamWriter.Write(text_all);
|
||||
streamWriter.Close();
|
||||
|
||||
}
|
||||
|
||||
public bool HasBolow(string below)
|
||||
{
|
||||
StreamReader streamReader = new StreamReader(filePath);
|
||||
string text_all = streamReader.ReadToEnd();
|
||||
streamReader.Close();
|
||||
|
||||
int beginIndex = text_all.IndexOf(below);
|
||||
if (beginIndex == -1)
|
||||
{
|
||||
TKGDebugger.LogDebug("[" + GetType() + "]" + filePath + "中没有找到标致" + below);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d5a192a0244ba471d9b62fcbd74eb4ae
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,221 @@
|
|||
#if UNITY_IOS
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Callbacks;
|
||||
#if UNITY_IOS
|
||||
using UnityEditor.iOS.Xcode;
|
||||
#endif
|
||||
using UnityEngine;
|
||||
|
||||
public class ToukaAnalyticsBuildPostProcessor
|
||||
{
|
||||
[PostProcessBuild]
|
||||
public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
|
||||
{
|
||||
if (buildTarget != BuildTarget.iOS) return;
|
||||
|
||||
#if UNITY_IOS
|
||||
copyConfigFile(path);
|
||||
SetTeamIdAutoSign(path);
|
||||
ModifyFrameworks(path);
|
||||
ModifyBuildSettings(path);
|
||||
|
||||
ModifyInfoPlist(path);
|
||||
|
||||
//AddLocalization(path);
|
||||
CopySplashImg(path);
|
||||
#endif
|
||||
}
|
||||
|
||||
private static void ModifyFrameworks(string _path)
|
||||
{
|
||||
#if UNITY_IOS
|
||||
string projPath = PBXProject.GetPBXProjectPath(_path);
|
||||
PBXProject proj = new PBXProject();
|
||||
|
||||
|
||||
proj.ReadFromString(File.ReadAllText(projPath));
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
string target = proj.GetUnityFrameworkTargetGuid();
|
||||
#else
|
||||
string target = proj.TargetGuidByName("Unity-iPhone");
|
||||
#endif
|
||||
|
||||
proj.AddFrameworkToProject(target, "GLKit.framework", false);
|
||||
proj.AddFrameworkToProject(target, "CoreGraphics.framework", false);
|
||||
proj.AddFrameworkToProject(target, "SystemConfiguration.framework", false);
|
||||
proj.AddFrameworkToProject(target, "Photos.framework", false);
|
||||
proj.AddFrameworkToProject(target, "AppTrackingTransparency.framework", false);
|
||||
proj.AddFrameworkToProject(target, "StoreKit.framework", false);
|
||||
proj.AddFrameworkToProject(target, "CoreData.framework", false);
|
||||
proj.AddFrameworkToProject(target, "AVFoundation.framework", false);
|
||||
proj.AddFrameworkToProject(target, "Accelerate.framework", false);
|
||||
proj.AddFrameworkToProject(target, "AdSupport.framework", false);
|
||||
proj.AddFrameworkToProject(target, "AudioToolbox.framework", false);
|
||||
proj.AddFrameworkToProject(target, "CoreLocation.framework", false);
|
||||
proj.AddFrameworkToProject(target, "CoreMedia.framework", false);
|
||||
proj.AddFrameworkToProject(target, "CoreMotion.framework", false);
|
||||
proj.AddFrameworkToProject(target, "CoreTelephony.framework", false);
|
||||
proj.AddFrameworkToProject(target, "MobileCoreServices.framework", false);
|
||||
proj.AddFrameworkToProject(target, "SafariServices.framework", false);
|
||||
proj.AddFrameworkToProject(target, "VideoToolbox.framework", false);
|
||||
proj.AddFrameworkToProject(target, "WebKit.framework", false);
|
||||
|
||||
|
||||
|
||||
string fileGuidSqlite = proj.AddFile("usr/lib/libxml2.tbd", "Libraries/libxml2.tbd", PBXSourceTree.Sdk);
|
||||
proj.AddFileToBuild(target, fileGuidSqlite);
|
||||
fileGuidSqlite = proj.AddFile("usr/lib/libsqlite3.tbd", "Libraries/libsqlite3.tbd", PBXSourceTree.Sdk);
|
||||
proj.AddFileToBuild(target, fileGuidSqlite);
|
||||
fileGuidSqlite = proj.AddFile("usr/lib/libc++.tbd", "Libraries/libc++.tbd", PBXSourceTree.Sdk);
|
||||
proj.AddFileToBuild(target, fileGuidSqlite);
|
||||
fileGuidSqlite = proj.AddFile("usr/lib/libz.tbd", "Libraries/libz.tbd", PBXSourceTree.Sdk);
|
||||
proj.AddFileToBuild(target, fileGuidSqlite);
|
||||
fileGuidSqlite = proj.AddFile("usr/lib/libresolv.tbd", "Libraries/libresolv.tbd", PBXSourceTree.Sdk);
|
||||
proj.AddFileToBuild(target, fileGuidSqlite);
|
||||
fileGuidSqlite = proj.AddFile("usr/lib/libbz2.1.0.tbd", "Libraries/libbz2.1.0.tbd", PBXSourceTree.Sdk);
|
||||
proj.AddFileToBuild(target, fileGuidSqlite);
|
||||
fileGuidSqlite = proj.AddFile("usr/lib/libresolv.9.tbd", "Libraries/libresolv.9.tbd", PBXSourceTree.Sdk);
|
||||
proj.AddFileToBuild(target, fileGuidSqlite);
|
||||
fileGuidSqlite = proj.AddFile("usr/lib/libc++abi.tbd", "Libraries/libc++abi.tbd", PBXSourceTree.Sdk);
|
||||
proj.AddFileToBuild(target, fileGuidSqlite);
|
||||
|
||||
// sdk config files
|
||||
proj.AddFileToBuild(target, proj.AddFile("tkg_config.plist", "tkg_config.plist",PBXSourceTree.Source));
|
||||
File.WriteAllText(projPath, proj.WriteToString());
|
||||
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
string mainTarget = proj.GetUnityMainTargetGuid();
|
||||
#else
|
||||
string targetName = UnityEditor.iOS.Xcode.PBXProject.GetUnityTargetName();
|
||||
string mainTarget = proj.TargetGuidByName(targetName);
|
||||
#endif
|
||||
proj.AddFileToBuild(mainTarget, proj.AddFile("tkg_config.plist", "tkg_config.plist", PBXSourceTree.Source));
|
||||
proj.WriteToFile(projPath);
|
||||
|
||||
proj.AddFileToBuild(target, proj.AddFile("tkg_sdk_config.plist", "tkg_sdk_config.plist", PBXSourceTree.Source));
|
||||
File.WriteAllText(projPath, proj.WriteToString());
|
||||
|
||||
proj.AddFileToBuild(mainTarget, proj.AddFile("tkg_sdk_config.plist", "tkg_sdk_config.plist", PBXSourceTree.Source));
|
||||
proj.WriteToFile(projPath);
|
||||
|
||||
#if AppStore_GB
|
||||
proj.AddFileToBuild(target, proj.AddFile("GoogleService-Info.plist", "GoogleService-Info.plist", PBXSourceTree.Source));
|
||||
File.WriteAllText(projPath, proj.WriteToString());
|
||||
|
||||
proj.AddFileToBuild(mainTarget, proj.AddFile("GoogleService-Info.plist", "GoogleService-Info.plist", PBXSourceTree.Source));
|
||||
proj.WriteToFile(projPath);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
private static void copyConfigFile(string path)
|
||||
{
|
||||
#if AppStore_GB
|
||||
string configPath = Application.dataPath + "/Configs/GB/tkg_config.plist";
|
||||
File.Copy(configPath, path + "/tkg_config.plist", true);
|
||||
|
||||
string sdkConfigPath = Application.dataPath + "/Configs/GB/tkg_sdk_config.plist";
|
||||
File.Copy(sdkConfigPath, path + "/tkg_sdk_config.plist", true);
|
||||
|
||||
string googlePath = Application.dataPath + "/Configs/GB/GoogleService-Info.plist";
|
||||
File.Copy(googlePath, path + "/GoogleService-Info.plist", true);
|
||||
#else
|
||||
string configPath = Application.dataPath + "/Configs/CN/tkg_config.plist";
|
||||
File.Copy(configPath, path + "/tkg_config.plist", true);
|
||||
|
||||
string sdkConfigPath = Application.dataPath + "/Configs/CN/tkg_sdk_config.plist";
|
||||
File.Copy(sdkConfigPath, path + "/tkg_sdk_config.plist", true);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
private static void ModifyBuildSettings(string _path)
|
||||
{
|
||||
#if UNITY_IOS
|
||||
string projPath = PBXProject.GetPBXProjectPath(_path);
|
||||
PBXProject proj = new PBXProject();
|
||||
proj.ReadFromString(File.ReadAllText(projPath));
|
||||
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
string target = proj.GetUnityFrameworkTargetGuid();
|
||||
#else
|
||||
string target = proj.TargetGuidByName("Unity-iPhone");
|
||||
#endif
|
||||
|
||||
proj.AddBuildProperty(target, "OTHER_LDFLAGS", "-ObjC");
|
||||
proj.SetBuildProperty(target, "ENABLE_BITCODE", "NO");
|
||||
proj.SetBuildProperty(target, "GCC_C_LANGUAGE_STANDARD", "gnu11");
|
||||
|
||||
|
||||
File.WriteAllText(projPath, proj.WriteToString());
|
||||
#endif
|
||||
}
|
||||
|
||||
private static void SetTeamIdAutoSign(string _path)
|
||||
{
|
||||
#if UNITY_IOS
|
||||
string projPath = PBXProject.GetPBXProjectPath(_path);
|
||||
PBXProject proj = new PBXProject();
|
||||
proj.ReadFromString(File.ReadAllText(projPath));
|
||||
File.WriteAllText(projPath, proj.WriteToString());
|
||||
#endif
|
||||
}
|
||||
|
||||
private static void ModifyInfoPlist(string _path)
|
||||
{
|
||||
#if UNITY_IOS
|
||||
//2、修改Info.plist文件
|
||||
var plistPath = Path.Combine(_path, "Info.plist");
|
||||
var plist = new PlistDocument();
|
||||
plist.ReadFromFile(plistPath);
|
||||
#if !AppStore_GB
|
||||
plist.root.SetString("NSLocationAlwaysUsageDescription", "为了更好的体验游戏");
|
||||
plist.root.SetString("NSLocationWhenInUseUsageDescription", "为了更好的体验游戏");
|
||||
plist.root.SetString("NSUserTrackingUsageDescription", "该标识符将用于向您投放个性化广告");
|
||||
plist.root.SetString("NSPhotoLibraryUsageDescription", "为了更好的体验游戏,请允许APP保存图片到您的相册");
|
||||
#else
|
||||
plist.root.SetString ("NSLocationAlwaysUsageDescription", "for better experience the game");
|
||||
plist.root.SetString ("NSLocationWhenInUseUsageDescription", "for better experience the game");
|
||||
plist.root.SetString("NSUserTrackingUsageDescription", "This identifier will be used to deliver personalized ads to you.");
|
||||
plist.root.SetString("NSPhotoLibraryUsageDescription", "In order to experience the game better, please allow the APP to save pictures to your album.");
|
||||
|
||||
#endif
|
||||
File.WriteAllText(plistPath, plist.WriteToString());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
// static void AddLocalization(string path)
|
||||
// {
|
||||
//#if !NO_SDK
|
||||
// string pliststringPath = Application.dataPath + "/TKGSDK/UnitySDK/Plugins/ToukaGames/iOS/CommonPackage/lang/infoplist";
|
||||
// NativeLocale.AddLocalizedStringsIOS(path, pliststringPath);
|
||||
//#endif
|
||||
// }
|
||||
|
||||
static void CopySplashImg(string path)
|
||||
{
|
||||
#if !AppStore_GB
|
||||
string splashImgPath = Application.dataPath + "/TKGSDK/Splash/CN/LaunchScreen-iPhonePortrait.png";
|
||||
File.Copy(splashImgPath, path + "/LaunchScreen-iPhonePortrait.png", true);
|
||||
|
||||
string splashImgPathIpad = Application.dataPath + "/TKGSDK/Splash/CN/LaunchScreen-iPad.png";
|
||||
File.Copy(splashImgPathIpad, path + "/LaunchScreen-iPad.png", true);
|
||||
#else
|
||||
|
||||
string splashImgPath = Application.dataPath + "/TKGSDK/Splash/GB/LaunchScreen-iPhonePortrait.png";
|
||||
File.Copy(splashImgPath, path + "/LaunchScreen-iPhonePortrait.png", true);
|
||||
|
||||
string splashImgPathIpad = Application.dataPath + "/TKGSDK/Splash/GB/LaunchScreen-iPad.png";
|
||||
File.Copy(splashImgPathIpad, path + "/LaunchScreen-iPad.png", true);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1c02797fe6f3e4bdea04105d52492716
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,208 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace Touka
|
||||
{
|
||||
public class ToukaEditor
|
||||
{
|
||||
static string assetPath = Application.dataPath;
|
||||
static string maxPath = assetPath + "/Plugins/ToukaGames/ADSSDK/MAXSDKs";
|
||||
static string toponPath = assetPath + "/Plugins/ToukaGames/ADSSDK/ToponSDK";
|
||||
static string maxPathX = assetPath + "/Plugins/ToukaGames/ADSSDK/MAXSDKs~";
|
||||
static string toponPathX = assetPath + "/Plugins/ToukaGames/ADSSDK/ToponSDK~";
|
||||
|
||||
[MenuItem("ToukaGames/ClearPlayerPrefs", priority = 1)]
|
||||
public static void ClearPlayerPrefs()
|
||||
{
|
||||
PlayerPrefs.DeleteAll();
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
|
||||
[MenuItem("ToukaGames/Settings For IOS CN", priority=1001)]
|
||||
public static void SetIOSCNTOPONSeting()
|
||||
{
|
||||
#if UNITY_IOS
|
||||
SetAPPSetting(AppChannel.AppStore_CN);
|
||||
#endif
|
||||
}
|
||||
|
||||
[MenuItem("ToukaGames/Settings For Android CN", priority = 1002)]
|
||||
public static void SetAndroidCNSeting()
|
||||
{
|
||||
#if UNITY_ANDROID
|
||||
SetAPPSetting(AppChannel.GW002);
|
||||
#endif
|
||||
}
|
||||
|
||||
[MenuItem("ToukaGames/Settings For IOS GB", priority = 10001)]
|
||||
public static void SetIOSUSSeting()
|
||||
{
|
||||
#if UNITY_IOS
|
||||
SetAPPSetting(AppChannel.AppStore_GB);
|
||||
#endif
|
||||
}
|
||||
|
||||
[MenuItem("ToukaGames/Settings For Android GB", priority = 10002)]
|
||||
public static void SetAndroidGPSeting()
|
||||
{
|
||||
#if UNITY_ANDROID
|
||||
|
||||
SetAPPSetting(AppChannel.GooglePlay);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region inner
|
||||
|
||||
/// <summary>
|
||||
/// Set APP Setting
|
||||
/// </summary>
|
||||
/// <param name="_appChannelSymbol"></param>
|
||||
public static void SetAPPSetting(AppChannel _appChannel)
|
||||
{
|
||||
Debug.Log("SetAPPSetting _appChannel : " + _appChannel);
|
||||
#if UNITY_IOS
|
||||
// bundle id
|
||||
if(_appChannel == AppChannel.AppStore_CN || _appChannel == AppChannel.AppStore_GB)
|
||||
{
|
||||
Debug.Log("SetAPPSetting 01 ----- _AppChannelSymbol : " + _appChannel);
|
||||
PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.iOS, TKGLoadConfig.GetConfigByKey(ConfigKeys.KEY_BunldId, _appChannel));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if UNITY_ANDROID
|
||||
Debug.Log("SetAPPSetting 02 android ----- _AppChannelSymbol : " + _appChannel);
|
||||
PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android, TKGLoadConfig.GetConfigByKey(ConfigKeys.KEY_BunldId, _appChannel));
|
||||
#endif
|
||||
|
||||
// game name
|
||||
PlayerSettings.productName = TKGLoadConfig.GetConfigByKey(ConfigKeys.KEY_AppName, _appChannel);
|
||||
Debug.Log("productName : " + PlayerSettings.productName);
|
||||
|
||||
// ScriptingDefineSymbols & ads sdks
|
||||
ChangeDefineSymbols(_appChannel);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// change define symbols
|
||||
/// </summary>
|
||||
/// <param name="_isCN"></param>
|
||||
private static void ChangeDefineSymbols(AppChannel _appChannel)
|
||||
{
|
||||
BuildTargetGroup buildTargetGroup = EditorUserBuildSettings.selectedBuildTargetGroup;
|
||||
string symbolsStr = PlayerSettings.GetScriptingDefineSymbolsForGroup(buildTargetGroup);
|
||||
Debug.Log("symbolsStr : " + symbolsStr);
|
||||
|
||||
string[] symbols = symbolsStr.Split(';');
|
||||
HashSet<string> symbolSet = new HashSet<string>();
|
||||
for (int i = 0; i < symbols.Length; ++i)
|
||||
{
|
||||
if (!symbolSet.Contains(symbols[i]))
|
||||
{
|
||||
symbolSet.Add(symbols[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// remove all
|
||||
if (symbolSet.Contains(AppChannel.AppStore_CN.ToString()))
|
||||
{
|
||||
symbolSet.Remove(AppChannel.AppStore_CN.ToString());
|
||||
}
|
||||
|
||||
if (symbolSet.Contains(AppChannel.AppStore_GB.ToString()))
|
||||
{
|
||||
symbolSet.Remove(AppChannel.AppStore_GB.ToString());
|
||||
}
|
||||
|
||||
if (symbolSet.Contains(AppChannel.GooglePlay.ToString()))
|
||||
{
|
||||
symbolSet.Remove(AppChannel.GooglePlay.ToString());
|
||||
}
|
||||
|
||||
if (symbolSet.Contains(AppChannel.GW002.ToString()))
|
||||
{
|
||||
symbolSet.Remove(AppChannel.GW002.ToString());
|
||||
}
|
||||
|
||||
// set new
|
||||
if (_appChannel == AppChannel.AppStore_GB || _appChannel == AppChannel.GooglePlay)
|
||||
{
|
||||
symbolSet.Add(_appChannel.ToString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
// save data
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (string s in symbolSet)
|
||||
{
|
||||
sb.Append(s + ";");
|
||||
}
|
||||
PlayerSettings.SetScriptingDefineSymbolsForGroup(buildTargetGroup, sb.ToString());
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// SeIOSSDKDir
|
||||
/// </summary>
|
||||
/// <param name="_AppChannelSymbol"></param>
|
||||
private static void SeIOSSDKDir(AppChannel _AppChannelSymbol)
|
||||
{
|
||||
if (_AppChannelSymbol == AppChannel.AppStore_CN) // iOS CN
|
||||
{
|
||||
if (Directory.Exists(maxPath))
|
||||
{
|
||||
ChangePathName(maxPath, maxPathX);
|
||||
}
|
||||
|
||||
if (!Directory.Exists(toponPath))
|
||||
{
|
||||
if (Directory.Exists(toponPathX))
|
||||
{
|
||||
ChangePathName(toponPathX, toponPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_AppChannelSymbol == AppChannel.AppStore_GB) // iOS GB
|
||||
{
|
||||
if (Directory.Exists(toponPath))
|
||||
{
|
||||
ChangePathName(toponPath, toponPathX);
|
||||
}
|
||||
|
||||
if (!Directory.Exists(maxPath))
|
||||
{
|
||||
if (Directory.Exists(maxPathX))
|
||||
{
|
||||
ChangePathName(maxPathX, maxPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TKGDebugger.LogDebug("other channel");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// change path name
|
||||
/// </summary>
|
||||
/// <param name="_oldPath"></param>
|
||||
/// <param name="_newPath"></param>
|
||||
private static void ChangePathName(string _oldPath, string _newPath)
|
||||
{
|
||||
System.IO.File.Move(_oldPath, _newPath);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 715e90528ea174aef907d1f891638973
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bc968b79be21f4edc9adab0ca6fba537
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: eed640b9c819040d39a8835cc0c84f43
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue