Compare commits

...

417 Commits

Author SHA1 Message Date
aebe27cfea 暂存 2021-11-14 13:55:02 +08:00
8155e6bc3d Merge remote-tracking branch 'origin/dev_release' into dev_release 2021-11-12 16:54:59 +08:00
492040d382 去掉ping和單點登錄前端 2021-11-12 16:54:55 +08:00
e14a683f62 1478泰国时区问题 2021-11-12 16:53:45 +08:00
d754ff3b15 app center;增加發送ping的秒 2021-11-12 16:21:13 +08:00
1bd1ffdb5a 重骑传参微调 2021-11-11 17:45:02 +08:00
c50c229e30 微调 2021-11-11 17:14:05 +08:00
50b46c5b76 伴侣骑行继续骑 2021-11-11 15:55:58 +08:00
8e88b4adba 地球null问题,隐藏划船机 2021-11-09 16:47:21 +08:00
609e4dc367 延迟问题解决 2021-11-09 11:37:10 +08:00
9a545f00f4 修改细节 2021-11-08 13:07:08 +08:00
baab5a9fb0 修改细节 2021-11-03 13:48:53 +08:00
e8a12452ca Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_release 2021-11-03 09:52:51 +08:00
f92b623349 暂存 2021-11-03 09:52:03 +08:00
a9fc25defb 解决大地球收藏问题&单人骑行切换地图海拔图位置问题和地图不全 2021-11-02 14:38:05 +08:00
558fb16160 增加编号,loading页提示,延迟毫秒 2021-11-01 11:04:22 +08:00
b9aa0131cc 划船机保存前读秒 2021-10-25 16:13:04 +08:00
eb21914fb7 划船机其他细节 2021-10-22 18:18:26 +08:00
a4e17a56d0 划船机停止逻辑,切换图标 2021-10-21 18:04:33 +08:00
e503443f22 Merge branch 'dev_rower' into dev_release
# Conflicts:
#	Assets/Scenes/Login-Mobile.unity
2021-10-20 15:12:05 +08:00
3a834fca08 ios审核先屏蔽第三方登录 2021-10-20 14:58:37 +08:00
8f8ee0b833 android11跳转 2021-10-20 13:32:43 +08:00
26e4e81402 暂存 2021-10-20 10:20:12 +08:00
b075279a14 增加搜索框,ios图片名重复问题 2021-10-18 14:03:26 +08:00
f731494396 pc兼容 2021-10-15 09:54:23 +08:00
dd4157cbc2 一些设置 2021-10-15 09:29:05 +08:00
05f6c8a08b 微信注册样式问题 2021-10-14 14:04:44 +08:00
3c540dece4 修改细节 2021-10-13 19:03:22 +08:00
d8adb8a5b8 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_release 2021-10-13 11:29:14 +08:00
9be2e77ae5 设备连接页面检测定位服务 2021-10-13 11:29:09 +08:00
0560d0f278 继续骑微调 2021-10-13 10:44:17 +08:00
efd1795e63 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_release 2021-10-12 20:51:07 +08:00
4d404b9162 赛事观察者切换视角尾巴问题 2021-10-12 20:43:33 +08:00
f0314adb27 隐藏划船机 2021-10-12 20:26:41 +08:00
2f0291836e ios以及bug处理 2021-10-12 20:26:25 +08:00
d4326ffb42 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_release 2021-10-12 20:11:18 +08:00
44ff898f8d 更新弹窗 2021-10-12 20:07:13 +08:00
f3da1a5575 继续骑行隐藏右边影子选择面板 2021-10-12 15:26:58 +08:00
c19b8630cf 修改loading序列帧 2021-10-11 13:25:37 +08:00
55d7304de1 pc打包错误 2021-10-09 15:05:41 +08:00
f1ddde8a2e Merge branch 'dev_mobile' into dev_gesture 2021-10-09 10:45:56 +08:00
cad2e92fd2 编辑页面手势应用 2021-10-09 10:42:27 +08:00
4aa6178495 赛事卡片bug修正 2021-10-08 17:04:55 +08:00
fd8f419f09 手势插件引入暂存 2021-10-08 16:03:55 +08:00
6d1bc8e2c8 暂存 2021-10-08 15:22:20 +08:00
d035361718 ios端时间格式错误问题 2021-09-30 17:09:52 +08:00
6501284bbc 地球收藏问题,ios 蓝牙有返回值处理,划船机倒计时1时重置 2021-09-30 15:23:40 +08:00
9511e30e50 蓝牙问题 2021-09-30 09:06:35 +08:00
561ad993b8 调整动画和chart图标细节,重置命令 2021-09-29 14:37:43 +08:00
8d8fd59a80 修改细节 2021-09-28 20:35:16 +08:00
b74c3b57b4 倒计时;三按钮弹窗 2021-09-28 17:51:58 +08:00
85e0a13f08 增加选择页,修改记录列表pc兼容 2021-09-28 15:25:52 +08:00
8802676b98 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile 2021-09-28 11:31:11 +08:00
486b385c84 列表搜索调整 2021-09-28 11:30:51 +08:00
5bd1c3b1ca Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile
# Conflicts:
#	Assets/Scripts/Scenes/MainController.cs
2021-09-28 11:30:08 +08:00
c73545d912 划船机暂存 2021-09-28 11:27:24 +08:00
75900ccf3d 修复海拔图头像切换以及移动错位问题 2021-09-27 18:43:41 +08:00
65e7d9c4f4 优化赛事人数多卡的问题&解决蓝牙连接133错误码 2021-09-24 19:16:40 +08:00
1c73701e73 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile 2021-09-17 22:20:47 +08:00
125e9a48c6 赛事排名微调 2021-09-17 22:20:05 +08:00
9eab7c847b 苹果横屏翻转 2021-09-17 20:21:45 +08:00
f35dea5c6a Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile 2021-09-17 18:51:33 +08:00
18b330fa30 两个平台屏幕可转 2021-09-17 18:50:50 +08:00
211967dda2 骑行字体微调 2021-09-17 18:37:58 +08:00
edf0313155 微调 2021-09-17 18:31:00 +08:00
62e88668e0 修复影子选手隐藏后仍然可以点击问题 2021-09-17 14:18:50 +08:00
b89322c59b 合并ant速度计修改和界面微调 2021-09-17 11:37:42 +08:00
a67602b00b Merge remote-tracking branch 'origin/fit_speed_device' into dev_mobile_ble
# Conflicts:
#	Assets/Scripts/Devices/Ble/Devices/SpeedCadence.cs
2021-09-17 09:42:27 +08:00
65f2b0af0a 判断int型异常 2021-09-17 09:35:15 +08:00
40b6205abc Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile 2021-09-16 20:35:25 +08:00
9b0c86aefb watch按钮只读样式 2021-09-16 20:35:12 +08:00
e6e519d166 赛事提醒样式微调 2021-09-16 20:12:13 +08:00
750d9107b4 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile 2021-09-16 19:50:38 +08:00
26250f3e47 iphone7以下光圈去掉 2021-09-16 19:49:45 +08:00
a999bf1b72 解决大地图移动后选中线路不显示卡片 2021-09-16 19:48:56 +08:00
806116af19 修改样式 2021-09-16 17:09:40 +08:00
58fe43d59f Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble 2021-09-16 16:25:26 +08:00
27881fbb6b 切换app调整 2021-09-16 16:24:54 +08:00
8fde11f985 赛事结果页面和赛事怕排行界面微调 2021-09-16 16:21:52 +08:00
bd8089d0a9 微调 2021-09-16 15:59:08 +08:00
1b7e585027 修改包名 2021-09-16 15:36:36 +08:00
d7486c920c Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble 2021-09-15 21:16:30 +08:00
8c7a9afaa3 取消开始应用请求权限;淡入淡出ios 2021-09-15 21:11:21 +08:00
49c264ff36 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile 2021-09-15 20:06:35 +08:00
6640780c93 Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble 2021-09-15 19:56:38 +08:00
b5c78aba4f 解决地球不能点击滑动&蓝牙踏频增加初始轮径&骑行灵敏度设置增宽 2021-09-15 19:55:50 +08:00
7d4617eca6 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile 2021-09-15 19:30:47 +08:00
48397f3d1d 修改细节,安卓一进应用请求权限 2021-09-15 19:30:41 +08:00
ad26419654 设备连接微调 2021-09-15 14:17:11 +08:00
15015f83a8 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile
# Conflicts:
#	Assets/Scripts/App.cs
2021-09-15 10:45:53 +08:00
6fa4504e46 替换图片,push问题,ios配置,常亮 2021-09-15 10:45:11 +08:00
afb8c358f5 解决场景变慢的原因 2021-09-15 09:26:41 +08:00
0b1247249d Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble 2021-09-14 11:18:35 +08:00
7bd058004d 骑行和设备连接图标&发送tcp带上客户端版本号 2021-09-14 11:18:04 +08:00
e84f14250b 比赛卡片效果修改;useragent修改;微信错误提示 2021-09-14 11:14:51 +08:00
ae6769e24f 合并微调 2021-09-13 18:30:38 +08:00
939d6f1d0c Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble
# Conflicts:
#	Assets/Scenes/Login-Mobile.unity
2021-09-13 18:28:05 +08:00
dfb80658dd 登录增加loading&赛事提醒修改 2021-09-13 18:21:43 +08:00
969835e4d7 微信登录接入;卡片点击效果 2021-09-13 17:33:58 +08:00
51cea743be 骑行界面图标微调 2021-09-09 16:41:36 +08:00
ca51e06d37 Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble 2021-09-09 16:32:17 +08:00
ee1114e2cf 解决累计爬升不准问题&本地文件记录样式 2021-09-09 16:29:22 +08:00
f1f982b90c iosbug;android不需要导出项目;修改样式;可修改头像 2021-09-09 15:44:28 +08:00
50ad74bb09 赛事角标刷新;处理弹窗层次问题 2021-09-08 17:53:43 +08:00
5a148c28a8 赛事筛选;微信角标切口;选择图片功能权限问题
选择图片功能权限问题,需先导出项目,将res/xml文件夹复制到unitylibrary的res文件夹下
2021-09-08 10:29:20 +08:00
8a4657c11c Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble 2021-09-07 16:13:12 +08:00
b86cb01ea2 修改样式,增加图片 2021-09-07 16:12:16 +08:00
99081519bb 骑行界面&赛事界面调整&设备断开功能 2021-09-07 16:11:15 +08:00
fe65b83c89 ios选择图片功能,结果列表扩大 2021-09-07 15:26:43 +08:00
510cd11049 意见反馈增加图片 2021-09-07 11:14:42 +08:00
b11c5de681 修改样式 2021-09-06 17:50:01 +08:00
467a6f3810 Merge remote-tracking branch 'origin/dev_m1' into dev_mobile_ble
# Conflicts:
#	Assets/Scripts/App.cs
2021-09-03 15:12:01 +08:00
169b9719f6 图片改名 2021-09-03 15:10:18 +08:00
1254414415 修改细节 2021-09-03 15:03:54 +08:00
7af935118e 赛事界面&骑行界面调整 2021-09-03 13:06:26 +08:00
3fb8aee922 骑行界面细节调整 2021-09-02 11:04:50 +08:00
c280408192 Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble
# Conflicts:
#	Assets/Scripts/App.cs
#	Assets/Scripts/Mobile/WeChatController.cs
2021-09-02 10:10:06 +08:00
c5586b3eb1 单人骑行界面 2021-09-02 10:08:46 +08:00
2663068574 地球页面;反馈页面样式修改 2021-09-01 16:14:45 +08:00
3ec6fd0569 比赛;编辑页面 2021-08-31 17:11:43 +08:00
cdccd78602 设备连接界面完善 2021-08-31 16:27:36 +08:00
3a360d3437 附近的人逻辑优化&Android进入骑行提示开启定位服务问题修复 2021-08-31 14:24:08 +08:00
29aef943b9 适配速度计和踏频计 2021-08-31 09:09:49 +08:00
99540eb1fd ios蓝牙适配 2021-08-30 18:28:26 +08:00
85130ce6c3 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile
# Conflicts:
#	Assets/Scripts/Scenes/MainController.cs
2021-08-27 10:13:17 +08:00
428a7c5507 暫存 2021-08-27 10:12:50 +08:00
d8927ceca5 蓝牙停止扫描和一些bug修复 2021-08-26 19:33:43 +08:00
f21b83697b 暂存 2021-08-26 15:49:06 +08:00
723c881790 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile 2021-08-26 09:29:42 +08:00
e1a85eeb5e 结果列表页,用户页 2021-08-26 09:29:35 +08:00
0139cbc173 Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble 2021-08-25 16:09:18 +08:00
eb87fe07aa 设备连接页面调整 2021-08-25 16:07:26 +08:00
89e3a04fe9 暂存 2021-08-25 15:35:41 +08:00
92c8f246b8 Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble 2021-08-25 11:22:23 +08:00
bb08b6b762 tcp库更新&附近人下拉调整 2021-08-25 11:20:59 +08:00
88beff5b89 条件编译报错问题 2021-08-25 10:31:20 +08:00
f155b2b627 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile
# Conflicts:
#	Assets/Plugins/Android/AndroidManifest.xml
#	Assets/Plugins/Android/AndroidManifest.xml.meta
#	Assets/Plugins/iOS.meta
#	Assets/Scripts/App.cs
#	Assets/Scripts/Devices/MainDeviceAdapter.cs
#	Assets/Scripts/Scenes/LoginController.cs
#	Assets/Scripts/Scenes/Ride/Scripts/PlayerController.cs
2021-08-25 10:23:51 +08:00
341195d78d 暂存 2021-08-25 10:20:33 +08:00
3de8b1d555 移动端蓝牙设备正常骑行 2021-08-24 18:34:41 +08:00
3c9d489c76 增加移动端界面暂存 2021-08-24 17:50:14 +08:00
31e8e3bebb 移动端微信接入 2021-08-24 09:28:46 +08:00
d6c3ea2007 插件文件上传 2021-08-20 19:01:24 +08:00
6fab61f97d 移动端蓝牙框架初步导入 2021-08-20 18:45:16 +08:00
f6740d31bb Merge branch 'dev_lishuo' into dev_mobile 2021-08-19 18:11:12 +08:00
81a18de9f4 蓝牙抽象成接口 2021-08-19 18:03:25 +08:00
ca91f45ef3 切换移动端暂存 2021-08-19 16:28:57 +08:00
f14a071179 修改字 2021-08-19 16:24:54 +08:00
688c12b28e Merge branch 'dev_lishuo' of https://gitlab.com/rhino4biz/powerfun/powerfun-unity into dev_lishuo 2021-08-19 14:10:11 +08:00
f39500c560 附近的人删除逻辑 2021-08-19 14:09:42 +08:00
34a2c0bbb2 稍微逻辑修改 2021-08-19 13:23:22 +08:00
dd669d74f5 线路列表排序增加near下拉项 2021-08-19 11:24:57 +08:00
a6f673f805 设备连接速度踏频计title和logo显示问题 2021-08-18 10:46:00 +08:00
49da1493d5 nearby重合问题&线路排序修改&显示赛事编号 2021-08-17 18:43:41 +08:00
35b5ab59d3 切换移动端暂存 2021-08-13 17:19:02 +08:00
11e9acdb14 修复单人骑行ridingtime差一秒 2021-08-12 18:57:30 +08:00
906dc7dec8 闪动问题 2021-08-12 16:29:00 +08:00
3902865658 Merge remote-tracking branch 'origin/dev_lishuo' into dev_cyp 2021-08-12 13:24:38 +08:00
32b6e28736 修复右边排名问题 2021-08-12 13:24:00 +08:00
25dcf0fde3 序列帧缺失问题 2021-08-12 11:22:37 +08:00
c91bf7ae2f Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-08-12 10:04:28 +08:00
a9530096e4 tcp逻辑微调 2021-08-12 10:04:01 +08:00
bb8a0712b7 处理空广告页情况 2021-08-12 10:03:29 +08:00
570bd1554f 微调 2021-08-11 16:56:17 +08:00
3fcc6c0489 人物动画调整&网页url移除#号&riding time 差一秒的问题 2021-08-11 10:30:23 +08:00
c717b93169 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-08-10 16:36:33 +08:00
5642d3f1c9 赛事微调&mapbox sqlite dll 更新 2021-08-10 16:36:13 +08:00
81a7af517a 修改台湾旗帜 2021-08-10 09:41:14 +08:00
40bb16a132 修改all race跳到顶上的bug 2021-08-09 17:11:14 +08:00
7a1042d184 修改细节 2021-08-09 16:32:47 +08:00
9f19e951cc Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-30 20:45:51 +08:00
317f7c6d8c cookie bug 2021-07-30 20:44:45 +08:00
8b5070214e Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-30 20:40:30 +08:00
fe2c0280dc cookiebug修改 2021-07-30 20:39:23 +08:00
b8a5982bc5 微调 2021-07-30 19:39:01 +08:00
da4fed58b0 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-30 18:08:49 +08:00
ea70e04ec0 提高骑行时间精准度和一些细节调整 2021-07-30 18:08:31 +08:00
be677e766d 切換背景圖 2021-07-30 17:42:41 +08:00
07a7a95aa8 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-30 15:39:59 +08:00
074200cb4f 倒计时的算法及界面调整 2021-07-30 15:38:40 +08:00
b4e97d5514 Race按钮恢复原样,增加是否创建比赛 2021-07-30 15:38:14 +08:00
bea0e40ec1 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-30 09:54:06 +08:00
12838266ba 骑行结束时间误差问题解决 2021-07-30 09:53:49 +08:00
44c1b771f7 status=0情况 2021-07-29 21:15:26 +08:00
3c6edc624b 修改結束狀態按钮 2021-07-29 20:58:48 +08:00
1919370a23 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-29 20:01:52 +08:00
9ab8165630 消息通知bug&赛事界面调整 2021-07-29 20:01:38 +08:00
7884e7ac7e 修改细节 2021-07-29 19:55:29 +08:00
50fd9c3af6 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-29 16:13:39 +08:00
33df128750 修复小人移动动画显示异常和一些界面调整 2021-07-29 16:13:23 +08:00
edce9c676d 修改细节 2021-07-29 15:45:44 +08:00
6ab3ee19f2 修改细节 2021-07-29 13:55:33 +08:00
b9db3325a8 微调 2021-07-29 09:26:19 +08:00
b8ffdcbffe Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-28 21:12:06 +08:00
09f72d10bd 英文文案调整 2021-07-28 21:11:46 +08:00
5c96b10385 下载速度,修改文案 2021-07-28 21:09:48 +08:00
7d0a4fbd97 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-28 18:56:37 +08:00
c96cdbb163 英文文案调整 2021-07-28 18:56:23 +08:00
abf913b467 修改细节 2021-07-28 18:41:40 +08:00
978debcd23 修复比赛结束时观察者模式看不到结果&观察者不用连接设备 2021-07-28 16:30:07 +08:00
4a8239a2db Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo
# Conflicts:
#	Assets/Scripts/Apis/Models/MapCompetition.cs
2021-07-28 15:01:40 +08:00
952e5038ed 修改细节 2021-07-28 14:59:21 +08:00
3307d96ff3 修复重现时间没有转换成本地时间的bug 2021-07-28 14:57:11 +08:00
ea717ccdb8 海拔图小头像&比赛状态实时刷新 2021-07-28 14:00:03 +08:00
e29f0a8116 比赛进行中前后面板微调,修复比赛一直处于开始状态的bug 2021-07-27 20:35:23 +08:00
cfcb302a31 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-27 19:34:44 +08:00
0eb399be9a 赛事loading页面状态实时变化和一些微调 2021-07-27 19:34:33 +08:00
ca938ab6f5 修改细节 2021-07-27 18:36:49 +08:00
ea79b6cfc5 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-27 13:29:55 +08:00
c9b5520331 赛事loading页面按钮可用性调整 2021-07-27 13:29:41 +08:00
164db7c013 修改卡片样式 2021-07-27 13:28:00 +08:00
d4ae01cd32 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-27 09:18:49 +08:00
17f2b1cedd 赛事消息通知面板和界面微调 2021-07-27 09:18:34 +08:00
ab9b6a86f3 样式调整 2021-07-26 19:50:10 +08:00
7d0128d912 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo
# Conflicts:
#	Assets/Scripts/UI/Prefab/Race/RaceButtonGroupScript.cs
2021-07-26 14:11:10 +08:00
1f3485846f 细节调整 2021-07-26 14:09:21 +08:00
929fb0a1a7 修改细节 2021-07-26 14:08:43 +08:00
ac59808915 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo
# Conflicts:
#	Assets/Scripts/Apis/Models/MapCompetition.cs
#	Assets/Scripts/UI/Prefab/Race/RaceButtonGroupScript.cs
2021-07-23 18:11:58 +08:00
7f8ac10d47 合并后微调,增加赛事提醒功能 2021-07-23 18:07:12 +08:00
b93fbd2f2e 加链接,文件位置 2021-07-23 17:59:38 +08:00
ae3f9d2101 一些细节修改 2021-07-23 15:04:46 +08:00
21529db9dc Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-23 10:18:23 +08:00
1c2afb4125 增加一些图片,enter数据源 2021-07-23 10:02:09 +08:00
d18ff09002 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo
# Conflicts:
#	Assets/Scripts/Apis/Models/MapCompetition.cs
2021-07-23 09:43:46 +08:00
d9d66ab96c 赛事首页和列表 2021-07-23 09:41:20 +08:00
e76b5c443f 赛事功能完善
创建比赛按钮;loading页面more按钮等
2021-07-23 09:04:56 +08:00
eed2d13624 loading页&结果页面&代码结构微调 2021-07-16 18:37:02 +08:00
eb1803c9ef 赛事逻辑细节调整 2021-07-09 18:16:50 +08:00
b2a527f518 观察者TCP通信对接,实时列表优化,观察者模式界面显示逻辑 2021-07-06 18:24:15 +08:00
d6a7cd798f tcp逻辑调整,历史逻辑增加赛事相关派生类 2021-07-01 18:41:35 +08:00
ec45246aa4 骑行代码迁移,赛事逻辑初步框架完成 2021-06-29 18:03:20 +08:00
380e67cc1e 完成比赛相关接口&历史代码整合 2021-06-24 18:19:28 +08:00
58ec860669 结果页面日期格式修正 2021-06-22 17:46:07 +08:00
858b76d4d2 解决utc时间问题 2021-06-22 13:50:08 +08:00
2f8318b24e Revert "修复其骑行记录详情URL错误"
This reverts commit 23d049d176ba581562a5e8c3b7719b043d9afd95.
2021-06-22 10:04:08 +08:00
23d049d176 修复其骑行记录详情URL错误 2021-06-22 09:56:28 +08:00
6ad01c50df 路书上在线的人过滤掉比赛中的用户,获取服务器UTC时间转换成当地时间 2021-06-18 18:26:25 +08:00
dcc65cdd86 骑行记录详细页面跳转附加token 2021-06-16 18:12:58 +08:00
3f718f1490 地球列表下拉动作修改 2021-06-11 10:57:04 +08:00
ebe3dc11e6 解决设备页标题显示错误的问题 2021-06-10 19:11:14 +08:00
8dfd4d696c 骑行页面增加错误诊断,解决视角切换箭头位置回到起点问题 2021-06-10 18:14:14 +08:00
734893ff83 支持蓝牙可用状态变更。搜索不到设备自动停止当前线程。 2021-06-10 17:46:43 +08:00
dd474f1f61 Merge remote-tracking branch 'origin/dev_lishuo' into dev 2021-06-09 19:56:26 +08:00
936d325cf9 解决法语修改个人体重小数点不报错以及首页卡路里为0 2021-06-09 19:44:06 +08:00
5f7cc43593 解决蓝牙设备丢失以后状态不变的问题 2021-06-09 18:16:35 +08:00
15e440715d 年月日改成日月年 2021-06-09 17:29:38 +08:00
abd35810bc 附近的人区域处理,骑行结果页面标题大小写问题 2021-06-09 17:17:11 +08:00
5ec6f4caca Merge remote-tracking branch 'origin/dev' into dev_lishuo 2021-06-09 15:22:52 +08:00
25c866d090 修改连接设备界面;修改大地图在panel上缩放大地图也缩放的问题 2021-06-09 11:27:11 +08:00
4064d4294a 解决切换视角地图高度变化的问题 2021-06-08 17:39:51 +08:00
541aefe4dd 蓝牙监听调整 2021-06-08 16:28:00 +08:00
1020632757 Merge remote-tracking branch 'origin/dev_lishuo' into dev 2021-06-08 13:07:48 +08:00
35b50efded 用户信息与路书列表地图背景区域化处理 2021-06-08 11:32:06 +08:00
aa75bb281f 解决蓝牙卡顿问题 2021-06-08 10:30:26 +08:00
b6d70e6856 解决金额区域差异问题 2021-06-07 17:05:49 +08:00
432e02e3de 调整微信登录 2021-06-07 14:48:09 +08:00
17eaccb72e 蓝牙调用调整 2021-06-04 19:23:32 +08:00
5671b35dce 修复设备选择界面多设备选择bug 2021-06-04 18:28:11 +08:00
7729332f41 接入基本设备 2021-06-04 13:22:59 +08:00
2f84f70a5f 接入蓝牙基本结构 2021-06-04 13:22:59 +08:00
84e8b50bbf Merge branch 'dev_lishuo' into dev 2021-06-04 13:21:23 +08:00
8e1b4bbbca 解决区域标点符号问题 2021-06-04 13:19:37 +08:00
e88f32e99b 搜索面板条件关闭重新打开重置 2021-05-26 18:04:58 +08:00
4e4da38252 伴侣骑行不选人点击确定报错bug修复;3d视角调整;倒计时优化; 2021-05-25 18:13:59 +08:00
3757ae6e6c 继续骑行海图初始位置,地图属性调整 2021-05-24 10:16:35 +08:00
a2a6ee1f49 限制昵称长度 2021-05-20 21:03:48 +08:00
724e43f392 附近的人自己的名称长度调整 2021-05-20 20:47:53 +08:00
5599d6dcc8 限制编辑信息里的长度 2021-05-20 20:07:45 +08:00
509a7c16bd Merge branch 'dev_cyp' into dev 2021-05-20 20:01:55 +08:00
7eb76291ec Merge branch 'dev_lishuo' into dev 2021-05-20 20:00:59 +08:00
0517382612 修改bug 2021-05-20 20:00:33 +08:00
fdf33ba8df 海拔图头像位移bug修复 2021-05-20 19:56:17 +08:00
2d36d5df39 配置连接串为线上 2021-05-20 18:05:55 +08:00
5db375bcf5 解决台湾无法点击的问题 2021-05-20 16:15:53 +08:00
3e38fd65c2 Merge branch 'dev_lishuo' into dev 2021-05-20 16:04:54 +08:00
7ba012f5f2 界面微调,设备连接中断跳时间bug修复 2021-05-20 15:55:27 +08:00
09514e2a8a 下载界面增加开始按钮,登陆注册bug修改 2021-05-20 14:12:43 +08:00
f1eeb11543 本地记录重新上传,一些界面bug修复 2021-05-19 18:39:47 +08:00
470d52b1bc 人物动画调整 2021-05-14 19:26:15 +08:00
eb70ee4397 细节调整
线路材质&位置调整,海拔图区间优化,loading动画只执行一次问题解决,小地图的球替换成圆形图片
2021-05-14 16:11:22 +08:00
e29381b13b 加载页进度bug修复 2021-05-14 09:26:33 +08:00
46cc231fe7 海拔图区间微调,消息面板&线路等微调 2021-05-13 17:48:28 +08:00
b694a69f16 微调 2021-05-12 18:52:14 +08:00
87d581291b 在线用户和影子选手信息面板,小地图已经骑行路线 2021-05-12 18:51:03 +08:00
53ec9c60ac 小调整 2021-05-12 10:42:26 +08:00
a7ea02f70a Merge branch 'dev_lishuo' into dev
# Conflicts:
#	.gitignore
#	Assets/Scenes/Ride/Scripts/SelectPlayerFactory.cs
2021-05-12 10:30:08 +08:00
8f0598580d 骑行页面消息通知
在线用户和影子选手用图片显示,缩放等功能按钮微调
2021-05-11 18:21:32 +08:00
2c5501a096 更新页面,目前是强制更新 2021-05-11 10:47:04 +08:00
2b4b2c4f70 小地图进度微调,人物脚本调整 2021-05-10 18:13:27 +08:00
8ca32cd1ae 显示当前路线在线的人 2021-05-08 18:36:59 +08:00
6645310601 更新拉取图片的缓存代码 2021-05-08 14:38:23 +08:00
696fd256a8 登录bug&影子选手bug修复 2021-05-08 14:27:56 +08:00
92676d7cf8 Merge branch 'dev_cyp' into dev
# Conflicts:
#	Assets/Scripts/App.cs
#	Assets/Scripts/UIManager.cs
2021-05-08 11:15:28 +08:00
9a4e646a8f 修复台湾问题;加服务器时间; 2021-05-08 11:09:03 +08:00
d4339968f6 场景名改掉 2021-05-08 11:07:55 +08:00
584cba79ae 小地图分辨率微调,影子选手包含自己 2021-05-08 11:02:11 +08:00
60bf5bd59d 增加confirm类型;国家省份城市json;增加列表缓存 2021-05-08 10:52:37 +08:00
e4d4333357 视角切换&小地图模糊问题解决 2021-05-07 18:41:37 +08:00
9bc3864790 Merge remote-tracking branch 'origin/dev_lishuo' into dev_cyp 2021-05-01 01:03:24 +08:00
39d84e2e8a 海拔头像移动bug修复 2021-05-01 01:02:54 +08:00
6b380b3442 Merge remote-tracking branch 'origin/dev' into dev_cyp
# Conflicts:
#	Assets/Scenes/1-Login.unity
2021-05-01 00:14:22 +08:00
3ec804f1b0 小调整 2021-05-01 00:11:27 +08:00
d96721e826 Merge remote-tracking branch 'origin/dev' into dev 2021-04-30 23:58:46 +08:00
071a0e1170 调整大地图样式和地球样式 2021-04-30 23:58:11 +08:00
392eca5dc2 人物抖动的问题解决,界面调整,3d视觉调整 2021-04-30 23:45:50 +08:00
af34243c28 修改细节 2021-04-30 21:09:21 +08:00
9f4e446850 修改设备图标。连接设备加缓存功能。 2021-04-30 18:03:34 +08:00
6399c26f7e Merge remote-tracking branch 'origin/dev_lishuo' into dev_cyp 2021-04-30 17:50:37 +08:00
f6a4ebda8c Merge remote-tracking branch 'origin/dev_lishuo' into dev_cyp 2021-04-30 17:46:06 +08:00
333542a63a 第一次进地球,登录页bug修改,主页面交互修改,其它细节 2021-04-30 17:46:00 +08:00
2b6be4711c 3d地图优先 2021-04-30 17:45:21 +08:00
48c5b161b1 ant+和http组件bug修复 2021-04-30 17:25:28 +08:00
f7b33bf491 Merge remote-tracking branch 'origin/dev_lishuo' into dev_lishuo 2021-04-29 23:50:17 +08:00
cb93e31143 设备问题修复 2021-04-29 23:49:51 +08:00
52fd841486 修改细节 2021-04-29 23:45:29 +08:00
aaef57c0b0 阻力灵敏度bug 2021-04-29 23:44:47 +08:00
b030294bd6 Merge remote-tracking branch 'origin/dev' into dev_lishuo
# Conflicts:
#	Assets/Scenes/Ride/Ride.unity
2021-04-29 22:17:24 +08:00
82997480fe 按钮&设置&退出界面调整 2021-04-29 22:16:32 +08:00
44abc5ded1 调整大地图的光 2021-04-29 22:14:17 +08:00
7b4fbc513e 修改细节 2021-04-29 22:05:19 +08:00
8eb201d0ee 伴侣骑行bug修复 2021-04-29 19:01:49 +08:00
a49acaab1e Merge remote-tracking branch 'origin/dev' into dev_lishuo 2021-04-29 18:13:05 +08:00
540bbc9a7c 功体比bug修复 2021-04-29 18:12:40 +08:00
de61fbd291 调整连接设备样式。调整地球样式。去掉灯光。 2021-04-29 18:10:09 +08:00
ae55258b9b 骑行界面按钮替换,界面&逻辑调整 2021-04-29 18:07:30 +08:00
4cb40f2c8e 修改细节,增加图标和splash image,最后需要用破解版打包 2021-04-29 18:05:00 +08:00
b15a4fe2c1 修改细节 2021-04-28 18:41:54 +08:00
9993752ff5 上传记录增加本地保存逻辑 2021-04-28 17:23:29 +08:00
614d067d25 Merge remote-tracking branch 'origin/dev' into dev_lishuo
# Conflicts:
#	Assets/Scripts/App.cs
2021-04-28 15:49:24 +08:00
6d45d052a0 移除xcharts和细节调整 2021-04-28 15:37:18 +08:00
3b63dec2e1 修正地球自适应问题。修正地图搜索卡死问题。 2021-04-28 15:30:38 +08:00
c8111d7db3 修改细节 2021-04-28 15:22:04 +08:00
b71a15e2ba Merge remote-tracking branch 'origin/dev' into dev_lishuo 2021-04-27 20:28:24 +08:00
00b9c7e796 骑行数据逻辑调整 2021-04-27 20:28:03 +08:00
5080503ebd 添加地球 2021-04-27 19:47:02 +08:00
86a5b68317 修改细节 2021-04-27 19:29:22 +08:00
8226b8a7c2 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-04-27 15:15:59 +08:00
4353a38c96 本地合并备份 2021-04-27 15:15:51 +08:00
1002b0433a 接动态地图,忘记密码,文件弹窗置顶 2021-04-27 14:58:49 +08:00
2b275d6dc5 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo
# Conflicts:
#	Assets/Scripts/UI/Prefab/ResultList/RouteItem.cs
2021-04-25 19:43:07 +08:00
02b8f97d83 细节调整 2021-04-25 19:41:35 +08:00
8de7e94c8d 键盘bug,细节调整 2021-04-25 19:35:41 +08:00
bbc3deeef2 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo
# Conflicts:
#	Assets/Scripts/Utils/Utils.cs
2021-04-25 13:51:21 +08:00
0f8af223fc 微调 2021-04-25 13:49:13 +08:00
048538a0c8 修改细节 2021-04-25 13:35:07 +08:00
9ac7c86ca6 移动动效和界面调整 2021-04-25 13:33:43 +08:00
11fdcff7c3 动画文件 2021-04-23 19:30:04 +08:00
922f66bb75 界面调整 2021-04-23 19:28:35 +08:00
a96d538dc1 Merge remote-tracking branch 'origin/dev' into dev_lishuo 2021-04-23 09:37:55 +08:00
d35c9daa82 合并前备份 2021-04-23 09:37:41 +08:00
4347a8eeba 细节调整 2021-04-23 09:22:12 +08:00
dd08f916eb 意见反馈 修改细节 2021-04-23 09:12:32 +08:00
96f3644b5b graph chart引入&骑行结果弹窗 2021-04-22 19:29:59 +08:00
40d118cea3 Merge remote-tracking branch 'origin/dev' into dev_lishuo
# Conflicts:
#	Assets/Mapbox/User/Modifiers.meta
#	Assets/Resources/UI/Control/PFUISlider.prefab.meta
#	Assets/StreamingAssets.meta
2021-04-21 14:09:34 +08:00
e7ad9473a5 新版骑行页面前备份 2021-04-21 14:08:45 +08:00
1c712ff7d5 加确认框。按钮加tooltips。调整大地图tips的位置。 2021-04-21 11:25:52 +08:00
bb4fabc833 设置页面,调些细节 2021-04-21 11:19:31 +08:00
4896fab824 loading图片遗留bug修复 2021-04-19 18:38:28 +08:00
f10eeac073 Merge remote-tracking branch 'origin/dev' into dev_lishuo 2021-04-19 18:17:27 +08:00
2d20edf57a 加淡入淡出效果。重设字体。加退出导航。 2021-04-19 18:16:56 +08:00
82923fe4f8 骑行界面字体 2021-04-19 18:03:04 +08:00
51c6fd7236 细节调整 2021-04-19 17:59:45 +08:00
af63072f29 Merge remote-tracking branch 'origin/dev' into dev_lishuo
# Conflicts:
#	Assets/Resources/Apis/Models.meta
#	Assets/Scripts/UI/Prefab/ResultList/RouteItem.cs
2021-04-19 14:40:43 +08:00
afba150d91 继骑&重骑骑行结果页细节调整 2021-04-19 14:38:31 +08:00
f065bf4bbb 调整样式 2021-04-19 14:36:08 +08:00
19766db051 Merge branch 'dev_cyp' into dev
# Conflicts:
#	Assets/Resources/Loading.meta
#	Assets/Scripts/Apis/MapApi.cs
#	Assets/Scripts/UI/Prefab/Panel/MapListController.cs
2021-04-19 14:15:34 +08:00
0346b650aa 暂存 2021-04-19 14:11:53 +08:00
018699c944 Loading页面渐隐 2021-04-16 11:23:18 +08:00
10c82703f4 人物移动调整 2021-04-15 17:29:32 +08:00
70626ae741 Merge remote-tracking branch 'origin/dev' into dev_lishuo
# Conflicts:
#	Assets/NuGet.meta
#	Assets/Resources/Images/Ride.meta
#	Assets/Resources/Sound.meta
#	Assets/Scripts/App.cs
#	Assets/Scripts/UI/Prefab/BigMap/Tips.cs
#	Assets/StreamingAssets.meta
2021-04-15 17:14:00 +08:00
92e43c2cd8 路线产生逻辑微调 2021-04-15 17:09:35 +08:00
f4cbad819b Merge remote-tracking branch 'origin/dev' into dev_cyp
# Conflicts:
#	Assets/Resources/Images/back.png.meta
#	Assets/Resources/Images/change account.png.meta
#	Assets/Scripts/UI/Prefab/Panel/EditUserController.cs
2021-04-15 15:59:57 +08:00
c97bd50f3f 暂存 2021-04-15 15:58:37 +08:00
e04ae0b085 细节调整 2021-04-15 15:57:29 +08:00
62938ec6ae Merge remote-tracking branch 'origin/dev' into dev_lishuo
# Conflicts:
#	Assets/Scripts/Apis/MapApi.cs
#	Assets/Scripts/App.cs
2021-04-15 10:22:55 +08:00
7744eec847 伴侣骑行 2021-04-15 10:13:01 +08:00
038720e7bd Merge branch 'modify-ui' into dev
# Conflicts:
#	Assets/Scripts/UI/Prefab/Panel/HomeController.cs
#	Assets/Scripts/Utils/Utils.cs
2021-04-15 09:24:15 +08:00
d22eecd133 完成大地图主要界面 2021-04-15 09:01:07 +08:00
10e738f958 登录页调整 增加半圆角组件 基本完成路线列表功能 基本完成骑行列表 开始做编辑页 2021-04-14 17:57:52 +08:00
34cde86a28 Merge remote-tracking branch 'origin/dev' into dev_lishuo
# Conflicts:
#	Assets/Scripts/Apis/UserApi.cs
#	Assets/Scripts/App.cs
#	Assets/Scripts/ConfigHelper.cs
#	Assets/Scripts/Scenes/LoginController.cs
#	Assets/Scripts/UI/Prefab/Panel/HomeController.cs
2021-04-12 17:42:56 +08:00
2fcd9b23fa 附近的人 2021-04-12 17:35:56 +08:00
5156473bb2 加弹框。修改连接设备样式。 2021-04-09 09:44:06 +08:00
07feba912c 浏览器嵌入,国旗文件 2021-04-09 09:19:04 +08:00
725b510748 动态海拔图,全路线小地图,骑行记录上传增加截图 2021-04-07 17:22:45 +08:00
65fc5b5c50 场景加载处理一些卡顿的情况 2021-04-02 19:17:23 +08:00
e7a3214cb5 设备连接页加返回按钮 2021-04-01 14:29:58 +08:00
ae9cefc645 Merge remote-tracking branch 'origin/dev' into dev_lishuo
# Conflicts:
#	Assets/Cyp/Prefab.meta
#	Assets/Mapbox/Core/Plugins/Android.meta
#	Assets/Mapbox/Core/Plugins/Mapbox.meta
#	Assets/Mapbox/Core/Plugins/Mapbox/MapboxAccounts.meta
#	Assets/Plugins/Circle/ImageWithRoundedCorners.cs
#	Assets/Resources/Images/Devices.meta
#	Assets/Resources/UI/Prefab/Item.meta
#	Assets/Scripts/Devices/Ant/LegacyPages.meta
#	Assets/Scripts/UI/Prefab/Item.meta
#	Assets/StreamingAssets.meta
#	ProjectSettings/EditorBuildSettings.asset
2021-04-01 14:09:23 +08:00
ec7589096f 实现连接设备界面 2021-04-01 11:09:53 +08:00
2e6338bcf3 新增人物控制器抽象类 2021-04-01 11:01:29 +08:00
996f924719 登录页一些特效,路书列表详情框架 2021-04-01 11:01:05 +08:00
eb93577d68 修改坡度计算逻辑,骑行界面大部分完成 2021-03-31 20:46:57 +08:00
b0f6c39118 处理合并冲突 2021-03-30 20:00:11 +08:00
8638cd97de Merge branch 'dev_lishuo' of https://gitlab.com/rhino4biz/powerfun/powerfun-unity into dev_lishuo
# Conflicts:
#	Assets/DOTween.meta
#	Assets/Mapbox/Core/Plugins/Android.meta
#	Assets/Mapbox/Unity/Map/InitializeMapWithLocationProvider.cs
#	Assets/Plugins/Newtonsoft.Json.dll
#	Assets/Prefabs.meta
#	Assets/Resources.meta
#	Assets/Scenes/Ride/Minimap Render Texture.renderTexture
#	Assets/Scenes/Ride/Ride.unity
#	Assets/Scenes/Ride/Scripts/Helper.cs
#	Assets/Scenes/Ride/Scripts/PlayerController.cs
#	Assets/Scenes/Ride/Scripts/RouteController.cs
#	Assets/Scenes/Ride/Scripts/UIManager.cs
#	Packages/manifest.json
#	Packages/packages-lock.json
2021-03-30 19:35:32 +08:00
dad88828d2 合并后处理冲突 2021-03-30 19:32:11 +08:00
9a7830f46a 骑行界面调整,底层逻辑细化 2021-03-30 17:30:29 +08:00
d5133ee7b0 骑行界面UI 2021-03-30 17:29:40 +08:00
8ad36c965d 海拔图和小地图 2021-03-30 17:29:40 +08:00
42fa59d103 解决相机抖动和人物移动动画不流畅的问题 2021-03-30 17:29:39 +08:00
0ab0e99597 骑行计算逻辑调整 2021-03-30 17:29:39 +08:00
971a6f7e0e 单人骑行 2021-03-30 17:27:50 +08:00
326b74bd03 注释模态窗口 2021-03-30 14:27:09 +08:00
3c2bb10f07 加ant+相关代码。 2021-03-30 14:23:41 +08:00
f45711f39f 登录页一些效果,接路线列表页 2021-03-30 14:14:24 +08:00
db3fc6ee83 骑行界面UI 2021-03-29 20:32:30 +08:00
d1d9c92f1c Merge remote-tracking branch 'origin/dev' into dev_cyp 2021-03-29 10:00:31 +08:00
cbc79df8a2 暂存 2021-03-29 09:19:48 +08:00
38d1c387c3 加场景切换和事件绑定功能 2021-03-29 09:10:59 +08:00
c5bd9daba2 海拔图和小地图 2021-03-28 18:17:15 +08:00
e7044b3cde 前两个页面迁移完成 2021-03-26 09:50:04 +08:00
ba324aa68d 主场景迁移 2021-03-25 17:18:51 +08:00
ba994e715c Merge branch 'dev_cyp' into dev
# Conflicts:
#	Assets/Resources.meta
2021-03-25 16:58:03 +08:00
b7cc1653f4 ignore 2021-03-25 16:57:30 +08:00
6f7c4e78bd 暂存 2021-03-25 16:55:36 +08:00
4ecf26ec80 添加uimanager和主场景 2021-03-25 16:53:39 +08:00
45801dff22 解决相机抖动和人物移动动画不流畅的问题 2021-03-25 16:22:09 +08:00
60d12fcab2 骑行计算逻辑调整 2021-03-23 16:07:31 +08:00
398628017c 单人骑行 2021-03-22 19:20:51 +08:00
f557e2f5df 添加nuget和网络请求api 2021-03-22 16:06:28 +08:00
8898 changed files with 1684713 additions and 180 deletions

23
.gitignore vendored
View File

@ -69,3 +69,26 @@ crashlytics-build.properties
# Temporary auto-generated Android Assets
/[Aa]ssets/[Ss]treamingAssets/aa.meta
/[Aa]ssets/[Ss]treamingAssets/aa/*
Assets/Packages
Assets/Packages.meta
Assets/Shader2D-master
Assets/ZFBrowser
Assets/Resources/UI/Font/*.ttf
Assets/WorldPoliticalMapGlobeEdition
Assets/WorldPoliticalMapGlobeEdition.meta
Assets/earth
Assets/Chart And Graph
Assets/NuGet
Assets/NuGet.meta
Assets/earth.meta
Assets/MapWorkoutRecords.meta
Assets/Devices.txt
Assets/Devices.txt.meta
Assets/StreamingAssets.meta
Assets/Resources/Sound.meta
Assets/MapWorkoutRecords
Assets/Mapbox/User
Assets/Mapbox/User.meta
Packages/packages-lock.json
GPUCache
Assets/Shatalmic/plugin.unitypackage.meta

6
.vsconfig Normal file
View File

@ -0,0 +1,6 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Workload.ManagedGame"
]
}

130
Assets/AndroidUpdate.cs Normal file
View File

@ -0,0 +1,130 @@
using Newtonsoft.Json.Linq;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
public class AndroidUpdate : PFUIPanel
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
JObject data { get; set; }
public void StartDownload(JObject jo)
{
transform.Find("Panel/CurrentVersion").GetComponent<Text>().text = $"Current Version: {App.AppVersion}";
transform.Find("Panel/LastestVersion").GetComponent<Text>().text = $"Latest Version: {jo.Value<string>("Version")}";
data = jo;
var path = Application.temporaryCachePath + "/PowerFun.apk";
StartCoroutine(DownLoadExe(data.Value<string>("Url"), path, (p, isComplete) =>
{
transform.Find("Panel/Size").GetComponent<Text>().text = $"Downloaded {Math.Round(p * 100, 0)}%";// string.Format(, a, b);
transform.Find("Panel/Progress").GetComponent<Image>().fillAmount = (float)p;
if (isComplete)
{
PlayerPrefs.SetString("exeVersion", data.Value<string>("Version"));
new FileInfo(path + ".pfdownload").MoveTo(path);
OpenApk(path);
//Application.Quit();
}
}));
}
/*下载文件*/
IEnumerator DownLoadExe(string url, string desFileName, Action<double, bool> OnDownloadProgressEvent)
{
string version = data.Value<string>("Version");
if (File.Exists(desFileName))
{
//if(PlayerPrefs.GetString("exeVersion")==)
if (version == null)
{
yield break;
}
else
{
if (version == PlayerPrefs.GetString("exeVersion"))
{
OpenApk(desFileName);
//Application.Quit();
yield break;
}
else
{
File.Delete(desFileName);
}
}
//File.Delete(desFileName);
}
if (File.Exists(desFileName + ".pfdownload"))
{
File.Delete(desFileName + ".pfdownload");
}
using (var uwr = UnityWebRequest.Get(url))
{
var operation = uwr.SendWebRequest();
while (!operation.isDone)
{
/*
* as BugFinder metnioned in the comments
* what you want to track is uwr.downloadProgress
*/
var downloadDataProgress = uwr.downloadProgress * 100;
/*
* use a float division here
* I don't know what type downloadDataProgress is
* but if it is an int than you will always get
* an int division <somethingSmallerThan100>/100 = 0
*/
//progressBar.fillAmount = downloadDataProgress / 100.0f;
OnDownloadProgressEvent.Invoke(uwr.downloadProgress, false);
Debug.Log("Download: " + downloadDataProgress);
yield return null;
}
ByteArrayToFile(desFileName + ".pfdownload", uwr.downloadHandler.data);
OnDownloadProgressEvent.Invoke(1, true);
}
}
bool ByteArrayToFile(string fileName, byte[] byteArray)
{
try
{
using (var fs = new FileStream(fileName, FileMode.Create, FileAccess.Write))
{
fs.Write(byteArray, 0, byteArray.Length);
return true;
}
}
catch (Exception ex)
{
Debug.LogError(ex);
return false;
}
}
void OpenApk(string path)
{
#if !UNITY_EDITOR
AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
var activity = jc.GetStatic<AndroidJavaObject>("currentActivity");
//Debug.Log("打开apk"+ "file://" + path);
activity.Call("OpenApk", path);
Application.Quit();
#endif
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ef1001f46abd4064a9837992f252bb97
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
Assets/AppCenter.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3924cc2cd3f083b4b89f4ade5ab4137f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,200 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using Microsoft.AppCenter.Unity;
using UnityEngine;
using System;
using System.Reflection;
using Microsoft.AppCenter.Unity.Internal;
using System.Linq;
using Assets.Scenes.Ride.Scripts;
[HelpURL("https://docs.microsoft.com/en-us/appcenter/sdk/crashes/unity")]
public class AppCenterBehavior : MonoBehaviour
{
public static event Action InitializingServices;
public static event Action InitializedAppCenterAndServices;
public static event Action Started;
private static AppCenterBehavior _instance;
public AppCenterSettings Settings;
private void Awake()
{
// Make sure that App Center have only one instance.
if (_instance != null)
{
Debug.LogError("App Center Behavior should have only one instance!");
DestroyImmediate(gameObject);
return;
}
_instance = this;
DontDestroyOnLoad(gameObject);
#if UNITY_WSA_10_0
StartAppCenter();
#endif
}
private void Start()
{
#if !UNITY_WSA_10_0
StartAppCenter();
#endif
}
#if UNITY_EDITOR
public void Reset()
{
if (FindObjectsOfType<AppCenterBehavior>().Length > 1)
{
Debug.LogError("Only one game object with App Center Behaviour should exist.");
DestroyImmediate(this);
}
}
#endif
private void StartAppCenter()
{
if (Settings == null)
{
Debug.LogError("App Center isn't configured!");
return;
}
var services = Settings.Services;
PrepareEventHandlers(services);
InvokeInitializingServices();
AppCenter.SetWrapperSdk();
AppCenter.CacheStorageSize(Settings.MaxStorageSize.Size);
if (Settings.CustomLogUrl.UseCustomUrl)
{
AppCenter.CacheLogUrl(Settings.CustomLogUrl.Url);
}
var appSecret = AppCenter.ParseAndSaveSecretForPlatform(Settings.AppSecret);
var advancedSettings = GetComponent<AppCenterBehaviorAdvanced>();
AppCenter.NetworkRequestsAllowed = Settings.AllowNetworkRequests;
if (IsStartFromAppCenterBehavior(advancedSettings))
{
AppCenter.LogLevel = Settings.InitialLogLevel;
if (Settings.CustomLogUrl.UseCustomUrl)
{
AppCenter.SetLogUrl(Settings.CustomLogUrl.Url);
}
if (Settings.MaxStorageSize.UseCustomMaxStorageSize && Settings.MaxStorageSize.Size > 0)
{
AppCenterInternal.SetMaxStorageSize(Settings.MaxStorageSize.Size);
}
var startupType = GetStartupType(advancedSettings);
if (startupType != StartupType.Skip)
{
var transmissionTargetToken = GetTransmissionTargetToken(advancedSettings);
var appSecretString = GetAppSecretString(appSecret, transmissionTargetToken, startupType);
if (string.IsNullOrEmpty(appSecretString))
{
AppCenterInternal.Start(services);
}
else
{
AppCenterInternal.Start(appSecretString, services);
}
}
}
#if UNITY_IOS || UNITY_ANDROID
else
{
foreach (var service in services)
{
#if UNITY_IOS || UNITY_ANDROID
// On iOS and Android we start crash service here, to give app an opportunity to assign handlers after crash and restart in Awake method
var startCrashes = service.GetMethod("StartCrashes");
if (startCrashes != null)
startCrashes.Invoke(null, null);
// On iOS and Android we start distribute service here, to give app an opportunity to assign handlers after distribute and restart in Awake method
var startDistribute = service.GetMethod("StartDistribute");
if (startDistribute != null)
startDistribute.Invoke(null, null);
#endif
}
}
#endif
InvokeInitializedServices();
if (Started != null)
{
Started.Invoke();
}
}
private bool IsStartFromAppCenterBehavior(AppCenterBehaviorAdvanced advancedSettings)
{
#if UNITY_IOS
return advancedSettings != null && advancedSettings.SettingsAdvanced != null && advancedSettings.SettingsAdvanced.StartIOSNativeSDKFromAppCenterBehavior;
#elif UNITY_ANDROID
return advancedSettings != null && advancedSettings.SettingsAdvanced != null && advancedSettings.SettingsAdvanced.StartAndroidNativeSDKFromAppCenterBehavior;
#else
return true;
#endif
}
private StartupType GetStartupType(AppCenterBehaviorAdvanced advancedSettings)
{
return advancedSettings != null && advancedSettings.SettingsAdvanced != null ?
advancedSettings.SettingsAdvanced.GetStartupType() :
StartupType.AppCenter;
}
private string GetTransmissionTargetToken(AppCenterBehaviorAdvanced advancedSettings)
{
return advancedSettings != null && advancedSettings.SettingsAdvanced != null ?
advancedSettings.SettingsAdvanced.TransmissionTargetToken :
string.Empty;
}
private string GetAppSecretString(string appSecret, string transmissionTargetToken, StartupType startupType)
{
#if UNITY_WSA_10_0
return appSecret;
#else
switch (startupType)
{
default:
case StartupType.AppCenter:
return appSecret;
case StartupType.NoSecret:
return string.Empty;
case StartupType.OneCollector:
return string.Format("target={0}", transmissionTargetToken);
case StartupType.Both:
return string.Format("appsecret={0};target={1}", appSecret, transmissionTargetToken);
}
#endif
}
private static void PrepareEventHandlers(Type[] services)
{
foreach (var service in services)
{
var method = service.GetMethod("PrepareEventHandlers");
if (method != null)
{
method.Invoke(null, null);
}
}
}
private static void InvokeInitializingServices()
{
if (InitializingServices != null)
{
InitializingServices.Invoke();
}
}
private static void InvokeInitializedServices()
{
if (InitializedAppCenterAndServices != null)
{
InitializedAppCenterAndServices.Invoke();
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b9a3a6a28c6a80a46adde9b4e01eeb93
timeCreated: 1502267991
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: 2778c316eec875d46bbd2ecbfba6db4a, type: 3}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,30 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using UnityEngine;
[HelpURL("https://docs.microsoft.com/en-us/appcenter/sdk/crashes/unity")]
public class AppCenterBehaviorAdvanced : MonoBehaviour
{
public AppCenterSettingsAdvanced SettingsAdvanced;
private void Awake()
{
// Make sure that App Center have the default behavior attached.
if (gameObject.GetComponent<AppCenterBehavior>() == null)
{
Debug.LogError("App Center Behavior Advanced should have the App Center Behavior instance attached to the same game object.");
}
}
#if UNITY_EDITOR
public void Reset()
{
if (FindObjectsOfType<AppCenterBehaviorAdvanced>().Length > 1)
{
Debug.LogError("Only one game object with App Center Behaviour Advanced should exist.");
DestroyImmediate(this);
}
}
#endif
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0d5e2b5dc171f164b8ef2a7b94198b04
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: 2778c316eec875d46bbd2ecbfba6db4a, type: 3}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,40 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 07ef30b23b2586041aedf18c9486176d, type: 3}
m_Name: AppCenterSettings
m_EditorClassIdentifier:
iOSAppSecret: d8e69880-4b16-468e-9216-d0eec8fff482
AndroidAppSecret: d212c44e-8438-499e-83b8-dbb0b6cafc54
UWPAppSecret: 43bc58e0-d103-4d4a-87e6-ddc26adff8ba
UseAnalytics: 1
UseCrashes: 1
UseDistribute: 1
CustomApiUrl:
UrlName: API
UseCustomUrl: 0
Url:
CustomInstallUrl:
UrlName: Install
UseCustomUrl: 0
Url:
EnableDistributeForDebuggableBuild: 0
AutomaticCheckForUpdate: 1
InitialLogLevel: 4
AllowNetworkRequests: 1
UpdateTrack: 1
CustomLogUrl:
UrlName: Log
UseCustomUrl: 0
Url:
MaxStorageSize:
UseCustomMaxStorageSize: 0
Size: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a4dbc5962d52f8a4886748301216ab73
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,92 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Microsoft.AppCenter.Unity;
using UnityEngine;
[Serializable]
public class AppCenterSettings : ScriptableObject
{
[AppSecret("iOS App Secret")]
public string iOSAppSecret = "";
[AppSecret]
public string AndroidAppSecret = "";
[AppSecret]
public string UWPAppSecret = "";
[Tooltip("App Center Analytics helps you understand user behavior and customer engagement to improve your app.")]
public bool UseAnalytics = true;
[Tooltip("App Center Crashes will automatically generate a crash log every time your app crashes.")]
public bool UseCrashes = true;
[Tooltip("App Center Distribute will let your users install a new version of the app when you distribute it via the App Center.")]
public bool UseDistribute = true;
public CustomUrlProperty CustomApiUrl = new CustomUrlProperty("API");
public CustomUrlProperty CustomInstallUrl = new CustomUrlProperty("Install");
[Tooltip("By default, App Center Distribute is disabled for debuggable builds. Check this to enable it.")]
public bool EnableDistributeForDebuggableBuild = false;
[Tooltip("By default, App Center Distribute checks for update at application startup automatically. Uncheck this to check for updates manually instead.")]
public bool AutomaticCheckForUpdate = true;
public LogLevel InitialLogLevel = LogLevel.Info;
[Tooltip("By default, the network requests is allowed. Uncheck this to disallow network requests.")]
public bool AllowNetworkRequests = true;
[CustomDropDownProperty("Public", 1)]
[CustomDropDownProperty("Private", 2)]
public int UpdateTrack;
public CustomUrlProperty CustomLogUrl = new CustomUrlProperty("Log");
public MaxStorageSizeProperty MaxStorageSize = new MaxStorageSizeProperty();
public string AppSecret
{
get
{
var appSecrets = new Dictionary<string, string>
{
{ "ios", iOSAppSecret },
{ "android", AndroidAppSecret },
{ "uwp", UWPAppSecret }
};
return string.Concat(appSecrets
.Where(i => !string.IsNullOrEmpty(i.Value))
.Select(i => string.Format("{0}={1};", i.Key, i.Value))
.ToArray());
}
}
public Type[] Services
{
get
{
var services = new List<Type>();
if (UseAnalytics)
{
services.Add(AppCenter.Analytics);
}
if (UseCrashes)
{
services.Add(AppCenter.Crashes);
}
if (UseDistribute)
{
services.Add(AppCenter.Distribute);
}
return services.Where(i => i != null).ToArray();
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 07ef30b23b2586041aedf18c9486176d
timeCreated: 1502272754
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,50 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using System.Reflection;
using Microsoft.AppCenter.Unity;
using UnityEngine;
[Serializable]
public class AppCenterSettingsAdvanced : ScriptableObject
{
[AppSecret("Transmission Target Token")]
public string TransmissionTargetToken = "";
[Tooltip("Configure the way App Center is started. For more info on startup types refer to the documentation.")]
public StartupType AppCenterStartupType = StartupType.Both;
[Tooltip("Start Android native SDK from the App Center Behavior script instead of the native plugin")]
#if APPCENTER_DONT_USE_NATIVE_STARTER
public bool StartAndroidNativeSDKFromAppCenterBehavior = true;
#else
public bool StartAndroidNativeSDKFromAppCenterBehavior = false;
#endif
[Tooltip("Start iOS native SDK from the App Center Behavior script instead of the native plugin")]
#if APPCENTER_DONT_USE_NATIVE_STARTER
public bool StartIOSNativeSDKFromAppCenterBehavior = true;
#else
public bool StartIOSNativeSDKFromAppCenterBehavior = false;
#endif
public StartupType GetStartupType()
{
return AppCenterStartupType == StartupType.Both && string.IsNullOrEmpty(TransmissionTargetToken) ?
StartupType.AppCenter :
AppCenterStartupType;
}
private static Assembly AppCenterAssembly
{
get
{
#if !UNITY_EDITOR && UNITY_WSA_10_0
return typeof(AppCenterSettingsAdvanced).GetTypeInfo().Assembly;
#else
return Assembly.GetExecutingAssembly();
#endif
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0254b6f16506aa345aa7e5b4229b8fdc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 1d57433ef86b55d4f891a2bae99af818
folderAsset: yes
timeCreated: 1502266378
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,108 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System.Diagnostics;
using System.Text;
using UnityEngine;
public static class AndroidLibraryHelper
{
public static void ZipFile(string sourceFile, string destinationFile)
{
var stringBuilder = new StringBuilder();
var args = "";
var processName = "";
if (Application.platform == RuntimePlatform.WindowsEditor)
{
args = stringBuilder
.Append("/c powershell")
.Append(" -executionpolicy bypass")
.Append(" -File \"")
.Append(AppCenterSettingsContext.AppCenterPath)
.Append("/Plugins/Android/Utility/archive.ps1 \"")
.Append(" -Source ")
.Append(sourceFile)
.Append(" -Destination ")
.Append(destinationFile)
.ToString();
processName = "cmd";
}
else if (Application.platform == RuntimePlatform.OSXEditor)
{
args = stringBuilder
.Append("-c \"cd ")
.Append(sourceFile)
.Append(" ; zip -r ")
.Append("../")
.Append(destinationFile)
.Append(" * \"")
.ToString();
processName = "/bin/bash";
}
if (processName.Length > 0)
{
ExecuteProcess(processName, args);
}
}
public static void UnzipFile(string sourceFile, string destinationFile)
{
var stringBuilder = new StringBuilder();
var args = "";
var processName = "";
if (Application.platform == RuntimePlatform.WindowsEditor)
{
args = stringBuilder
.Append("/c powershell")
.Append(" -executionpolicy bypass")
.Append(" -File \"")
.Append(AppCenterSettingsContext.AppCenterPath)
.Append("/Plugins/Android/Utility/unarchive.ps1 \"")
.Append(" -Source ")
.Append(sourceFile)
.Append(" -Destination ")
.Append(destinationFile)
.ToString();
processName = "cmd";
}
else if (Application.platform == RuntimePlatform.OSXEditor)
{
args = stringBuilder
.Append("-c \"unzip ")
.Append(sourceFile)
.Append(" -d ")
.Append(destinationFile)
.Append(" \"")
.ToString();
processName = "/bin/bash";
}
if (processName.Length > 0)
{
ExecuteProcess(processName, args);
}
}
private static void ExecuteProcess(string processName, string args)
{
var process = new Process()
{
StartInfo = new ProcessStartInfo
{
FileName = processName,
Arguments = args,
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
CreateNoWindow = true,
}
};
process.Start();
string output = process.StandardOutput.ReadToEnd();
string error = process.StandardError.ReadToEnd();
process.WaitForExit();
if (output.Length > 0 || error.Length > 0)
{
UnityEngine.Debug.Log(output + error);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2dd8894ba1c74f64eba3405e0e466702
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,30 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using UnityEditor;
using UnityEditor.SceneManagement;
[CustomEditor(typeof(AppCenterBehavior))]
public class AppCenterBehaviorEditor : Editor
{
private Editor settingsEditor;
public override void OnInspectorGUI()
{
// Load or create settings.
var behaviour = (AppCenterBehavior) target;
if (behaviour.Settings == null)
{
behaviour.Settings = AppCenterSettingsContext.SettingsInstance;
EditorUtility.SetDirty(behaviour);
EditorSceneManager.MarkSceneDirty(behaviour.gameObject.scene);
}
// Draw settings.
if (settingsEditor == null)
{
settingsEditor = CreateEditor(behaviour.Settings);
}
settingsEditor.OnInspectorGUI();
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8b75da1d7e1a6444bb6ca0bfefc96bca
timeCreated: 1502266489
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,36 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using UnityEditor;
[CustomEditor(typeof(AppCenterBehaviorAdvanced))]
public class AppCenterBehaviorEditorAdvanced : Editor
{
private Editor settingsEditorAdvanced;
public override void OnInspectorGUI()
{
// Load or create settings.
var behaviour = (AppCenterBehaviorAdvanced) target;
if (behaviour.SettingsAdvanced == null)
{
behaviour.SettingsAdvanced = AppCenterSettingsContext.CreateSettingsInstanceAdvanced();
}
// Draw settings.
if (settingsEditorAdvanced == null)
{
settingsEditorAdvanced = CreateEditor(behaviour.SettingsAdvanced);
}
settingsEditorAdvanced.OnInspectorGUI();
}
public void OnDestroy()
{
// If the component is removed from GameObject then remove the related asset.
if (!target && FindObjectsOfType<AppCenterBehaviorAdvanced>().Length == 0)
{
AppCenterSettingsContext.DeleteSettingsInstanceAdvanced();
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a931e43ece37e0f49a55725bf9250637
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

View File

@ -0,0 +1,106 @@
fileFormatVersion: 2
guid: 2778c316eec875d46bbd2ecbfba6db4a
timeCreated: 1502267776
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: 1
mipBias: -1
wrapU: 1
wrapV: -1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Standalone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: iPhone
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Android
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
- buildTarget: Windows Store Apps
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,340 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using Microsoft.AppCenter.Unity;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Xml.Linq;
using System;
using System.Collections.Generic;
using UnityEditor.Build.Reporting;
using UnityEditor.Build;
using UnityEditor;
using UnityEngine;
using System.Reflection;
// Warning: Don't use #if #endif for conditional compilation here as Unity
// doesn't always set the flags early enough.
public class AppCenterPostBuild : IPostprocessBuildWithReport
{
public int callbackOrder { get { return 0; } }
private const string AppManifestFileName = "Package.appxmanifest";
private const string CapabilitiesElement = "Capabilities";
private const string CapabilityElement = "Capability";
private const string CapabilityNameAttribute = "Name";
private const string CapabilityNameAttributeValue = "internetClient";
private const string AppIl2cppXaml = "App.xaml.cpp";
private const string AppIl2cppD3d = "App.cpp";
public void OnPostprocessBuild(BuildReport report)
{
OnPostprocessBuild(report.summary.platform, report.summary.outputPath);
}
public void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
{
if (target == BuildTarget.WSAPlayer)
{
AddInternetClientCapability(pathToBuiltProject);
if (PlayerSettings.GetScriptingBackend(BuildTargetGroup.WSA) == ScriptingImplementation.IL2CPP)
{
// Fix System.Diagnostics.Debug IL2CPP implementation.
FixIl2CppLogging(pathToBuiltProject);
}
}
if (target == BuildTarget.iOS &&
PBXProjectWrapper.PBXProjectIsAvailable &&
PlistDocumentWrapper.PlistDocumentIsAvailable)
{
var pbxProject = new PBXProjectWrapper(pathToBuiltProject);
// Update project.
OnPostprocessProject(pbxProject);
pbxProject.WriteToFile();
// Update Info.plist.
var settings = AppCenterSettingsContext.SettingsInstance;
var infoPath = pathToBuiltProject + "/Info.plist";
var info = new PlistDocumentWrapper(infoPath);
OnPostprocessInfo(info, settings);
info.WriteToFile();
// Update capabilities (if possible).
if (ProjectCapabilityManagerWrapper.ProjectCapabilityManagerIsAvailable)
{
var capabilityManager = new ProjectCapabilityManagerWrapper(pbxProject.ProjectPath,
PBXProjectWrapper.GetUnityTargetName(),
pbxProject.GetUnityTargetGuid());
capabilityManager.WriteToFile();
}
}
}
#region UWP Methods
/// <summary>
/// In order to have App Center SDK logs we are using 'OutputDebugStringW' func to display them.
/// To use 'OutputDebugStringW' we should update autogenerated Debugger.cpp file.
/// </summary>
/// <param name="pathToBuiltProject">Path to build project</param>
public static void FixIl2CppLogging(string pathToBuiltProject)
{
var destDebuggerPath = Path.Combine(pathToBuiltProject,
"Il2CppOutputProject\\IL2CPP\\libil2cpp\\icalls\\mscorlib\\System.Diagnostics\\Debugger.cpp");
if (!File.Exists(destDebuggerPath))
{
throw new FileNotFoundException("Debugger.cpp file not found");
}
var codeLines = File.ReadAllLines(destDebuggerPath).ToList();
// Update #include and #undef derictives.
var lastIncludeLineIndex = SearchForLine(codeLines, "#include", true);
if (lastIncludeLineIndex == -1)
{
throw new Exception("Unexpected content of Debugger.cpp");
}
// Add '#include <Windows.h>' which provides 'OutputDebugStringW'.
codeLines.Insert(lastIncludeLineIndex + 1, "#include <Windows.h>");
/*
* 'GetCurrentDirectory' define conflicts with generated code and new versions of Unity
* combine some files on the compilation so the changes in one file can affect another.
*/
codeLines.Insert(lastIncludeLineIndex + 2, "#undef GetCurrentDirectory");
// Add logging method.
var logMethodLineIndex = SearchForLine(codeLines, "void Debugger::Log");
if (logMethodLineIndex == -1)
{
throw new Exception("Unexpected content of Debugger.cpp");
}
var insertingPosition = GetFirstLineInMethodBody(codeLines, logMethodLineIndex);
codeLines.Insert(insertingPosition, "OutputDebugStringW(message->chars);");
// Enable logging.
var isLoggingMethodLineIndex = SearchForLine(codeLines, "bool Debugger::IsLogging");
if (isLoggingMethodLineIndex == -1)
{
throw new Exception("Unexpected content of Debugger.cpp");
}
var firstLineInMethodBody = GetFirstLineInMethodBody(codeLines, isLoggingMethodLineIndex);
var lastLineInMethodBody = GetLastLineInMethodBody(codeLines, isLoggingMethodLineIndex);
codeLines.RemoveRange(firstLineInMethodBody, lastLineInMethodBody - firstLineInMethodBody);
codeLines.Insert(firstLineInMethodBody, "return true;");
File.WriteAllLines(destDebuggerPath, codeLines.ToArray());
}
private static int GetFirstLineInMethodBody(List<string> lines, int currentLineIndex)
{
while (currentLineIndex <= lines.Count && !lines[currentLineIndex].Contains("{"))
{
currentLineIndex++;
}
if (currentLineIndex >= lines.Count)
{
throw new Exception("Unexpected content of Debugger.cpp");
}
return currentLineIndex + 1;
}
private static int GetLastLineInMethodBody(List<string> lines, int currentLineIndex)
{
var lineIndex = GetFirstLineInMethodBody(lines, currentLineIndex);
int bracketsBalance = lines[lineIndex - 1].Count((item) => item == '{');
while (lineIndex <= lines.Count && bracketsBalance != 0)
{
bracketsBalance += lines[lineIndex].Count((item) => item == '{');
bracketsBalance -= lines[lineIndex].Count((item) => item == '}');
lineIndex++;
}
if (bracketsBalance != 0)
{
throw new Exception("Unexpected content of Debugger.cpp");
}
return lineIndex - 1;
}
private static int SearchForLine(List<string> lines, string searchString, bool returnTheLast = false)
{
int position = -1;
for (var i = 0; i < lines.Count; i++)
{
if (lines[i].Contains(searchString))
{
if (returnTheLast)
{
position = i;
}
else
{
return i;
}
}
}
return position;
}
public static string GetAppFilePath(string pathToBuiltProject, string filename)
{
var candidate = Path.Combine(pathToBuiltProject, Application.productName);
candidate = Path.Combine(candidate, filename);
return File.Exists(candidate) ? candidate : null;
}
public static void ProcessUwpIl2CppDependencies()
{
var binaries = AssetDatabase.FindAssets("*", new[] { AppCenterSettingsContext.AppCenterPath + "/Plugins/WSA/IL2CPP" });
foreach (var guid in binaries)
{
var assetPath = AssetDatabase.GUIDToAssetPath(guid);
var importer = AssetImporter.GetAtPath(assetPath) as PluginImporter;
if (importer != null)
{
importer.SetPlatformData(BuildTarget.WSAPlayer, "SDK", "UWP");
importer.SetPlatformData(BuildTarget.WSAPlayer, "ScriptingBackend", "Il2Cpp");
importer.SaveAndReimport();
}
}
}
private static void ExecuteCommand(string command, string arguments, int timeout = 600)
{
try
{
var buildProcess = new System.Diagnostics.Process
{
StartInfo =
{
FileName = command,
Arguments = arguments
}
};
buildProcess.Start();
buildProcess.WaitForExit(timeout * 1000);
}
catch (Exception exception)
{
Debug.LogException(exception);
}
}
private static void AddInternetClientCapability(string pathToBuiltProject)
{
/* Package.appxmanifest file example:
<Package>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package> */
var appManifests = Directory.GetFiles(pathToBuiltProject, AppManifestFileName, SearchOption.AllDirectories);
if (appManifests.Length == 0)
{
Debug.LogWarning("Failed to add the `InternetClient` capability, file `" + AppManifestFileName + "` is not found");
return;
}
else if (appManifests.Length > 1)
{
Debug.LogWarning("Failed to add the `InternetClient` capability, multiple `" + AppManifestFileName + "` files found");
return;
}
var appManifestFilePath = appManifests[0];
var xmlFile = XDocument.Load(appManifestFilePath);
var defaultNamespace = xmlFile.Root.GetDefaultNamespace().NamespaceName;
var capabilitiesElements = xmlFile.Root.Elements().Where(element => element.Name.LocalName == CapabilitiesElement).ToList();
if (capabilitiesElements.Count > 1)
{
Debug.LogWarning("Failed to add the `InternetClient` capability, multiple `Capabilities` elements found inside `" + appManifestFilePath + "` file");
return;
}
else if (capabilitiesElements.Count == 0)
{
xmlFile.Root.Add(new XElement(XName.Get(CapabilitiesElement, defaultNamespace), GetInternetClientCapabilityElement(defaultNamespace)));
}
else // capabilitiesElements.Count == 1
{
var capabilitiesElement = capabilitiesElements[0];
foreach (var element in capabilitiesElement.Elements())
{
if (element.Name.LocalName == CapabilityElement &&
GetAttributeValue(element, CapabilityNameAttribute) == CapabilityNameAttributeValue)
{
return;
}
}
capabilitiesElement.Add(GetInternetClientCapabilityElement(defaultNamespace));
}
xmlFile.Save(appManifestFilePath);
}
private static XElement GetInternetClientCapabilityElement(string defaultNamespace)
{
return new XElement(XName.Get(CapabilityElement, defaultNamespace),
new XAttribute(CapabilityNameAttribute, CapabilityNameAttributeValue));
}
internal static string GetAttributeValue(XElement element, string attributeName)
{
var attribute = element.Attribute(attributeName);
return attribute == null ? null : attribute.Value;
}
#endregion
#region iOS Methods
private static void OnPostprocessProject(PBXProjectWrapper project)
{
// Need to add SQLite and zlib dependencies.
project.AddBuildProperty("OTHER_LDFLAGS", "-lsqlite3 -lz");
#if UNITY_2019_3_OR_NEWER
project.AddBuildProperty("CLANG_ENABLE_MODULES", "YES", true);
#else
project.AddBuildProperty("CLANG_ENABLE_MODULES", "YES");
#endif
}
private static void OnPostprocessInfo(PlistDocumentWrapper info, AppCenterSettings settings)
{
if (settings.UseDistribute && AppCenter.Distribute != null)
{
// Add App Center URL scemes.
var schemes = new List<string>() { "appcenter-" + settings.iOSAppSecret };
// Create a reflection call for getting custom schemes from iOS settings.
var playerSettingsClass = typeof(PlayerSettings.iOS);
var iOSURLSchemesMethod = playerSettingsClass.GetMethod("GetURLSchemes", BindingFlags.Static | BindingFlags.NonPublic);
// Verify that method exists and call it for getting custom schemes.
if (iOSURLSchemesMethod != null)
{
var schemesFromSettings = (string[])iOSURLSchemesMethod.Invoke(null, null);
schemes.AddRange(schemesFromSettings.ToList<string>());
}
// Generate scheme information.
var root = info.GetRoot();
var urlTypes = root.GetType().GetMethod("CreateArray").Invoke(root, new object[] { "CFBundleURLTypes" });
if (settings.UseDistribute && AppCenter.Distribute != null)
{
var urlType = urlTypes.GetType().GetMethod("AddDict").Invoke(urlTypes, null);
var setStringMethod = urlType.GetType().GetMethod("SetString");
setStringMethod.Invoke(urlType, new object[] { "CFBundleTypeRole", "None" });
setStringMethod.Invoke(urlType, new object[] { "CFBundleURLName", ApplicationIdHelper.GetApplicationId() });
var urlSchemes = urlType.GetType().GetMethod("CreateArray").Invoke(urlType, new[] { "CFBundleURLSchemes" });
// Add custom schemes defined in Unity players settings.
foreach (var scheme in schemes)
{
urlSchemes.GetType().GetMethod("AddString").Invoke(urlSchemes, new[] { scheme });
}
}
}
}
#endregion
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 1c0067cc6476946b180484e48966b142
timeCreated: 1497896393
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,190 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using Microsoft.AppCenter.Unity;
using System;
using System.IO;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;
public class AppCenterPreBuild : IPreprocessBuildWithReport
{
private const string AarFilePattern = "appcenter-{0}-release";
public int callbackOrder { get { return 0; } }
#if UNITY_WSA
private readonly Version RequiredMinimalUWPVersion = new Version("10.0.16299.0");
#endif
public void OnPreprocessBuild(BuildReport report)
{
OnPreprocessBuild(report.summary.platform, report.summary.outputPath);
}
public void OnPreprocessBuild(BuildTarget target, string path)
{
if (target == BuildTarget.Android)
{
#if !APPCENTER_DONT_USE_NATIVE_STARTER
var settingsMaker = new AppCenterSettingsMakerAndroid();
AddStartupCode(settingsMaker);
#if UNITY_ANDROID
AddSettingsFileToLoader(settingsMaker);
#endif
#endif
}
else if (target == BuildTarget.iOS)
{
#if !APPCENTER_DONT_USE_NATIVE_STARTER
AddStartupCode(new AppCenterSettingsMakerIos());
#endif
}
else if (target == BuildTarget.WSAPlayer)
{
#if UNITY_WSA
var currentMinimalPlatformVersion = new Version(EditorUserBuildSettings.wsaMinUWPSDK);
if (currentMinimalPlatformVersion < RequiredMinimalUWPVersion)
{
Debug.LogWarning($"Minimum platform version should be set to {RequiredMinimalUWPVersion} or higher. App Center does not support lower versions but it is set to {currentMinimalPlatformVersion}");
}
#endif
}
if (target == BuildTarget.Android)
{
// No linking/unlinking in case module isn't added.
if (AppCenter.Distribute != null)
{
LinkModule(AppCenterSettingsContext.SettingsInstance.UseDistribute, "distribute");
}
if (AppCenter.Analytics != null)
{
LinkModule(AppCenterSettingsContext.SettingsInstance.UseAnalytics, "analytics");
}
if (AppCenter.Crashes != null)
{
LinkModule(AppCenterSettingsContext.SettingsInstance.UseCrashes, "crashes");
}
}
}
#if UNITY_ANDROID
public static void AddSettingsFileToLoader(AppCenterSettingsMakerAndroid settingsMaker)
{
var loaderZipFile = AppCenterSettingsContext.AppCenterPath + "/Plugins/Android/appcenter-loader-release.aar";
const string loaderFolder = "appcenter-loader-release";
const string settingsFilePath = loaderFolder + "/res/values/appcenter-settings.xml";
const string settingsMetaFilePath = loaderFolder + "/res/values/appcenter-settings.xml.meta";
if (!File.Exists(loaderZipFile))
{
throw new IOException("Failed to load dependency file appcenter-loader-release.aar");
}
// Delete unzipped directory if it already exists.
if (Directory.Exists(loaderFolder))
{
Directory.Delete(loaderFolder, true);
}
AndroidLibraryHelper.UnzipFile(loaderZipFile, loaderFolder);
if (!Directory.Exists(loaderFolder))
{
throw new IOException("Unzipping loader folder failed.");
}
settingsMaker.CommitSettings(settingsFilePath);
// Delete the appcenter-settings.xml.meta file if generated.
if (File.Exists(settingsMetaFilePath))
{
File.Delete(settingsMetaFilePath);
}
// Delete the original aar file and zipped the extracted folder to generate a new one.
File.Delete(loaderZipFile);
AndroidLibraryHelper.ZipFile(loaderFolder, loaderZipFile);
Directory.Delete(loaderFolder, true);
}
#endif
private void AddStartupCode(IAppCenterSettingsMaker settingsMaker)
{
var settings = AppCenterSettingsContext.SettingsInstance;
var advancedSettings = AppCenterSettingsContext.SettingsInstanceAdvanced;
settingsMaker.SetAppSecret(settings);
settingsMaker.SetLogLevel((int)settings.InitialLogLevel);
settingsMaker.IsAllowNetworkRequests((bool)settings.AllowNetworkRequests);
if (settings.CustomLogUrl.UseCustomUrl)
{
settingsMaker.SetLogUrl(settings.CustomLogUrl.Url);
}
if (settings.MaxStorageSize.UseCustomMaxStorageSize && settings.MaxStorageSize.Size > 0)
{
settingsMaker.SetMaxStorageSize(settings.MaxStorageSize.Size);
}
if (settings.UseAnalytics && settingsMaker.IsAnalyticsAvailable())
{
settingsMaker.StartAnalyticsClass();
}
if (settings.UseCrashes && settingsMaker.IsCrashesAvailable())
{
settingsMaker.StartCrashesClass();
}
if (settings.UseDistribute && settingsMaker.IsDistributeAvailable())
{
if (settings.CustomApiUrl.UseCustomUrl)
{
settingsMaker.SetApiUrl(settings.CustomApiUrl.Url);
}
if (settings.CustomInstallUrl.UseCustomUrl)
{
settingsMaker.SetInstallUrl(settings.CustomInstallUrl.Url);
}
if (settings.EnableDistributeForDebuggableBuild)
{
settingsMaker.SetShouldEnableDistributeForDebuggableBuild();
}
if (!settings.AutomaticCheckForUpdate)
{
settingsMaker.SetDistributeDisableAutomaticCheckForUpdate();
}
settingsMaker.SetUpdateTrack(settings.UpdateTrack);
settingsMaker.StartDistributeClass();
}
if (advancedSettings != null)
{
var startupType = settingsMaker.IsStartFromAppCenterBehavior(advancedSettings) ? StartupType.Skip : advancedSettings.GetStartupType();
settingsMaker.SetStartupType((int)startupType);
settingsMaker.SetTransmissionTargetToken(advancedSettings.TransmissionTargetToken);
}
else
{
settingsMaker.SetStartupType((int)StartupType.AppCenter);
}
settingsMaker.CommitSettings();
}
#region Android Methods
private static void LinkModule(bool isEnabled, string moduleName)
{
var aarName = string.Format(AarFilePattern, moduleName);
var aarFileAsset = AssetDatabase.FindAssets(aarName, new[] { AppCenterSettingsContext.AppCenterPath + "/Plugins/Android" });
if (aarFileAsset.Length == 0)
{
Debug.LogWarning("Failed to link " + moduleName + ", file `" + aarName + "` is not found");
return;
}
var assetPath = AssetDatabase.GUIDToAssetPath(aarFileAsset[0]);
var importer = AssetImporter.GetAtPath(assetPath) as PluginImporter;
if (importer != null)
{
Debug.Log (moduleName + " is " + (isEnabled ? "" : "not ") + "enabled. " +
(isEnabled ? "Linking " : "Unlinking ") + aarName);
importer.SetCompatibleWithPlatform(BuildTarget.Android, isEnabled);
importer.SaveAndReimport();
}
}
#endregion
}

View File

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 16e4e6da5f50549cfb7ca7a683d8ae8f
timeCreated: 1513203132
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,86 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Linq;
public class AppCenterSettingsContext : ScriptableObject
{
private static string appCenterPath;
private static readonly string SettingsPath = AppCenterPath + "/AppCenterSettings.asset";
private static readonly string AdvancedSettingsPath = AppCenterPath + "/AppCenterSettingsAdvanced.asset";
public static string AppCenterPath
{
get
{
if (string.IsNullOrEmpty(appCenterPath))
{
appCenterPath = FindSubfolderPath("Assets", "AppCenter");
}
return appCenterPath;
}
}
public static AppCenterSettings SettingsInstance
{
get
{
// No need to lock because this can only be accessed from the main thread.
var instance = AssetDatabase.LoadAssetAtPath<AppCenterSettings>(SettingsPath);
if (instance == null)
{
instance = CreateInstance<AppCenterSettings>();
AssetDatabase.CreateAsset(instance, SettingsPath);
AssetDatabase.SaveAssets();
}
return instance;
}
}
public static AppCenterSettingsAdvanced SettingsInstanceAdvanced
{
get
{
// No need to lock because this can only be accessed from the main thread.
return AssetDatabase.LoadAssetAtPath<AppCenterSettingsAdvanced>(AdvancedSettingsPath);
}
}
private static string FindSubfolderPath(string parentFolder, string searchFolder)
{
string[] folders = AssetDatabase.GetSubFolders(parentFolder);
string resultFolder = folders.FirstOrDefault(folder => (new DirectoryInfo(folder)).Name == searchFolder);
if (string.IsNullOrEmpty(resultFolder) && folders.Length > 0)
{
string temp;
for (int i = 0; i < folders.Length; i++)
{
temp = FindSubfolderPath(folders[i], searchFolder);
if (!string.IsNullOrEmpty(temp))
{
return temp;
}
}
}
return resultFolder;
}
public static AppCenterSettingsAdvanced CreateSettingsInstanceAdvanced()
{
var instance = AssetDatabase.LoadAssetAtPath<AppCenterSettingsAdvanced>(AdvancedSettingsPath);
if (instance == null)
{
instance = CreateInstance<AppCenterSettingsAdvanced>();
AssetDatabase.CreateAsset(instance, AdvancedSettingsPath);
AssetDatabase.SaveAssets();
}
return instance;
}
public static void DeleteSettingsInstanceAdvanced()
{
AssetDatabase.DeleteAsset(AdvancedSettingsPath);
}
}

View File

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: a2039654418774fd1a596ae0de6ec117
timeCreated: 1513203491
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,58 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using UnityEngine;
using UnityEditor;
using Microsoft.AppCenter.Unity;
[CustomEditor(typeof(AppCenterSettings))]
public class AppCenterSettingsEditor : Editor
{
public override void OnInspectorGUI()
{
serializedObject.Update();
// Draw app secrets.
Header("App Secrets");
EditorGUILayout.PropertyField(serializedObject.FindProperty("iOSAppSecret"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("AndroidAppSecret"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("UWPAppSecret"));
// Draw modules.
if (AppCenter.Analytics != null)
{
Header("Analytics");
EditorGUILayout.PropertyField(serializedObject.FindProperty("UseAnalytics"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("MaxStorageSize"));
}
if (AppCenter.Crashes != null)
{
Header("Crashes");
EditorGUILayout.PropertyField(serializedObject.FindProperty("UseCrashes"));
}
if (AppCenter.Distribute != null)
{
Header("Distribute");
var serializedProperty = serializedObject.FindProperty("UseDistribute");
EditorGUILayout.PropertyField(serializedProperty);
EditorGUILayout.PropertyField(serializedObject.FindProperty("UpdateTrack"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("AutomaticCheckForUpdate"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("EnableDistributeForDebuggableBuild"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("CustomApiUrl"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("CustomInstallUrl"));
}
// Draw other.
Header("Other Setup");
EditorGUILayout.PropertyField(serializedObject.FindProperty("InitialLogLevel"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("CustomLogUrl"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("AllowNetworkRequests"));
serializedObject.ApplyModifiedProperties();
}
private static void Header(string label)
{
GUILayout.Label(label, EditorStyles.boldLabel);
GUILayout.Space(-4);
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a8247f056cc059c4aa3d9b57058f5d64
timeCreated: 1502269651
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,20 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(AppCenterSettingsAdvanced))]
public class AppCenterSettingsEditorAdvanced : Editor
{
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(serializedObject.FindProperty("TransmissionTargetToken"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("StartAndroidNativeSDKFromAppCenterBehavior"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("StartIOSNativeSDKFromAppCenterBehavior"), new GUIContent("Start iOS Native SDK From App Center Behavior"));
//The following line can be useful if you want to be able to configure StartupType from AppCenter Behaviour Advanced.
//EditorGUILayout.PropertyField(serializedObject.FindProperty("AppCenterStartupType"));
serializedObject.ApplyModifiedProperties();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3a11f2b13c794884191a36df20b65b1a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,140 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System.Collections.Generic;
using System.IO;
public class AppCenterSettingsMakerAndroid : IAppCenterSettingsMaker
{
private const string AppSecretKey = "appcenter_app_secret";
private const string AllowNetworkRequestsKey = "allow_network_requests";
private const string TransmissionTargetTokenKey = "appcenter_transmission_target_token";
private const string CustomLogUrlKey = "appcenter_custom_log_url";
private const string UseCustomLogUrlKey = "appcenter_use_custom_log_url";
private const string InitialLogLevelKey = "appcenter_initial_log_level";
private const string StartupTypeKey = "appcenter_startup_type";
private const string UseCrashesKey = "appcenter_use_crashes";
private const string UseAnalyticsKey = "appcenter_use_analytics";
private const string UseDistributeKey = "appcenter_use_distribute";
private const string DistributeDisableAutomaticCheckForUpdateKey = "appcenter_distribute_disable_automatic_check_for_update";
private const string CustomApiUrlKey = "appcenter_custom_api_url";
private const string UseCustomApiUrlKey = "appcenter_use_custom_api_url";
private const string CustomInstallUrlKey = "appcenter_custom_install_url";
private const string UseCustomInstallUrlKey = "appcenter_use_custom_install_url";
private const string MaxStorageSizeKey = "appcenter_max_storage_size";
private const string UpdateTrackKey = "appcenter_update_track";
private const string EnableDistributeForDebuggableBuildKey = "appcenter_enable_distribute_for_debuggable_build";
private readonly IDictionary<string, string> _resourceValues = new Dictionary<string, string>();
public void SetLogLevel(int logLevel)
{
_resourceValues[InitialLogLevelKey] = logLevel.ToString();
}
public void SetStartupType(int startupType)
{
_resourceValues[StartupTypeKey] = startupType.ToString();
}
public void SetUpdateTrack(int updateTrack)
{
_resourceValues[UpdateTrackKey] = updateTrack.ToString();
}
public void SetLogUrl(string logUrl)
{
_resourceValues[CustomLogUrlKey] = logUrl;
_resourceValues[UseCustomLogUrlKey] = true.ToString();
}
public void IsAllowNetworkRequests(bool isAllowed)
{
_resourceValues[AllowNetworkRequestsKey] = isAllowed.ToString();
}
public void SetAppSecret(AppCenterSettings settings)
{
_resourceValues[AppSecretKey] = settings.AndroidAppSecret;
}
public void SetTransmissionTargetToken(string transmissionTargetToken)
{
_resourceValues[TransmissionTargetTokenKey] = transmissionTargetToken;
}
public void StartCrashesClass()
{
_resourceValues[UseCrashesKey] = true.ToString();
}
public void StartAnalyticsClass()
{
_resourceValues[UseAnalyticsKey] = true.ToString();
}
public void StartDistributeClass()
{
_resourceValues[UseDistributeKey] = true.ToString();
}
public void SetDistributeDisableAutomaticCheckForUpdate()
{
_resourceValues[DistributeDisableAutomaticCheckForUpdateKey] = true.ToString();
}
public void SetApiUrl(string apiUrl)
{
_resourceValues[CustomApiUrlKey] = apiUrl;
_resourceValues[UseCustomApiUrlKey] = true.ToString();
}
public void SetInstallUrl(string installUrl)
{
_resourceValues[CustomInstallUrlKey] = installUrl;
_resourceValues[UseCustomInstallUrlKey] = true.ToString();
}
public void SetMaxStorageSize(long size)
{
_resourceValues[MaxStorageSizeKey] = size.ToString();
}
public void CommitSettings()
{
}
public void CommitSettings(string filePath)
{
if (File.Exists(filePath))
{
File.Delete(filePath);
}
XmlResourceHelper.WriteXmlResource(filePath, _resourceValues);
}
public bool IsStartFromAppCenterBehavior(AppCenterSettingsAdvanced advancedSettings)
{
return advancedSettings.StartAndroidNativeSDKFromAppCenterBehavior;
}
public bool IsAnalyticsAvailable()
{
return File.Exists(AppCenterSettingsContext.AppCenterPath + "/Plugins/Android/appcenter-analytics-release.aar");
}
public bool IsCrashesAvailable()
{
return File.Exists(AppCenterSettingsContext.AppCenterPath + "/Plugins/Android/appcenter-crashes-release.aar");
}
public bool IsDistributeAvailable()
{
return File.Exists(AppCenterSettingsContext.AppCenterPath + "/Plugins/Android/appcenter-distribute-release.aar");
}
public void SetShouldEnableDistributeForDebuggableBuild()
{
_resourceValues[EnableDistributeForDebuggableBuildKey] = true.ToString();
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 0b2133faca91a47b49acd4d0fe6e076f
timeCreated: 1502322233
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,150 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System.IO;
using UnityEditor;
public class AppCenterSettingsMakerIos : IAppCenterSettingsMaker
{
private static readonly string TemplateFilePath = AppCenterSettingsContext.AppCenterPath + "/Plugins/iOS/Core/AppCenterStarter.original";
private static readonly string TargetFilePath = AppCenterSettingsContext.AppCenterPath + "/Plugins/iOS/Core/AppCenterStarter.m";
private const string AppSecretSearchText = "appcenter-app-secret";
private const string AllowNetworkRequestsText = "allow-network-requests";
private const string TransmissionTargetTokenSearchText = "appcenter-transmission-target-token";
private const string LogUrlSearchText = "custom-log-url";
private const string LogUrlToken = "APPCENTER_UNITY_USE_CUSTOM_LOG_URL";
private const string LogLevelSearchText = "0/*LOG_LEVEL*/";
private const string StartupTypeSearchText = "0/*STARTUP_TYPE*/";
private const string UseCrashesToken = "APPCENTER_UNITY_USE_CRASHES";
private const string UseAnalyticsToken = "APPCENTER_UNITY_USE_ANALYTICS";
private const string UseDistributeToken = "APPCENTER_UNITY_USE_DISTRIBUTE";
private const string DistributeDisableAutomaticCheckForUpdateToken = "APPCENTER_DISTRIBUTE_DISABLE_AUTOMATIC_CHECK_FOR_UPDATE";
private const string ApiUrlSearchText = "custom-api-url";
private const string ApiUrlToken = "APPCENTER_UNITY_USE_CUSTOM_API_URL";
private const string InstallUrlSearchText = "custom-install-url";
private const string InstallUrlToken = "APPCENTER_UNITY_USE_CUSTOM_INSTALL_URL";
private const string UseCustomMaxStorageSize = "APPCENTER_USE_CUSTOM_MAX_STORAGE_SIZE";
private const string MaxStorageSize = "APPCENTER_MAX_STORAGE_SIZE";
private const string UpdateTrackSearchText = "1 /*UPDATE_TRACK*/";
private string _loaderFileText;
private bool _enableDistributeForDebuggableBuild;
public AppCenterSettingsMakerIos()
{
_loaderFileText = File.ReadAllText(TemplateFilePath);
}
public void SetLogLevel(int logLevel)
{
_loaderFileText = _loaderFileText.Replace(LogLevelSearchText, logLevel.ToString());
}
public void IsAllowNetworkRequests(bool isAllowed)
{
_loaderFileText = _loaderFileText.Replace(AllowNetworkRequestsText, isAllowed ? "YES" : "NO");
}
public void SetStartupType(int startupType)
{
_loaderFileText = _loaderFileText.Replace(StartupTypeSearchText, startupType.ToString());
}
public void SetLogUrl(string logUrl)
{
AddToken(LogUrlToken);
_loaderFileText = _loaderFileText.Replace(LogUrlSearchText, logUrl);
}
public void SetAppSecret(AppCenterSettings settings)
{
_loaderFileText = _loaderFileText.Replace(AppSecretSearchText, settings.iOSAppSecret);
}
public void SetTransmissionTargetToken(string transmissionTargetToken)
{
_loaderFileText = _loaderFileText.Replace(TransmissionTargetTokenSearchText, transmissionTargetToken);
}
public void StartCrashesClass()
{
AddToken(UseCrashesToken);
}
public void StartDistributeClass()
{
if (_enableDistributeForDebuggableBuild || !EditorUserBuildSettings.development)
{
AddToken(UseDistributeToken);
}
}
public void StartAnalyticsClass()
{
AddToken(UseAnalyticsToken);
}
public void SetApiUrl(string apiUrl)
{
AddToken(ApiUrlToken);
_loaderFileText = _loaderFileText.Replace(ApiUrlSearchText, apiUrl);
}
public void SetInstallUrl(string installUrl)
{
AddToken(InstallUrlToken);
_loaderFileText = _loaderFileText.Replace(InstallUrlSearchText, installUrl);
}
public void CommitSettings()
{
File.WriteAllText(TargetFilePath, _loaderFileText);
}
public void SetMaxStorageSize(long size)
{
AddToken(UseCustomMaxStorageSize);
_loaderFileText = _loaderFileText.Replace(MaxStorageSize, size.ToString());
}
private void AddToken(string token)
{
var tokenText = "#define " + token + "\n";
_loaderFileText = tokenText + _loaderFileText;
}
public bool IsStartFromAppCenterBehavior(AppCenterSettingsAdvanced advancedSettings)
{
return advancedSettings.StartIOSNativeSDKFromAppCenterBehavior;
}
public bool IsAnalyticsAvailable()
{
return Directory.Exists(AppCenterSettingsContext.AppCenterPath + "/Plugins/iOS/Analytics");
}
public bool IsCrashesAvailable()
{
return Directory.Exists(AppCenterSettingsContext.AppCenterPath + "/Plugins/iOS/Crashes");
}
public bool IsDistributeAvailable()
{
return Directory.Exists(AppCenterSettingsContext.AppCenterPath + "/Plugins/iOS/Distribute");
}
public void SetShouldEnableDistributeForDebuggableBuild()
{
_enableDistributeForDebuggableBuild = true;
}
public void SetDistributeDisableAutomaticCheckForUpdate()
{
AddToken(DistributeDisableAutomaticCheckForUpdateToken);
}
public void SetUpdateTrack(int updateTrack)
{
_loaderFileText = _loaderFileText.Replace(UpdateTrackSearchText, updateTrack.ToString());
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: bb87d249dd7a048688f34b63e118a7b0
timeCreated: 1502216315
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using UnityEditor;
using UnityEngine;
[CustomPropertyDrawer(typeof(AppSecretAttribute))]
public class AppSecretDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
var name = ((AppSecretAttribute) attribute).Name;
if (!string.IsNullOrEmpty(name))
{
label.text = name;
}
EditorGUI.PropertyField(position, property, label);
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 119814cc89d1e4652975a06e6df567c6
timeCreated: 1504046963
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,12 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using UnityEditor;
public static class ApplicationIdHelper
{
public static string GetApplicationId()
{
return PlayerSettings.applicationIdentifier;
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c39732e4de5a34bfbbda09c28c8e7f9f
timeCreated: 1503349438
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,39 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
[CustomPropertyDrawer(typeof(CustomDropDownPropertyAttribute))]
public class CustomDropDownPropertyDrawer : PropertyDrawer
{
bool _initialized = false;
object[] _attributes = null;
Dictionary<string, int> _optionsDictionary = new Dictionary<string, int>();
string[] _options = null;
int _selectedIndex = 0;
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
if (!_initialized)
{
_attributes = fieldInfo.GetCustomAttributes(typeof(CustomDropDownPropertyAttribute), false);
foreach (var itemAttribute in _attributes)
{
var customPropertyAttribute = itemAttribute as CustomDropDownPropertyAttribute;
_optionsDictionary.Add(customPropertyAttribute.SelectedKey, customPropertyAttribute.SelectedValue);
if (customPropertyAttribute.SelectedValue == AppCenterSettingsContext.SettingsInstance.UpdateTrack)
{
_selectedIndex = ArrayUtility.IndexOf(_attributes, itemAttribute);
}
}
_options = _optionsDictionary.Keys.ToArray();
_initialized = true;
}
_selectedIndex = EditorGUI.Popup(position, property.displayName, _selectedIndex, _options);
property.intValue = _optionsDictionary[_options[_selectedIndex]];
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f0e8996e972247549b62c85a8d7aa869
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,43 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using UnityEngine;
using UnityEditor;
[CustomPropertyDrawer(typeof(CustomUrlProperty))]
public class CustomUrlPropertyDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
property.Next(true);
var urlName = property.stringValue;
var useLabel = new GUIContent("Use Custom " + urlName + " URL");
var urlLabel = new GUIContent("Custom " + urlName + " URL");
// Though the property may have double height, each child should have
// half that height.
position.height = EditorGUIUtility.singleLineHeight;
property.Next(false);
EditorGUI.PropertyField(position, property, useLabel);
if (property.boolValue)
{
property.Next(false);
position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(position, property, urlLabel);
}
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
// If "set custom log url" is true, need to make room for the text field.
property.Next(true);
property.Next(false);
var height = base.GetPropertyHeight(property, label);
if (property.boolValue)
{
height += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: ebeca1d941dd04282895d881deecbc6c
timeCreated: 1504725583
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,26 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
public interface IAppCenterSettingsMaker
{
bool IsAnalyticsAvailable();
bool IsCrashesAvailable();
void IsAllowNetworkRequests(bool isAllowed);
bool IsDistributeAvailable();
void StartAnalyticsClass();
void StartCrashesClass();
void StartDistributeClass();
void SetAppSecret(AppCenterSettings settings);
void SetTransmissionTargetToken(string transmissionTargetToken);
void SetLogLevel(int logLevel);
bool IsStartFromAppCenterBehavior(AppCenterSettingsAdvanced advancedSettings);
void SetStartupType(int startupType);
void SetLogUrl(string logUrl);
void SetApiUrl(string apiUrl);
void SetInstallUrl(string installUrl);
void SetMaxStorageSize(long size);
void CommitSettings();
void SetShouldEnableDistributeForDebuggableBuild();
void SetDistributeDisableAutomaticCheckForUpdate();
void SetUpdateTrack(int updateTrack);
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a40c6c75c7d49cd4ab84b0d6d68a509f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,35 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using UnityEngine;
using UnityEditor;
[CustomPropertyDrawer(typeof(MaxStorageSizeProperty))]
public class MaxStorageSizePropertyDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
var useLabel = new GUIContent("Use Custom Max Storage Size");
var urlLabel = new GUIContent("Max Storage Size Bytes");
position.height = EditorGUIUtility.singleLineHeight; // Though the property may have double height, each child should have half that height.
property.Next(true);
EditorGUI.PropertyField(position, property, useLabel);
if (property.boolValue)
{
property.Next(false);
position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(position, property, urlLabel);
}
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
property.Next(true); // If "Use Custom Max Storage Size" is true, need to make room for the text field.
var height = base.GetPropertyHeight(property, label);
if (property.boolValue)
{
height += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 428e5cf118c809a40b0fbc4b93d77e60
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,103 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using System.Reflection;
/*
* Wrapper class for PBXProject that invokes methods via reflection. Needed
* because there are cases when conditional compilation symbols are not
* defined soon enough to use the class directly. Using the class directly
* can cause problems on Windows machines that don't have the iOS build
* tool installed.
*/
public class PBXProjectWrapper
{
private static readonly Type PBXProjectType;
private object _pbxProject;
private string _projectPath;
static PBXProjectWrapper()
{
var xcExtensionsAssembly = Assembly.Load("UnityEditor.iOS.Extensions.Xcode");
if (xcExtensionsAssembly != null)
{
PBXProjectType = xcExtensionsAssembly.GetType("UnityEditor.iOS.Xcode.PBXProject");
}
}
public static string GetUnityTargetName()
{
var flags = BindingFlags.Public | BindingFlags.Static;
return PBXProjectType.GetMethod("GetUnityTargetName", flags)
.Invoke(PBXProjectType, null) as string;
}
public string GetUnityTargetGuid()
{
#if UNITY_2019_3_OR_NEWER
return PBXProjectType.GetMethod("GetUnityFrameworkTargetGuid")
.Invoke(_pbxProject, null).ToString();
#else
return null;
#endif
}
public static bool PBXProjectIsAvailable
{
get
{
return PBXProjectType != null;
}
}
public string ProjectPath
{
get
{
return _projectPath;
}
}
public PBXProjectWrapper(string pathToBuiltProject)
{
var flags = BindingFlags.Public | BindingFlags.Static;
var arguments = new object[] { pathToBuiltProject };
_projectPath = PBXProjectType.GetMethod("GetPBXProjectPath", flags)
.Invoke(PBXProjectType, arguments) as string;
_pbxProject = PBXProjectType.GetConstructor(Type.EmptyTypes).Invoke(null);
PBXProjectType.GetMethod("ReadFromFile").Invoke(_pbxProject, new[] { _projectPath });
}
public void WriteToFile()
{
PBXProjectType.GetMethod("WriteToFile").Invoke(_pbxProject, new[] { _projectPath });
}
#if UNITY_2019_3_OR_NEWER
public void AddBuildProperty(string name, string value, bool toFrameworkTarget = false)
#else
public void AddBuildProperty(string name, string value)
#endif
{
object targetGuid;
#if UNITY_2019_3_OR_NEWER
targetGuid = PBXProjectType.GetMethod("GetUnityMainTargetGuid")
.Invoke(_pbxProject, null);
if (toFrameworkTarget)
{
object frameworkTarget = PBXProjectType.GetMethod("GetUnityFrameworkTargetGuid").Invoke(_pbxProject, null);
PBXProjectType.GetMethod("AddBuildProperty", new[] { typeof(string), typeof(string), typeof(string) })
.Invoke(_pbxProject, new[] { frameworkTarget, name, value });
}
#else
var targetName = GetUnityTargetName();
targetGuid = PBXProjectType.GetMethod("TargetGuidByName")
.Invoke(_pbxProject, new object[] { targetName });
#endif
PBXProjectType.GetMethod("AddBuildProperty",
new[] { typeof(string), typeof(string), typeof(string) })
.Invoke(_pbxProject,
new[] { targetGuid, name, value });
}
}

View File

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: f4e4b5327bd6d4fa1b30a0da2ba6ae46
timeCreated: 1513288156
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,46 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using System.Reflection;
public class PlistDocumentWrapper
{
private object _plistDocument;
private string _path;
private static readonly Type PlistDocumentType;
static PlistDocumentWrapper()
{
var xcExtensionsAssembly = Assembly.Load("UnityEditor.iOS.Extensions.Xcode");
if (xcExtensionsAssembly != null)
{
PlistDocumentType = xcExtensionsAssembly.GetType("UnityEditor.iOS.Xcode.PlistDocument");
}
}
public static bool PlistDocumentIsAvailable
{
get
{
return PlistDocumentType != null;
}
}
public PlistDocumentWrapper(string path)
{
_path = path;
_plistDocument = PlistDocumentType.GetConstructor(Type.EmptyTypes).Invoke(null);
PlistDocumentType.GetMethod("ReadFromFile").Invoke(_plistDocument, new[] { _path });
}
public object GetRoot()
{
return PlistDocumentType.GetField("root").GetValue(_plistDocument);
}
public void WriteToFile()
{
PlistDocumentType.GetMethod("WriteToFile").Invoke(_plistDocument, new[] { _path });
}
}

View File

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 1fce65b4e1d6646dda661bf55f78e3f6
timeCreated: 1513288156
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,53 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using System.Reflection;
public class ProjectCapabilityManagerWrapper
{
private static readonly Type ProjectCapabilityManagerType;
private object _capabilityManager;
static ProjectCapabilityManagerWrapper()
{
var xcExtensionsAssembly = Assembly.Load("UnityEditor.iOS.Extensions.Xcode");
if (xcExtensionsAssembly != null)
{
ProjectCapabilityManagerType = xcExtensionsAssembly.GetType("UnityEditor.iOS.Xcode.ProjectCapabilityManager");
}
}
public void AddRemoteNotificationsToBackgroundModes()
{
var backgroundModesEnumType = ProjectCapabilityManagerType.Assembly.GetType("UnityEditor.iOS.Xcode.BackgroundModesOptions");
var remoteNotifEnum = Enum.Parse(backgroundModesEnumType, "RemoteNotifications");
ProjectCapabilityManagerType.GetMethod("AddBackgroundModes").Invoke(_capabilityManager, new object[] { remoteNotifEnum });
}
public static bool ProjectCapabilityManagerIsAvailable
{
get
{
return ProjectCapabilityManagerType != null;
}
}
public ProjectCapabilityManagerWrapper(string projectPath, string targetName, string targetGuid)
{
#if UNITY_2019_3_OR_NEWER
_capabilityManager = ProjectCapabilityManagerType
.GetConstructor(new[] { typeof(string), typeof(string), typeof(string), typeof(string) })
.Invoke(new object[] { projectPath, targetName + ".entitlements", targetName, targetGuid });
#else
_capabilityManager = ProjectCapabilityManagerType
.GetConstructor(new[] { typeof(string), typeof(string), typeof(string)})
.Invoke(new object[] { projectPath, targetName + ".entitlements", targetName });
#endif
}
public void WriteToFile()
{
ProjectCapabilityManagerType.GetMethod("WriteToFile").Invoke(_capabilityManager, null);
}
}

View File

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 6ca2e2a428dbc432c930ec7a5b186fba
timeCreated: 1513288156
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,40 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System.Collections.Generic;
using System.IO;
using System.Xml;
public static class XmlResourceHelper
{
public static void WriteXmlResource(string path, IDictionary<string, string> resourceValues)
{
var xws = new XmlWriterSettings
{
Indent = true
};
using (var sw = File.Create(path))
using (var xw = XmlWriter.Create(sw, xws))
{
xw.WriteStartDocument();
xw.WriteStartElement("resources");
foreach (var kvp in resourceValues)
{
if (!string.IsNullOrEmpty(kvp.Value))
{
xw.WriteStartElement("string");
xw.WriteAttributeString("name", kvp.Key);
xw.WriteAttributeString("translatable", "false");
xw.WriteString(kvp.Value);
xw.WriteEndElement();
}
}
xw.WriteEndElement();
xw.WriteEndDocument();
xw.Flush();
xw.Close();
}
}
}

View File

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: dc5634190b21448b6bdeac14c833304c
timeCreated: 1513106215
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e2b03a217b6ed8349b372a679a0f7aae
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: afed194a733530a4eb52e6e0d76a80b1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,34 @@
fileFormatVersion: 2
guid: 65a57d979f383420a894f22dfe19f005
folderAsset: yes
timeCreated: 1498496047
licenseType: Pro
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Android: Android
second:
enabled: 1
settings: {}
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,43 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using UnityEngine;
namespace Assets.AppCenter.Plugins.Android.Utility
{
class AndroidUtility
{
private static AndroidJavaObject _context;
private const string PREFS_NAME = "AppCenterUserPrefs";
public static AndroidJavaObject GetAndroidContext()
{
if (_context != null)
{
return _context;
}
var unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
var activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
_context = activity.Call<AndroidJavaObject>("getApplicationContext");
return _context;
}
public static void SetPreferenceInt(string prefKey, int prefValue)
{
AndroidJavaObject context = GetAndroidContext();
AndroidJavaObject sharedPreferences = context.Call<AndroidJavaObject>("getSharedPreferences", new object[] { PREFS_NAME, 0 });
AndroidJavaObject editor = sharedPreferences.Call<AndroidJavaObject>("edit");
editor = editor.Call<AndroidJavaObject>("putInt", new object[] { prefKey, prefValue });
editor.Call("apply");
}
public static void SetPreferenceString(string prefKey, string prefValue)
{
AndroidJavaObject context = GetAndroidContext();
AndroidJavaObject sharedPreferences = context.Call<AndroidJavaObject>("getSharedPreferences", new object[] { PREFS_NAME, 0 });
AndroidJavaObject editor = sharedPreferences.Call<AndroidJavaObject>("edit");
editor = editor.Call<AndroidJavaObject>("putString", new object[] { prefKey, prefValue });
editor.Call("apply");
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c7653ac593f8a4859bc75b4952e2a9dc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,49 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if UNITY_ANDROID
using System;
using System.Globalization;
using UnityEngine;
namespace Microsoft.AppCenter.Unity.Internal.Utility
{
public class JavaDateHelper
{
private const string DotNetDateFormat = "yyyy-MM-dd'T'HH:mm:ss.fffK";
private static AndroidJavaObject _javaDateFormatter;
private static AndroidJavaObject JavaDateFormatter
{
get
{
if (_javaDateFormatter == null)
{
_javaDateFormatter = new AndroidJavaObject("java.text.SimpleDateFormat", "yyyy-MM-dd'T'HH:mm:ss.SSSZ");
}
return _javaDateFormatter;
}
}
public static AndroidJavaObject DateTimeConvert(DateTime date)
{
// 'DotNetDateFormat' contains timezone info with time separator.
// 'javaDateFormatter' uses date format with timezone info without time separator.
// Time separator should be removed from date string before 'parse' call.
var dateString = date.ToString(DotNetDateFormat);
int separatorIndex = dateString.LastIndexOf(CultureInfo.CurrentCulture.DateTimeFormat.TimeSeparator);
dateString = dateString.Remove(separatorIndex, 1);
return JavaDateFormatter.Call<AndroidJavaObject>("parse", dateString);
}
public static DateTimeOffset DateTimeConvert(AndroidJavaObject date)
{
// Unable to use DateTimeOffset.ParseExact(dateString, DotNetDateFormat, CultureInfo.InvariantCulture) here
// because it throws "Invalid format string" exception
var dateString = JavaDateFormatter.Call<string>("format", date);
var dateTime = DateTime.ParseExact(dateString, DotNetDateFormat, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal);
return new DateTimeOffset(dateTime);
}
}
}
#endif

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: ebd2662d8c212481b8ae72fe6be77873
timeCreated: 1498578955
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,38 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if UNITY_ANDROID
using UnityEngine;
namespace Microsoft.AppCenter.Unity.Internal.Utility
{
public class JavaNumberHelper
{
public static AndroidJavaObject Convert(int val)
{
AndroidJavaObject javaInteger = new AndroidJavaObject("java.lang.Integer", val);
return javaInteger;
}
public static AndroidJavaObject Convert(long val)
{
AndroidJavaObject javaLong = new AndroidJavaObject("java.lang.Long", val);
return javaLong;
}
public static AndroidJavaObject Convert(float val)
{
AndroidJavaObject javaFloat = new AndroidJavaObject("java.lang.Float", val);
return javaFloat;
}
public static AndroidJavaObject Convert(double val)
{
AndroidJavaObject javaDouble = new AndroidJavaObject("java.lang.Double", val);
return javaDouble;
}
//TODO how to support decimal?
}
}
#endif

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: dcfb87d5b5fb94c77b4d361b4791a677
timeCreated: 1498578955
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,46 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if UNITY_ANDROID
using System;
using System.Linq;
using System.Collections.Generic;
using UnityEngine;
namespace Microsoft.AppCenter.Unity.Internal.Utility
{
public class JavaStringMapHelper
{
public static Dictionary<string, string> ConvertFromJava(AndroidJavaObject map)
{
var keySet = map.Call<AndroidJavaObject>("keySet");
var keyArray = keySet.Call<AndroidJavaObject>("toArray");
string[] keys = AndroidJNIHelper.ConvertFromJNIArray<string[]>(keyArray.GetRawObject());
var dictionary = new Dictionary<string, string>();
foreach (var key in keys)
{
var val = map.Call<string>("get", key);
dictionary[key] = val;
}
return dictionary;
}
public static AndroidJavaObject ConvertToJava(IDictionary<string, string> properties)
{
if (properties == null)
{
return null;
}
string[] keys = properties.Keys.ToArray();
string[] values = properties.Values.ToArray();
int count = properties.Count;
var javaMap = new AndroidJavaObject("java.util.HashMap");
for (int i = 0; i < count; ++i)
{
javaMap.Call<AndroidJavaObject>("put", keys[i], values[i]);
}
return javaMap;
}
}
}
#endif

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 80fb4bb7b657748d399b89f4367331e8
timeCreated: 1498496048
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,21 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
param
(
[Parameter(Position=0, Mandatory = $false, HelpMessage="Source folder", ValueFromPipeline = $true)]
$Source,
[Parameter(Position=1, Mandatory = $false, HelpMessage="Destination file path", ValueFromPipeline = $true)]
$Destination
)
Try
{
Add-Type -assembly "system.io.compression.filesystem"
[io.compression.zipfile]::CreateFromDirectory($Source, $Destination)
}
Catch
{
$Exc = $_.Exception.Message
Write-Error "File $Destination was not created. Error: $Exc"
}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 9fc0d4010bbf28b4594072e72b8655ab
guid: 27462eedb9e0e4dee8d0ff51fe4dee0d
DefaultImporter:
externalObjects: {}
userData:

View File

@ -0,0 +1,23 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
param
(
[Parameter(Position=0, Mandatory = $false, HelpMessage="Source file", ValueFromPipeline = $true)]
$Source,
[Parameter(Position=1, Mandatory = $false, HelpMessage="Destination path", ValueFromPipeline = $true)]
$Destination
)
New-Item -ItemType directory -Path $Destination
Try
{
Add-Type -assembly "system.io.compression.filesystem"
[io.compression.zipfile]::ExtractToDirectory($Source, $Destination)
}
Catch
{
$Exc = $_.Exception.Message
Write-Error "Folder $Destination was not created. Error: $Exc"
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7fff91df92b854ad680ee28ba1c36fce
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 6f313f109a3454802b5cae94a72ee306
timeCreated: 1504718816
licenseType: Pro
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Android: Android
second:
enabled: 1
settings: {}
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,31 @@
fileFormatVersion: 2
guid: 20e621e7423ed4dd4b6826b8dab0c7eb
timeCreated: 1512463304
licenseType: Free
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 68c3a86f609b440b1b95a05639da7861
timeCreated: 1504718816
licenseType: Pro
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Android: Android
second:
enabled: 1
settings: {}
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 1865e2b19b6434dcf9e4f48f7208d7a0
timeCreated: 1503351439
licenseType: Pro
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Android: Android
second:
enabled: 1
settings: {}
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 10c16a9d75c5c48cca25985ae8bf3ec6
timeCreated: 1504718816
licenseType: Pro
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Android: Android
second:
enabled: 1
settings: {}
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4de8fbe7ed99aa245bf6616636b6c980
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3834fae7b40ff624cbea26abb8c648d4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 3081e1f5b9e3f4598ba1d4ec33c30d17
folderAsset: yes
timeCreated: 1498059874
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,96 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if UNITY_ANDROID && !UNITY_EDITOR
using System;
using System.Collections.Generic;
using Microsoft.AppCenter.Unity.Internal.Utility;
using UnityEngine;
namespace Microsoft.AppCenter.Unity.Analytics.Internal
{
class AnalyticsInternal
{
private static AndroidJavaClass _analytics = new AndroidJavaClass("com.microsoft.appcenter.analytics.Analytics");
public static void PrepareEventHandlers()
{
AppCenterBehavior.InitializedAppCenterAndServices += PostInitialize;
}
private static void PostInitialize()
{
var instance = _analytics.CallStatic<AndroidJavaObject>("getInstance");
AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
instance.Call("onActivityResumed", activity);
}
public static void AddNativeType(List<IntPtr> nativeTypes)
{
nativeTypes.Add(AndroidJNI.FindClass("com/microsoft/appcenter/analytics/Analytics"));
}
public static void TrackEvent(string eventName)
{
_analytics.CallStatic("trackEvent", eventName);
}
public static void TrackEvent(string eventName, int flags)
{
_analytics.CallStatic("trackEvent", eventName, null, flags);
}
public static void TrackEventWithProperties(string eventName, IDictionary<string, string> properties)
{
var androidProperties = JavaStringMapHelper.ConvertToJava(properties);
_analytics.CallStatic("trackEvent", eventName, androidProperties);
}
public static void TrackEventWithProperties(string eventName, EventProperties properties)
{
_analytics.CallStatic("trackEvent", eventName, properties.GetRawObject());
}
public static void TrackEventWithProperties(string eventName, IDictionary<string, string> properties, int flags)
{
var androidProperties = JavaStringMapHelper.ConvertToJava(properties);
_analytics.CallStatic("trackEvent", eventName, androidProperties, flags);
}
public static void TrackEventWithProperties(string eventName, EventProperties properties, int flags)
{
_analytics.CallStatic("trackEvent", eventName, properties.GetRawObject(), flags);
}
public static AppCenterTask SetEnabledAsync(bool isEnabled)
{
var future = _analytics.CallStatic<AndroidJavaObject>("setEnabled", isEnabled);
return new AppCenterTask(future);
}
public static AppCenterTask<bool> IsEnabledAsync()
{
var future = _analytics.CallStatic<AndroidJavaObject>("isEnabled");
return new AppCenterTask<bool>(future);
}
public static AndroidJavaObject GetTransmissionTarget(string transmissionTargetToken, out bool success)
{
var target = _analytics.CallStatic<AndroidJavaObject>("getTransmissionTarget", transmissionTargetToken);
success = target != null;
return target;
}
public static void Pause()
{
_analytics.CallStatic("pause");
}
public static void Resume()
{
_analytics.CallStatic("resume");
}
}
}
#endif

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a713100f59727486c9ad45c500332234
timeCreated: 1497467718
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,44 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using UnityEngine;
#if UNITY_ANDROID && !UNITY_EDITOR
using Microsoft.AppCenter.Unity.Internal.Utility;
namespace Microsoft.AppCenter.Unity.Analytics.Internal
{
class EventPropertiesInternal
{
public static AndroidJavaObject Create()
{
return new AndroidJavaObject("com.microsoft.appcenter.analytics.EventProperties");
}
public static void SetString(AndroidJavaObject properties, string key, string val)
{
properties.Call<AndroidJavaObject>("set", key, val);
}
public static void SetNumber(AndroidJavaObject properties, string key, long val)
{
properties.Call<AndroidJavaObject>("set", key, val);
}
public static void SetNumber(AndroidJavaObject properties, string key, double val)
{
properties.Call<AndroidJavaObject>("set", key, val);
}
public static void SetBool(AndroidJavaObject properties, string key, bool val)
{
properties.Call<AndroidJavaObject>("set", key, val);
}
public static void SetDate(AndroidJavaObject properties, string key, DateTime val)
{
properties.Call<AndroidJavaObject>("set", key, JavaDateHelper.DateTimeConvert(val));
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 514cee750a1f56f4bab5c663b3a4f557
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,70 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if UNITY_ANDROID && !UNITY_EDITOR
using UnityEngine;
using Microsoft.AppCenter.Unity.Internal.Utility;
using System;
namespace Microsoft.AppCenter.Unity.Analytics
{
public class PropertyConfiguratorInternal
{
public static void SetAppName(AndroidJavaObject propertyConfigurator, string appName)
{
propertyConfigurator.Call("setAppName", appName);
}
public static void SetUserId(AndroidJavaObject propertyConfigurator, string userId)
{
propertyConfigurator.Call("setUserId", userId);
}
public static void SetAppVersion(AndroidJavaObject propertyConfigurator, string appVersion)
{
propertyConfigurator.Call("setAppVersion", appVersion);
}
public static void SetAppLocale(AndroidJavaObject propertyConfigurator, string appLocale)
{
propertyConfigurator.Call("setAppLocale", appLocale);
}
public static void CollectDeviceId(AndroidJavaObject propertyConfigurator)
{
propertyConfigurator.Call("collectDeviceId");
}
public static void SetEventProperty(AndroidJavaObject propertyConfigurator, string key, string value)
{
propertyConfigurator.Call("setEventProperty", key, value);
}
public static void SetEventProperty(AndroidJavaObject propertyConfigurator, string key, DateTime value)
{
var javaDate = JavaDateHelper.DateTimeConvert(value);
propertyConfigurator.Call("setEventProperty", key, javaDate);
}
public static void SetEventProperty(AndroidJavaObject propertyConfigurator, string key, long value)
{
propertyConfigurator.Call("setEventProperty", key, value);
}
public static void SetEventProperty(AndroidJavaObject propertyConfigurator, string key, double value)
{
propertyConfigurator.Call("setEventProperty", key, value);
}
public static void SetEventProperty(AndroidJavaObject propertyConfigurator, string key, bool value)
{
propertyConfigurator.Call("setEventProperty", key, value);
}
public static void RemoveEventProperty(AndroidJavaObject propertyConfigurator, string key)
{
propertyConfigurator.Call("removeEventProperty", key);
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e670e8c4e24f54cb3b15b96cba63313b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,82 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if UNITY_ANDROID && !UNITY_EDITOR
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Microsoft.AppCenter.Unity.Analytics.Internal;
using Microsoft.AppCenter.Unity.Internal.Utility;
namespace Microsoft.AppCenter.Unity.Analytics
{
public class TransmissionTargetInternal
{
public static void TrackEvent(AndroidJavaObject transmissionTarget, string eventName)
{
transmissionTarget.Call("trackEvent", eventName);
}
public static void TrackEvent(AndroidJavaObject transmissionTarget, string eventName, int flags)
{
transmissionTarget.Call("trackEvent", eventName, null, flags);
}
public static void TrackEventWithProperties(AndroidJavaObject transmissionTarget, string eventName, IDictionary<string, string> properties)
{
var androidProperties = JavaStringMapHelper.ConvertToJava(properties);
transmissionTarget.Call("trackEvent", eventName, androidProperties);
}
public static void TrackEventWithProperties(AndroidJavaObject transmissionTarget, string eventName, EventProperties properties)
{
transmissionTarget.Call("trackEvent", eventName, properties.GetRawObject());
}
public static void TrackEventWithProperties(AndroidJavaObject transmissionTarget, string eventName, IDictionary<string, string> properties, int flags)
{
var androidProperties = JavaStringMapHelper.ConvertToJava(properties);
transmissionTarget.Call("trackEvent", eventName, androidProperties, flags);
}
public static void TrackEventWithProperties(AndroidJavaObject transmissionTarget, string eventName, EventProperties properties, int flags)
{
transmissionTarget.Call("trackEvent", eventName, properties.GetRawObject(), flags);
}
public static AppCenterTask SetEnabledAsync(AndroidJavaObject transmissionTarget, bool enabled)
{
var future = transmissionTarget.Call<AndroidJavaObject>("setEnabledAsync", enabled);
return new AppCenterTask(future);
}
public static AppCenterTask<bool> IsEnabledAsync(AndroidJavaObject transmissionTarget)
{
var future = transmissionTarget.Call<AndroidJavaObject>("isEnabledAsync");
return new AppCenterTask<bool>(future);
}
public static AndroidJavaObject GetTransmissionTarget(AndroidJavaObject transmissionTargetParent, string transmissionTargetToken, out bool success)
{
var target = transmissionTargetParent.Call<AndroidJavaObject>("getTransmissionTarget", transmissionTargetToken);
success = target != null;
return target;
}
public static AndroidJavaObject GetPropertyConfigurator(AndroidJavaObject transmissionTarget)
{
return transmissionTarget.Call<AndroidJavaObject>("getPropertyConfigurator");
}
public static void Pause(AndroidJavaObject transmissionTarget)
{
transmissionTarget.Call("pause");
}
public static void Resume(AndroidJavaObject transmissionTarget)
{
transmissionTarget.Call("resume");
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9b4de3e63b6764e059567a9e87feda60
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 05baa696b2306473096af3c82bf25429
folderAsset: yes
timeCreated: 1498059884
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,83 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if (!UNITY_IOS && !UNITY_ANDROID && !UNITY_WSA_10_0) || UNITY_EDITOR
using System;
using System.Collections.Generic;
namespace Microsoft.AppCenter.Unity.Analytics.Internal
{
#if UNITY_IOS || UNITY_ANDROID
using RawType = System.IntPtr;
#else
using RawType = System.Type;
#endif
#if UNITY_IOS
using TransmissionTargetType = System.IntPtr;
#elif UNITY_ANDROID
using TransmissionTargetType = UnityEngine.AndroidJavaObject;
#else
using TransmissionTargetType = System.Object;
#endif
class AnalyticsInternal
{
public static void PrepareEventHandlers()
{
}
public static void AddNativeType(List<RawType> nativeTypes)
{
}
public static void TrackEvent(string eventName)
{
}
public static void TrackEvent(string eventName, int flags)
{
}
public static void TrackEventWithProperties(string eventName, IDictionary<string, string> properties)
{
}
public static void TrackEventWithProperties(string eventName, EventProperties properties)
{
}
public static void TrackEventWithProperties(string eventName, IDictionary<string, string> properties, int flags)
{
}
public static void TrackEventWithProperties(string eventName, EventProperties properties, int flags)
{
}
public static AppCenterTask SetEnabledAsync(bool enabled)
{
return AppCenterTask.FromCompleted();
}
public static AppCenterTask<bool> IsEnabledAsync()
{
return AppCenterTask<bool>.FromCompleted(false);
}
public static TransmissionTargetType GetTransmissionTarget(string transmissionTargetToken, out bool success)
{
success = false;
return default(TransmissionTargetType);
}
public static void Pause()
{
}
public static void Resume()
{
}
}
}
#endif

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 632c05efd92fe4ec9b424381b5392d76
timeCreated: 1497465139
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,41 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if (!UNITY_IOS && !UNITY_ANDROID && !UNITY_WSA_10_0) || UNITY_EDITOR
using System;
namespace Microsoft.AppCenter.Unity.Analytics.Internal
{
#if UNITY_IOS
using RawType = System.IntPtr;
#elif UNITY_ANDROID
using RawType = UnityEngine.AndroidJavaObject;
#else
using RawType = System.Object;
#endif
class EventPropertiesInternal
{
public static RawType Create()
{
return default(RawType);
}
public static void SetString(RawType properties, string key, string val)
{
}
public static void SetNumber(RawType properties, string key, object val)
{
}
public static void SetBool(RawType properties, string key, bool val)
{
}
public static void SetDate(RawType properties, string key, DateTime val)
{
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 61494a0be6a398041ad0f0aa1de5408e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,66 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if (!UNITY_IOS && !UNITY_ANDROID && !UNITY_WSA_10_0) || UNITY_EDITOR
using System;
using System.Collections.Generic;
using Microsoft.AppCenter.Unity.Analytics.Internal;
namespace Microsoft.AppCenter.Unity.Analytics
{
#if UNITY_IOS
using RawType = System.IntPtr;
#elif UNITY_ANDROID
using RawType = UnityEngine.AndroidJavaObject;
#else
using RawType = System.Object;
#endif
public class PropertyConfiguratorInternal
{
public static void SetAppName(RawType propertyConfigurator, string appName)
{
}
public static void SetUserId(RawType propertyConfigurator, string userId)
{
}
public static void SetAppVersion(RawType propertyConfigurator, string appVersion)
{
}
public static void SetAppLocale(RawType propertyConfigurator, string appLocale)
{
}
public static void CollectDeviceId(RawType propertyConfigurator)
{
}
public static void SetEventProperty(RawType propertyConfigurator, string key, string value)
{
}
public static void SetEventProperty(RawType propertyConfigurator, string key, DateTime value)
{
}
public static void SetEventProperty(RawType propertyConfigurator, string key, long value)
{
}
public static void SetEventProperty(RawType propertyConfigurator, string key, double value)
{
}
public static void SetEventProperty(RawType propertyConfigurator, string key, bool value)
{
}
public static void RemoveEventProperty(RawType propertyConfigurator, string key)
{
}
}
}
#endif

Some files were not shown because too many files have changed in this diff Show More