Compare commits

...
275 Commits
Author SHA1 Message Date
lishuo 11693c40af 忽略video插件 2022-06-30 14:43:01 +08:00
lishuo 4d4f8feb8b c2课程同步 2022-06-30 14:39:13 +08:00
lishuo 46f7c2d4b1 解决阻力设置点击无效的bug 2022-06-28 11:03:10 +08:00
lishuo 06b9051b3c c2同步课程命令 2022-06-24 18:03:36 +08:00
lishuo 701ec3069b C2课程同步问题 2022-06-23 18:55:08 +08:00
lishuo 84b3e1e7a4 移除测试代码 2022-06-21 18:55:13 +08:00
lishuo 573b96d86c 拉力曲线性能优化&解决划船时间误差问题 2022-06-21 17:49:43 +08:00
lishuo 6c9b3f825a 解决没有设备号的问题 2022-06-15 18:07:06 +08:00
lishuo 6e091bd99c anroid ble jar包调整 2022-06-15 16:58:22 +08:00
lishuo 610c98f9b8 解决c2表头设定课程后抖动问题,设备断开失败问题 2022-06-15 16:42:07 +08:00
lishuo 0202814f67 心率,阻力逻辑调整 2022-06-14 18:37:58 +08:00
lishuo f25d0b7b8c 蓝牙断开重连相关逻辑优化 2022-06-13 18:59:02 +08:00
lishuo 87a0e7fb6d 划船机优化 2022-06-10 19:31:07 +08:00
lishuo 2f64aa494f 移动端蓝牙优化 2022-06-09 14:52:50 +08:00
lishuo 72f254af2a 蓝牙重复初始化问题 2022-06-09 14:52:45 +08:00
lishuo 6b3dd70c61 设备连接界面断开逻辑调整 2022-06-08 17:25:02 +08:00
lishuo 46b6c7fa01 设备连接稳定性 2022-06-08 16:22:07 +08:00
Caiyanpeng c333086e30 重置问题 2022-06-08 13:55:35 +08:00
Caiyanpeng c7afcbb01f Merge branch 'dev_cyp' into dev_cyp1
# Conflicts:
#	Assets/Scripts/UI/Prefab/Panel/RowerHomeScript.cs
2022-06-07 11:32:46 +08:00
Caiyanpeng ff878d5d50 修改断线重连自动开始问题 2022-06-07 11:32:23 +08:00
lishuo b236e939f4 graph优化
# Conflicts:
#	Assets/Scripts/UI/Prefab/Panel/RowerHomeScript.cs
2022-06-06 19:55:08 +08:00
Caiyanpeng bfc56dded5 0606修改 2022-06-06 18:54:28 +08:00
Caiyanpeng 6effadc1e9 增加长时间保存,解决取影子以后后续请求失效问题(使用unity的请求库) 2022-06-06 09:09:20 +08:00
Caiyanpeng d498dd9148 日志包 2022-06-02 15:52:10 +08:00
lishuo 71c9907c89 UImanager show方法会产生多余的HomeController 2022-06-01 19:49:15 +08:00
Caiyanpeng 154252e3c3 Merge remote-tracking branch 'origin/dev_ani3' into dev_cyp 2022-06-01 16:24:36 +08:00
lishuo cda569afd5 性能优化 2022-06-01 16:10:42 +08:00
Caiyanpeng 475250e795 Merge remote-tracking branch 'origin/dev_ani3' into dev_cyp 2022-06-01 16:10:35 +08:00
lishuo c579c1b130 Merge remote-tracking branch 'origin/dev_cyp' into dev_ani3 2022-06-01 10:50:16 +08:00
lishuo d9848e4e9d 设备连接界面微调&划船机本地记录过滤 2022-06-01 10:24:23 +08:00
Caiyanpeng 622aaa3b6d 重连后续修改 2022-06-01 09:54:20 +08:00
lishuo e7af21b126 pc设备连接界面微调 2022-05-31 19:43:50 +08:00
Caiyanpeng bfa9f5f998 Merge remote-tracking branch 'origin/dev_ani3' into dev_cyp 2022-05-31 18:42:13 +08:00
Caiyanpeng 3f8c189ad4 断线重连取数据逻辑 2022-05-31 18:40:32 +08:00
lishuo a1010091f8 设备连接界面文案与交互调整 2022-05-31 18:25:53 +08:00
Caiyanpeng 167a424505 Merge remote-tracking branch 'origin/dev_ani3' into dev_cyp
# Conflicts:
#	Assets/Scripts/UI/Prefab/Panel/RowerHomeScript.cs
2022-05-31 16:51:37 +08:00
Caiyanpeng ff6d61a606 修改其他的 2022-05-31 16:51:07 +08:00
lishuo 2524e3a004 划船机实时保存 2022-05-31 16:47:21 +08:00
lishuo 95df03e540 chart内存性能优化 2022-05-31 14:43:05 +08:00
Caiyanpeng be687d6b77 适配v1表头,性能优化一波 2022-05-11 17:11:48 +08:00
Caiyanpeng edc629ed75 5.9修改暂存 2022-05-10 18:43:41 +08:00
Caiyanpeng cfa1cc4f7b 4.29计算逻辑修改 2022-04-29 18:39:41 +08:00
Caiyanpeng 3c4ecf3e83 曲线调整 2022-04-29 08:58:42 +08:00
Caiyanpeng f47f5c9ff6 0426动画等修改 2022-04-27 14:48:06 +08:00
Caiyanpeng affc775226 调整后提交 2022-04-20 18:22:54 +08:00
Caiyanpeng a2de06fede Merge branch 'dev_ani2' into dev_ani3
# Conflicts:
#	Assets/Scripts/UI/Prefab/Rower/RowerMultiModeScript.cs
2022-04-15 17:13:55 +08:00
Caiyanpeng 2f9dd43e07 1s 2022-04-15 17:13:34 +08:00
Caiyanpeng c8076494fb 3s 2022-04-15 11:14:27 +08:00
Caiyanpeng 41240b1398 动画修改一波 2022-04-15 11:14:22 +08:00
Caiyanpeng f383c54507 4.14修改,设备连接去掉ftms骑行台 2022-04-14 19:18:44 +08:00
Caiyanpeng 29e7219c21 位移动画 2022-04-13 18:08:55 +08:00
Caiyanpeng d44638354d 4.13修改细节,位移动画前暂存 2022-04-13 15:44:02 +08:00
Caiyanpeng 874dec5ec6 新版本动画:上下滑动切换有箭头 2022-04-12 19:08:58 +08:00
Caiyanpeng 7780dc5ee5 3d翻转 2022-04-11 11:40:02 +08:00
Caiyanpeng 95ab695632 之前动画加上排名变化 2022-04-07 14:19:58 +08:00
Caiyanpeng 92d0579060 中文版 2022-04-07 09:23:44 +08:00
Caiyanpeng 0a4925bb39 修改bug 2022-04-02 18:15:09 +08:00
Caiyanpeng 30e09c9c7a 修改细节,修复bug 2022-04-01 18:07:16 +08:00
Caiyanpeng 06aefb93c4 适配C2划船机课程和menu 2022-03-30 18:25:51 +08:00
Caiyanpeng e0649f7ea1 修改新设计稿,保存每次划船的影子id;修改细节,增加c2适配前暂存 2022-03-29 18:12:21 +08:00
Caiyanpeng ab653b994f 适配c2;新版设计稿;对战切换手势;主逻辑接通;使用think的阻力值,修改影子模式船位置 2022-03-25 18:02:34 +08:00
Caiyanpeng e6f3e2ecfa Merge branch 'dev_rower' into dev_cyp
# Conflicts:
#	ProjectSettings/ProjectSettings.asset
2022-03-09 09:12:42 +08:00
Caiyanpeng e3f5280d94 暂存 2022-03-09 09:11:53 +08:00
Caiyanpeng c3514df331 请求公开线路;增加移动版 2022-03-03 15:06:13 +08:00
Caiyanpeng 01df299251 邮件功能完成 2022-03-02 17:54:06 +08:00
Caiyanpeng b039388a59 改为线上 2022-02-25 09:31:17 +08:00
Caiyanpeng 0c42fbe2cd Merge remote-tracking branch 'origin/dev_lishuo' into dev_cyp 2022-02-24 14:48:50 +08:00
Caiyanpeng 7e67184248 不给功率;修改比赛卡片有海拔图的异常问题 2022-02-24 11:35:26 +08:00
lishuo c1c93c2a60 loading页面优化 2022-02-24 11:33:24 +08:00
Caiyanpeng 353c19662c Merge remote-tracking branch 'origin/dev_lishuo' into dev_cyp 2022-02-24 08:58:14 +08:00
Caiyanpeng 3b0ffd78e7 分享文案 2022-02-24 08:58:03 +08:00
lishuo ed9dc53093 loading60%问题,只要加载到第一个瓦片的高度就可以直接骑行 2022-02-23 18:14:31 +08:00
lishuo 6a0bd67a6e Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2022-02-23 11:31:23 +08:00
Caiyanpeng 1e350fbb4d 更改为测试服务器,广告队列判空 2022-02-23 11:29:41 +08:00
Caiyanpeng 768f8261da 英文版本,pc分享功能,移动端fb分享,修改细节 2022-02-22 18:11:26 +08:00
lishuo 0c1c2ed382 保存优化&本地记录自动上传 2022-02-21 16:16:35 +08:00
Caiyanpeng 2c7d02ec9a 修改细节,开始搞pc 2022-02-18 18:12:31 +08:00
lishuo f5294b0d39 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo
# Conflicts:
#	Assets/Scripts/App.cs
2022-02-18 15:49:54 +08:00
Caiyanpeng 365fab22d4 修改细节 2022-02-18 15:48:23 +08:00
Caiyanpeng 1b3743a135 修改活动逻辑;增加一些接口;可弹多个广告 2022-02-17 16:56:18 +08:00
Caiyanpeng 1148e29379 活动暂存 2022-02-16 18:22:27 +08:00
Caiyanpeng 7c1d1e797c 开放划船机,增加阻力设置 2022-02-11 17:38:23 +08:00
Caiyanpeng e231d3540e 活动暂存 2022-02-11 17:26:36 +08:00
lishuo 5f0efe3995 修复ios蓝牙关闭功率不变的问题 2022-02-11 17:00:28 +08:00
Caiyanpeng 17aee7a740 修改bug 2022-02-11 13:46:38 +08:00
Caiyanpeng c12df53c18 ios快捷登录 2022-01-27 16:54:20 +08:00
Caiyanpeng a625db3ebe 短通知bug;安卓更新中文补全 2022-01-26 17:25:07 +08:00
Caiyanpeng 7476af7701 手机端直接隐藏通知;安卓64位 2022-01-26 13:48:11 +08:00
Caiyanpeng c4bcb36356 Merge remote-tracking branch 'origin/dev_lishuo' into dev_cyp 2022-01-26 10:53:46 +08:00
Caiyanpeng 5edd784080 消息通知逻辑 2022-01-26 10:53:11 +08:00
lishuo 0644421279 loading页国旗默认白色图片 2022-01-26 10:24:47 +08:00
Caiyanpeng 28487b295b 进入比赛默认3d 2022-01-25 18:48:37 +08:00
Caiyanpeng 2abb2d81a2 Merge remote-tracking branch 'origin/dev_lishuo' into dev_cyp 2022-01-25 18:29:27 +08:00
Caiyanpeng 1271e8e5d9 设置通知默认不显示 2022-01-25 18:29:22 +08:00
lishuo f16883465f 观察者切换人物大小问题 2022-01-25 18:25:40 +08:00
Caiyanpeng 3da12c3054 Merge remote-tracking branch 'origin/dev_lishuo' into dev_cyp 2022-01-25 17:17:17 +08:00
Caiyanpeng 0a9adb19e6 修改动画;漏掉的汉化;上传图标 2022-01-25 17:15:05 +08:00
lishuo d4fbeeefc2 赛事默认3d地图&观察者人物动画bug修复&重新连接根据用户id筛选 2022-01-25 17:14:19 +08:00
lishuo 37873427e3 PC点击区域&PFbutton微调 2022-01-25 11:17:42 +08:00
lishuo 5340d3d58b Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2022-01-25 09:28:20 +08:00
Caiyanpeng cd162f3325 长通知和切换场景保留消息 2022-01-24 15:41:04 +08:00
lishuo 9d48c05ef0 赛事默认3d视角&loading页面国旗问题 2022-01-24 11:39:48 +08:00
Caiyanpeng 7bb5bafbd2 ios端google;修改ios打包时pod数据源为清华 2022-01-20 16:30:58 +08:00
Caiyanpeng 58a8233697 google 登录暂存 2022-01-19 13:42:12 +08:00
Caiyanpeng 45b3ee5bbc 工具栏问题修改,中文 2022-01-13 22:56:47 +08:00
Caiyanpeng 0458a23c20 Merge remote-tracking branch 'origin/dev_lishuo' into dev_cyp 2022-01-13 20:00:09 +08:00
Caiyanpeng 2bf534775f dotween允许回调 2022-01-13 20:00:04 +08:00
lishuo 8f022e83a6 赛事人物微调 2022-01-13 19:57:49 +08:00
Caiyanpeng fed54ad85b Merge remote-tracking branch 'origin/dev_lishuo' into dev_cyp 2022-01-13 18:58:01 +08:00
lishuo 5bc1bec425 赛事loading和退出弹窗调整 2022-01-13 18:57:30 +08:00
Caiyanpeng 5489fa2a24 Merge remote-tracking branch 'origin/dev_lishuo' into dev_cyp 2022-01-13 18:50:55 +08:00
Caiyanpeng d89deba02c 修改bug 2022-01-13 18:50:51 +08:00
lishuo 8a2d4f7b85 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2022-01-13 17:13:08 +08:00
lishuo d33e130eca 退出窗口层级微调 2022-01-13 17:11:04 +08:00
Caiyanpeng 0a1ba5fbde Merge remote-tracking branch 'origin/dev_lishuo' into dev_cyp 2022-01-13 16:53:05 +08:00
Caiyanpeng e82592722f 首页弹消息bug;隐藏google 2022-01-13 16:53:01 +08:00
lishuo e70a84db98 骑行退出面板层级调整至modalpanel 2022-01-13 16:48:37 +08:00
Caiyanpeng 697818bae4 Merge remote-tracking branch 'origin/dev_lishuo' into dev_cyp 2022-01-13 15:36:20 +08:00
Caiyanpeng 4d5523e2ff fb分享;比赛页面箭头去了 2022-01-13 15:35:57 +08:00
lishuo 79ad622026 赛事loading页面条调整 2022-01-13 14:50:23 +08:00
lishuo dd1d26e9c8 pc赛事loading隐藏 2022-01-13 13:43:09 +08:00
Caiyanpeng 7a7c1ee55c google处理 2022-01-13 13:16:45 +08:00
Caiyanpeng bc5e4d14e4 Merge remote-tracking branch 'origin/dev_lishuo' into dev_cyp 2022-01-13 13:13:28 +08:00
Caiyanpeng 2fec28e7cd 打包改为移动端 2022-01-13 13:13:24 +08:00
lishuo 77414ad387 骑行结果移动端增加dnf和新记录的标识 2022-01-13 10:46:59 +08:00
Caiyanpeng 10ffd8160a Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp 2022-01-13 08:57:48 +08:00
lishuo dc4cf87bc4 在线人海拔图位置超出边界隐藏 2022-01-12 18:27:00 +08:00
Caiyanpeng c53fbffe55 增加第三方信息绑定,修改细节 2022-01-12 18:16:17 +08:00
Caiyanpeng 02111a57b1 Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp
# Conflicts:
#	Assets/Resources/UI/language.json
2022-01-12 16:56:50 +08:00
Caiyanpeng 91fa3cc82d pc版首页;安卓google登录;解决fb登录ios问题 2022-01-12 16:55:57 +08:00
lishuo 61fefda590 微调 2022-01-12 16:45:13 +08:00
lishuo f7450f0067 骑行视角增加至5级&保存逻辑增加100m不可以保存 2022-01-12 16:41:52 +08:00
Caiyanpeng f0df68bbda banner bug;maxranking修改 2022-01-12 10:29:10 +08:00
lishuo f949c531a6 我的排名微调 2022-01-11 19:08:34 +08:00
Caiyanpeng 939774bd42 Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp 2022-01-11 18:00:53 +08:00
lishuo 9aecb4ce2a 移动端兼容问题 2022-01-11 16:30:36 +08:00
Caiyanpeng 623cad18b2 Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp 2022-01-11 16:21:45 +08:00
Caiyanpeng 5672898ce4 工具栏修改 2022-01-11 16:21:13 +08:00
lishuo 90be662db1 loading页&骑行页面记忆跳转 2022-01-11 16:19:18 +08:00
Caiyanpeng 05e3d2f887 Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp 2022-01-11 13:51:13 +08:00
Caiyanpeng e20ddb9bc1 修改细节 2022-01-11 13:51:05 +08:00
lishuo bdfe1f6ee7 结果页调整 2022-01-11 13:48:06 +08:00
Caiyanpeng 27ea20b1c8 Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp 2022-01-11 11:18:18 +08:00
Caiyanpeng 5bf7635f1e pc修改 2022-01-11 11:18:09 +08:00
lishuo dbabaae032 结果页&loading页修改 2022-01-10 18:26:30 +08:00
Caiyanpeng d811eb8514 pc暂存 2022-01-10 14:59:06 +08:00
Caiyanpeng f070f5a36c 修改maplist;苹果处理 2022-01-10 10:28:03 +08:00
Caiyanpeng 7431228d2f 0107修改 2022-01-07 22:46:35 +08:00
Caiyanpeng e5067228b2 发布版本 2022-01-07 20:43:14 +08:00
Caiyanpeng e87429d528 修改细节 2022-01-07 18:22:22 +08:00
Caiyanpeng 79849bd537 Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp 2022-01-07 15:11:44 +08:00
Caiyanpeng 9fb819b6fe banner种类增加;集合详情增加作者;排行榜轮换功能 2022-01-07 15:11:40 +08:00
lishuo 082b45c43c 实时保存微调 2022-01-07 14:33:31 +08:00
Caiyanpeng fa0d9e973c Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp 2022-01-07 11:05:43 +08:00
Caiyanpeng f5385e31d6 修改nav;增加消息弹窗 2022-01-07 11:05:32 +08:00
lishuo 300c61a883 推荐banner增加赛事 2022-01-07 11:03:49 +08:00
lishuo 16a89b07b8 推荐api&骑行结果日期格式已经跳转到记录 2022-01-07 10:34:16 +08:00
lishuo 14e9e8e23b Merge remote-tracking branch 'origin/dev_cyp' into dev_nonearth
# Conflicts:
#	Assets/Scripts/Scenes/MainController.cs
2022-01-06 18:03:12 +08:00
lishuo 43dc844998 loading页面Tips调整&骑行卡顿问题解决 2022-01-06 18:01:48 +08:00
Caiyanpeng 2d38b63c91 暂存 2022-01-06 17:51:17 +08:00
lishuo 0628bd3716 loading调整&骑行动画&角度手势方向调整 2022-01-06 10:58:52 +08:00
Caiyanpeng ba36014712 微调 2022-01-05 14:02:51 +08:00
Caiyanpeng 537ae2d6ed banner手势滑动,点击效果;自动滚动 2022-01-05 09:24:06 +08:00
Caiyanpeng 7f7318fb36 消息轮播bug修改;内容滚动匀速播放;收藏图标变大 2021-12-31 11:23:16 +08:00
Caiyanpeng 333c99fb46 一波小改动 2021-12-30 16:51:04 +08:00
Caiyanpeng c5500c269f Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp 2021-12-29 20:31:34 +08:00
lishuo 8a469c3a74 view all404问题 2021-12-29 19:57:24 +08:00
Caiyanpeng 914e2719c1 Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp 2021-12-29 19:48:23 +08:00
Caiyanpeng 0fe5b3a953 微信分享问题解决 2021-12-29 19:48:15 +08:00
lishuo 088ab9a2b8 比赛分享标题&tcp微调 2021-12-29 19:06:00 +08:00
Caiyanpeng 816742898f Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp 2021-12-29 17:40:45 +08:00
lishuo 6055b2010b 分享问题修复 2021-12-29 17:39:55 +08:00
Caiyanpeng eab147c263 Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp 2021-12-29 17:22:51 +08:00
Caiyanpeng 0e16fec75a 图片模糊功能bug修改 2021-12-29 17:17:15 +08:00
lishuo eece0cffa5 Merge remote-tracking branch 'origin/dev_cyp' into dev_nonearth
# Conflicts:
#	Assets/Resources/UI/language.json
2021-12-29 17:07:34 +08:00
Caiyanpeng 95d845ac0f Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp 2021-12-29 17:06:04 +08:00
Caiyanpeng 8dde7520ad 修改细节 2021-12-29 17:05:58 +08:00
lishuo d4fa2bbb69 骑行保存数据改成同步 2021-12-29 17:05:07 +08:00
lishuo f3f17c1256 loading页面微调 2021-12-29 15:31:01 +08:00
Caiyanpeng be731c471b Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp 2021-12-29 14:51:27 +08:00
lishuo 7661a4e61d 全局缓存线路列表 2021-12-29 14:50:57 +08:00
Caiyanpeng 0ab425cb52 Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp
# Conflicts:
#	Assets/Resources/UI/language.json
2021-12-29 14:49:07 +08:00
lishuo b8a3a30629 骑行loading&赛事计时板调整 2021-12-29 14:40:58 +08:00
Caiyanpeng bac3334a01 修改细节 2021-12-29 14:23:37 +08:00
Caiyanpeng b3f6bb6861 Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp
# Conflicts:
#	Assets/Scripts/Scenes/Ride/Scripts/ResultPanelScript.cs
2021-12-28 18:26:56 +08:00
Caiyanpeng 3ca297ee96 按设计稿修改登录页登录样式;修改主页动画顺序;增加我的收藏列表可切换 2021-12-28 18:25:48 +08:00
lishuo 0500736fff 最近骑行继续骑数据源 2021-12-28 14:13:38 +08:00
Caiyanpeng f23fc4b4c0 Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp
# Conflicts:
#	Assets/Scenes/Login-Mobile.unity
#	Assets/Scripts/UI/Prefab/Panel/NewRouteDetailController.cs
2021-12-28 11:26:34 +08:00
lishuo 8e0ce907d0 分享调整 2021-12-28 11:25:35 +08:00
Caiyanpeng 2b390717c2 暂存 2021-12-28 11:25:09 +08:00
lishuo ffc98f1a58 骑行和赛事分享&集合正在骑行的人数 2021-12-27 18:29:23 +08:00
Caiyanpeng a2b44262f7 合计修正版本暂存 2021-12-27 09:39:07 +08:00
lishuo 2743c8d185 骑行界面优化&PCtips显示调整 2021-12-24 18:33:58 +08:00
Caiyanpeng 769b75e2e2 FB登录功能暂存;苹果有问题 2021-12-24 13:58:14 +08:00
Caiyanpeng 6423007638 Facebook sdk接入 2021-12-23 15:36:11 +08:00
Caiyanpeng 4260cf05d3 移动端浏览器 2021-12-23 09:54:14 +08:00
lishuo d91dc17ea7 单击手势进入极简模式 2021-12-22 16:20:27 +08:00
lishuo 67abc1ef63 loading页面不显示loading序列帧 2021-12-22 16:06:35 +08:00
lishuo fc55360be0 骑行视角手势&移除按钮音效 2021-12-22 14:25:57 +08:00
lishuo c8c27bd021 3d骑行视角旋转 2021-12-21 18:43:22 +08:00
Caiyanpeng 5c2c22b675 收藏问题;苹果登录无法快速登录问题 2021-12-21 17:41:17 +08:00
Caiyanpeng 4b3dad0b84 Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp
# Conflicts:
#	Assets/Scripts/Scenes/MainController.cs
2021-12-21 10:47:00 +08:00
lishuo 939084b074 解决消息处理bug 2021-12-21 10:10:05 +08:00
Caiyanpeng 05d2c74efa 苹果登录暂存 2021-12-21 09:58:07 +08:00
lishuo 348552b0bc 消息通知增加上线了 2021-12-20 14:44:48 +08:00
Caiyanpeng ebcc83ed6a Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp 2021-12-17 13:03:27 +08:00
Caiyanpeng a9e4b1fd34 安卓分享 2021-12-17 13:03:19 +08:00
lishuo 2c8457c75e 中断骑行弹窗bug修复 2021-12-17 11:24:24 +08:00
lishuo 7616e09a40 骑行loading页面bug修复&线路集合图片异步加载 2021-12-17 11:10:17 +08:00
Caiyanpeng 6c0d9f5dec Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp 2021-12-16 18:43:34 +08:00
Caiyanpeng 32777c739d 首页动画不停止bug;中文图片绑定 2021-12-16 18:43:26 +08:00
lishuo 77989384fc 音效微调 2021-12-16 18:27:50 +08:00
Caiyanpeng 12e0d8d295 Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp
# Conflicts:
#	Assets/Scripts/UI/Prefab/MapList/MapItem.cs
2021-12-16 16:55:14 +08:00
Caiyanpeng 1cb555c13d 移动端消息 2021-12-16 16:54:35 +08:00
lishuo b9d14a590c 音效&骑行loading优化 2021-12-16 16:53:38 +08:00
Caiyanpeng 24044ec772 跳上传线路网页;pc分两种消息弹窗 2021-12-16 16:00:14 +08:00
Caiyanpeng 603efc7508 三层消息通知,修改细节 2021-12-15 18:18:12 +08:00
Caiyanpeng 9231304269 Merge branch 'dev_nonearth' into dev_cyp 2021-12-15 13:32:38 +08:00
lishuo 40ac7e1397 消息通知 2021-12-15 13:24:26 +08:00
Caiyanpeng 98de46f8b1 Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp 2021-12-15 13:03:32 +08:00
Caiyanpeng 6ed3895fcd 加入合集后的跳转问题 2021-12-15 11:08:25 +08:00
Caiyanpeng ec4a28cd2a 集合首页和详情页 2021-12-14 18:10:58 +08:00
lishuo 3da24b200d Merge remote-tracking branch 'origin/dev_cyp' into dev_nonearth
# Conflicts:
#	Assets/Resources/UI/Prefab/Ride/Mobile/Panel.prefab
2021-12-14 16:24:09 +08:00
Caiyanpeng 16b42a19e4 ios端本地化 2021-12-13 17:18:57 +08:00
Caiyanpeng 625e2b7934 app名称本地化自适应;分享图片接入 2021-12-10 18:10:20 +08:00
Caiyanpeng cbd1ce3313 集合功能部分 2021-12-10 09:53:49 +08:00
lishuo 7d2af849f4 骑行视角等优化 2021-12-09 18:17:39 +08:00
lishuo b1fedd4831 骑行细节优化(视角缩放,海拔图拉伸) 2021-12-08 18:10:38 +08:00
lishuo 083b414be0 点击附近的人不隐藏面板 2021-12-07 17:43:32 +08:00
lishuo de4292d55a 骑行记录实时保存,异常中断重新连接 2021-12-07 16:44:36 +08:00
Caiyanpeng 542036fb45 Merge remote-tracking branch 'origin/dev_nonearth' into dev_cyp 2021-12-07 14:37:13 +08:00
Caiyanpeng fa144dbaa0 新页面框架(PC) 2021-12-07 14:37:08 +08:00
lishuo cc6730cbc4 汉化微调&赛事相关中文版本样式调整 2021-12-06 17:02:30 +08:00
lishuo aff636f9a8 Merge remote-tracking branch 'origin/dev_cyp' into dev_nonearth 2021-12-03 18:22:31 +08:00
Caiyanpeng ef3e3a8321 高版本反而弹更新的bug;部分手机自动更新由于程序退出导致安装包损坏问题 2021-12-03 18:21:17 +08:00
lishuo 5d8be079c2 汉化微调 2021-12-03 18:19:24 +08:00
Caiyanpeng aa0c8d4fb6 中文绑定一波 2021-11-25 17:31:26 +08:00
Caiyanpeng 134dc76ec5 Merge branch 'dev_language' into dev_release
# Conflicts:
#	Assets/Resources/UI/Prefab/Panel/Mobile/MapListPanel.prefab
#	Assets/Resources/UI/Prefab/Panel/Mobile/RaceListPanel.prefab
2021-11-25 10:04:35 +08:00
Caiyanpeng 9ff3de1d10 Merge branch 'dev_cyp' into dev_release 2021-11-25 10:03:35 +08:00
lishuo a2ff7604cc 解决海图索引超过2000头像不显示问题 2021-11-24 16:40:53 +08:00
lishuo 70a8bc0000 Merge remote-tracking branch 'origin/dev_release' into dev_release 2021-11-24 13:10:10 +08:00
lishuo 06b102f0eb 比赛海拔图位置&赛事无法开始问题 2021-11-24 13:08:42 +08:00
Caiyanpeng 350103d5a9 Merge remote-tracking branch 'origin/dev_release' into dev_release 2021-11-24 10:16:14 +08:00
Caiyanpeng 2cf77e94ed 搜索按钮变大 2021-11-24 10:16:09 +08:00
lishuo 917cbbfb90 赛事开始逻辑调整 2021-11-24 10:15:28 +08:00
Caiyanpeng eeffccd4e6 taskrun 2021-11-24 09:10:23 +08:00
lishuo 0549cdbd52 赛事提醒自动保存当前骑行 2021-11-23 16:27:35 +08:00
Caiyanpeng 732e5ac6c6 测试包;退出骑行场景释放tcp资源 2021-11-23 16:10:25 +08:00
Caiyanpeng c0ebe80a1f 网络异常处理 2021-11-23 15:58:02 +08:00
Caiyanpeng 23e5ae6ebd 中文调整 2021-11-23 15:48:22 +08:00
lishuo 265430053a 设备连接汉化调整 2021-11-23 09:58:55 +08:00
Caiyanpeng 190a66bb68 Merge branch 'dev_lishuo' into dev_cyp
# Conflicts:
#	Assets/Resources/UI/Prefab/Panel/Mobile/DevicePanel.prefab
#	Assets/Scenes/Login-Mobile.unity
#	Assets/Scenes/Login.unity
#	Assets/Scripts/App.cs
#	Assets/Scripts/Editor.meta
#	Assets/Scripts/Scenes/Ride/Scripts/CyclingController.cs
2021-11-23 09:51:10 +08:00
Caiyanpeng 8c5ad08475 比赛列表搜索逻辑统一 2021-11-23 09:47:04 +08:00
Caiyanpeng 6cc2486ebf Merge remote-tracking branch 'origin/ios_nearby' into dev_cyp 2021-11-23 09:34:20 +08:00
lishuo 68688c9daf 超时重连增加条件编译 2021-11-23 09:33:05 +08:00
lishuo d5ea26f15c ios附近的人掉线问题 2021-11-22 18:04:16 +08:00
Caiyanpeng 37e4c54c20 修改观察者模式提示连接设备bug;新版本设备连接bug;单开限定 2021-11-22 16:10:11 +08:00
Caiyanpeng 9570334e25 压缩图片bug解决 2021-11-22 09:51:17 +08:00
Caiyanpeng 3083224ee6 保存图片压缩;记录列表清缓存;ms延迟3s;比赛列表样式问题 2021-11-19 10:54:14 +08:00
Caiyanpeng 5ba176725f 单点登录不在进程内运行问题;gps取定位服务的;点击图标显示毫秒 2021-11-18 14:45:31 +08:00
Caiyanpeng 42e23e2f84 使用astc优化网络图片;workouts链接修改 2021-11-18 09:15:19 +08:00
Caiyanpeng 5480de5c6d 测试 2021-11-16 20:19:32 +08:00
Caiyanpeng e3e2f5200b Merge remote-tracking branch 'origin/dev_memory' into dev_cyp 2021-11-16 18:41:22 +08:00
Caiyanpeng 6a4390f1b9 两个列表进骑行释放内存 2021-11-16 18:41:18 +08:00
lishuo a73e125a49 骑行优化 2021-11-16 18:03:56 +08:00
Caiyanpeng 3295314b7e Merge remote-tracking branch 'origin/dev_memory' into dev_cyp 2021-11-15 15:21:46 +08:00
lishuo 8b3dd7a40a 骑行内存优化&设备连接点击优化 2021-11-15 15:21:22 +08:00
Caiyanpeng b79584f745 删除appcenter;删除打包后的debug 2021-11-15 11:38:13 +08:00
Caiyanpeng 402f19b8a5 Merge remote-tracking branch 'origin/dev_memory' into dev_cyp
# Conflicts:
#	Assets/Scenes/Login-Mobile.unity
#	Assets/Scenes/Login.unity
2021-11-15 11:34:49 +08:00
Caiyanpeng 9acde45f4a 一些设置调整;进入骑行时请texture 2021-11-15 11:33:57 +08:00
lishuo 004410048f Revert "Revert "骑行内存优化""
This reverts commit f7b29819f6.
2021-11-14 16:27:00 +08:00
lishuo f7b29819f6 Revert "骑行内存优化"
This reverts commit 7ebd5f59e3.
2021-11-14 16:25:41 +08:00
lishuo 7ebd5f59e3 骑行内存优化 2021-11-14 16:24:11 +08:00
lishuo eb9338390c 多语言微调 2021-11-11 14:20:08 +08:00
lishuo 51834b709c 中文版本 2021-11-10 18:13:38 +08:00
1713 changed files with 193938 additions and 52241 deletions

No files matched your search

+2
View File
@@ -92,3 +92,5 @@ Assets/Mapbox/User.meta
Packages/packages-lock.json
GPUCache
Assets/Shatalmic/plugin.unitypackage.meta
.idea
Assets/AVProVideo
+4 -4
View File
@@ -23,13 +23,13 @@ public class AndroidUpdate : PFUIPanel
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")}";
transform.Find("Panel/CurrentVersion").GetComponent<Text>().text = $"{App.GetLocalString("Current Version:")} {App.AppVersion}";
transform.Find("Panel/LastestVersion").GetComponent<Text>().text = $"{App.GetLocalString("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/Size").GetComponent<Text>().text = $"{App.GetLocalString("Downloaded")} {Math.Round(p * 100, 0)}%";// string.Format(, a, b);
transform.Find("Panel/Progress").GetComponent<Image>().fillAmount = (float)p;
if (isComplete)
{
@@ -124,7 +124,7 @@ public class AndroidUpdate : PFUIPanel
var activity = jc.GetStatic<AndroidJavaObject>("currentActivity");
//Debug.Log("打开apk"+ "file://" + path);
activity.Call("OpenApk", path);
Application.Quit();
//Application.Quit();
#endif
}
}
-200
View File
@@ -1,200 +0,0 @@
// 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 : MonoSingleton<AppCenterBehavior>
{
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();
}
}
}
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: b9a3a6a28c6a80a46adde9b4e01eeb93
timeCreated: 1502267991
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: 2778c316eec875d46bbd2ecbfba6db4a, type: 3}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,30 +0,0 @@
// 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
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 0d5e2b5dc171f164b8ef2a7b94198b04
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: 2778c316eec875d46bbd2ecbfba6db4a, type: 3}
userData:
assetBundleName:
assetBundleVariant:
-40
View File
@@ -1,40 +0,0 @@
%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
-92
View File
@@ -1,92 +0,0 @@
// 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();
}
}
}
@@ -1,50 +0,0 @@
// 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
}
}
}
@@ -1,108 +0,0 @@
// 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);
}
}
}
@@ -1,30 +0,0 @@
// 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();
}
}
@@ -1,36 +0,0 @@
// 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();
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 924 B

@@ -1,340 +0,0 @@
// 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
}
@@ -1,190 +0,0 @@
// 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
}
@@ -1,86 +0,0 @@
// 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);
}
}
@@ -1,13 +0,0 @@
fileFormatVersion: 2
guid: a2039654418774fd1a596ae0de6ec117
timeCreated: 1513203491
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,58 +0,0 @@
// 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);
}
}
@@ -1,20 +0,0 @@
// 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();
}
}
@@ -1,140 +0,0 @@
// 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();
}
}
@@ -1,150 +0,0 @@
// 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());
}
}
@@ -1,19 +0,0 @@
// 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);
}
}
@@ -1,12 +0,0 @@
// 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;
}
}
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: c39732e4de5a34bfbbda09c28c8e7f9f
timeCreated: 1503349438
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,39 +0,0 @@
// 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]];
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: f0e8996e972247549b62c85a8d7aa869
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,43 +0,0 @@
// 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;
}
}
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: ebeca1d941dd04282895d881deecbc6c
timeCreated: 1504725583
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,26 +0,0 @@
// 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);
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: a40c6c75c7d49cd4ab84b0d6d68a509f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,35 +0,0 @@
// 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;
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 428e5cf118c809a40b0fbc4b93d77e60
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,103 +0,0 @@
// 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 });
}
}
@@ -1,13 +0,0 @@
fileFormatVersion: 2
guid: f4e4b5327bd6d4fa1b30a0da2ba6ae46
timeCreated: 1513288156
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,46 +0,0 @@
// 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 });
}
}
@@ -1,13 +0,0 @@
fileFormatVersion: 2
guid: 1fce65b4e1d6646dda661bf55f78e3f6
timeCreated: 1513288156
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,53 +0,0 @@
// 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);
}
}
@@ -1,13 +0,0 @@
fileFormatVersion: 2
guid: 6ca2e2a428dbc432c930ec7a5b186fba
timeCreated: 1513288156
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,40 +0,0 @@
// 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();
}
}
}
@@ -1,13 +0,0 @@
fileFormatVersion: 2
guid: dc5634190b21448b6bdeac14c833304c
timeCreated: 1513106215
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,34 +0,0 @@
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:
@@ -1,43 +0,0 @@
// 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");
}
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: c7653ac593f8a4859bc75b4952e2a9dc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,49 +0,0 @@
// 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
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: ebd2662d8c212481b8ae72fe6be77873
timeCreated: 1498578955
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,38 +0,0 @@
// 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
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: dcfb87d5b5fb94c77b4d361b4791a677
timeCreated: 1498578955
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,46 +0,0 @@
// 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
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 80fb4bb7b657748d399b89f4367331e8
timeCreated: 1498496048
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,21 +0,0 @@
# 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"
}
@@ -1,23 +0,0 @@
# 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"
}
@@ -1,33 +0,0 @@
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:
@@ -1,33 +0,0 @@
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:
@@ -1,96 +0,0 @@
// 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
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: a713100f59727486c9ad45c500332234
timeCreated: 1497467718
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,44 +0,0 @@
// 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
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 514cee750a1f56f4bab5c663b3a4f557
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,70 +0,0 @@
// 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
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: e670e8c4e24f54cb3b15b96cba63313b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,82 +0,0 @@
// 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
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 9b4de3e63b6764e059567a9e87feda60
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,83 +0,0 @@
// 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
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 632c05efd92fe4ec9b424381b5392d76
timeCreated: 1497465139
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,41 +0,0 @@
// 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
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 61494a0be6a398041ad0f0aa1de5408e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,66 +0,0 @@
// 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
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 09033f50c9aa64a7bae8097136a84d14
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,75 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if (!UNITY_IOS && !UNITY_ANDROID && !UNITY_WSA_10_0) || UNITY_EDITOR
using Microsoft.AppCenter.Unity.Analytics.Internal;
using System;
using System.Collections.Generic;
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 TransmissionTargetInternal
{
public static void TrackEvent(RawType transmissionTarget, string eventName)
{
}
public static void TrackEvent(RawType transmissionTarget, string eventName, int flags)
{
}
public static void TrackEventWithProperties(RawType transmissionTarget, string eventName, IDictionary<string, string> properties)
{
}
public static void TrackEventWithProperties(RawType transmissionTarget, string eventName, EventProperties properties)
{
}
public static void TrackEventWithProperties(RawType transmissionTarget, string eventName, IDictionary<string, string> properties, int flags)
{
}
public static void TrackEventWithProperties(RawType transmissionTarget, string eventName, EventProperties properties, int flags)
{
}
public static AppCenterTask SetEnabledAsync(RawType transmissionTarget, bool enabled)
{
return AppCenterTask.FromCompleted();
}
public static AppCenterTask<bool> IsEnabledAsync(RawType transmissionTarget)
{
return AppCenterTask<bool>.FromCompleted(false);
}
public static RawType GetTransmissionTarget(RawType transmissionTargetParent, string transmissionTargetToken, out bool success)
{
success = false;
return default(RawType);
}
public static RawType GetPropertyConfigurator(RawType transmissionTargetParent)
{
return default(RawType);
}
public static void Pause(RawType transmissionTargetParent)
{
}
public static void Resume(RawType transmissionTargetParent)
{
}
}
}
#endif
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 619352a0db14645c2a7441de0d98e790
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,120 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using System.Collections.Generic;
using Microsoft.AppCenter.Unity.Analytics.Internal;
namespace Microsoft.AppCenter.Unity.Analytics
{
#if UNITY_IOS || UNITY_ANDROID
using RawType = System.IntPtr;
#else
using RawType = System.Type;
#endif
public class Analytics
{
// Used by App Center Unity Editor Extensions: https://github.com/Microsoft/AppCenter-SDK-Unity-Extension
public const string AnalyticsSDKVersion = "4.3.0";
public static void PrepareEventHandlers()
{
AnalyticsInternal.PrepareEventHandlers();
}
public static void AddNativeType(List<RawType> nativeTypes)
{
AnalyticsInternal.AddNativeType(nativeTypes);
}
public static void TrackEvent(string eventName)
{
AnalyticsInternal.TrackEvent(eventName);
}
public static void TrackEvent(string eventName, Flags flags)
{
AnalyticsInternal.TrackEvent(eventName, (int)flags);
}
public static void TrackEvent(string eventName, IDictionary<string, string> properties)
{
if (properties == null)
{
TrackEvent(eventName);
}
else
{
AnalyticsInternal.TrackEventWithProperties(eventName, properties);
}
}
public static void TrackEvent(string eventName, IDictionary<string, string> properties, Flags flags)
{
if (properties == null)
{
TrackEvent(eventName, flags);
}
else
{
AnalyticsInternal.TrackEventWithProperties(eventName, properties, (int)flags);
}
}
public static void TrackEvent(string eventName, EventProperties properties)
{
if (properties == null)
{
TrackEvent(eventName);
}
else
{
AnalyticsInternal.TrackEventWithProperties(eventName, properties);
}
}
public static void TrackEvent(string eventName, EventProperties properties, Flags flags)
{
if (properties == null)
{
TrackEvent(eventName, flags);
}
else
{
AnalyticsInternal.TrackEventWithProperties(eventName, properties, (int)flags);
}
}
public static AppCenterTask<bool> IsEnabledAsync()
{
return AnalyticsInternal.IsEnabledAsync();
}
public static AppCenterTask SetEnabledAsync(bool enabled)
{
return AnalyticsInternal.SetEnabledAsync(enabled);
}
public static TransmissionTarget GetTransmissionTarget(string transmissionTargetToken)
{
if (string.IsNullOrEmpty(transmissionTargetToken))
{
return null;
}
bool success;
var internalObject = AnalyticsInternal.GetTransmissionTarget(transmissionTargetToken, out success);
return success ? new TransmissionTarget(internalObject) : null;
}
public static void Pause()
{
AnalyticsInternal.Pause();
}
public static void Resume()
{
AnalyticsInternal.Resume();
}
}
}
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: fd0e9bac2bb4245b3b6cd71e07030c30
timeCreated: 1497463739
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,64 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
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;
#elif UNITY_WSA_10_0 && !UNITY_EDITOR
using RawType = Dictionary<string, string>;
#else
using RawType = System.Object;
#endif
public class EventProperties
{
private readonly RawType _rawObject;
internal RawType GetRawObject()
{
return _rawObject;
}
public EventProperties()
{
_rawObject = EventPropertiesInternal.Create();
}
public EventProperties Set(string key, string val)
{
EventPropertiesInternal.SetString(_rawObject, key, val);
return this;
}
public EventProperties Set(string key, DateTime val)
{
EventPropertiesInternal.SetDate(_rawObject, key, val);
return this;
}
public EventProperties Set(string key, long val)
{
EventPropertiesInternal.SetNumber(_rawObject, key, val);
return this;
}
public EventProperties Set(string key, double val)
{
EventPropertiesInternal.SetNumber(_rawObject, key, val);
return this;
}
public EventProperties Set(string key, bool val)
{
EventPropertiesInternal.SetBool(_rawObject, key, val);
return this;
}
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 004bef03efe4b5e498ec3de493d64e96
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,24 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
namespace Microsoft.AppCenter.Unity.Analytics
{
/// <summary>
/// Persistence and latency flags for telemetry.
/// </summary>
[Flags]
public enum Flags
{
/// <summary>
/// An event can be lost due to low bandwidth or disk space constraints.
/// </summary>
PersistenceNormal = 0x01,
/// <summary>
/// Used for events that should be prioritized over non-critical events.
/// </summary>
PersistenceCritical = 0x02
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 2beeb33194756f94ea1a4d58e51de1b9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,87 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using Microsoft.AppCenter.Unity.Analytics.Internal;
using System;
using System.Collections.Generic;
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 PropertyConfigurator
{
private readonly RawType _rawObject;
internal RawType GetRawObject()
{
return _rawObject;
}
public PropertyConfigurator(RawType rawObject)
{
_rawObject = rawObject;
}
public void SetAppName(string appName)
{
PropertyConfiguratorInternal.SetAppName(_rawObject, appName);
}
public void SetAppVersion(string appVersion)
{
PropertyConfiguratorInternal.SetAppVersion(_rawObject, appVersion);
}
public void SetAppLocale(string appLocale)
{
PropertyConfiguratorInternal.SetAppLocale(_rawObject, appLocale);
}
public void SetEventProperty(string key, string value)
{
PropertyConfiguratorInternal.SetEventProperty(_rawObject, key, value);
}
public void SetEventProperty(string key, DateTime value)
{
PropertyConfiguratorInternal.SetEventProperty(_rawObject, key, value);
}
public void SetEventProperty(string key, long value)
{
PropertyConfiguratorInternal.SetEventProperty(_rawObject, key, value);
}
public void SetEventProperty(string key, double value)
{
PropertyConfiguratorInternal.SetEventProperty(_rawObject, key, value);
}
public void SetEventProperty(string key, bool value)
{
PropertyConfiguratorInternal.SetEventProperty(_rawObject, key, value);
}
public void SetUserId(string userId)
{
PropertyConfiguratorInternal.SetUserId(_rawObject, userId);
}
public void RemoveEventProperty(string key)
{
PropertyConfiguratorInternal.RemoveEventProperty(_rawObject, key);
}
public void CollectDeviceId()
{
PropertyConfiguratorInternal.CollectDeviceId(_rawObject);
}
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 55fb0e0927ff24e679c9231f38c6d0ab
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,126 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using Microsoft.AppCenter.Unity.Analytics.Internal;
using System;
using System.Collections.Generic;
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 TransmissionTarget
{
private readonly RawType _rawObject;
internal RawType GetRawObject()
{
return _rawObject;
}
public TransmissionTarget(RawType rawObject)
{
_rawObject = rawObject;
}
public void TrackEvent(string eventName)
{
TransmissionTargetInternal.TrackEvent(_rawObject, eventName);
}
public void TrackEvent(string eventName, Flags flags)
{
TransmissionTargetInternal.TrackEvent(_rawObject, eventName, (int)flags);
}
public void TrackEvent(string eventName, IDictionary<string, string> properties)
{
if (properties == null)
{
TrackEvent(eventName);
}
else
{
TransmissionTargetInternal.TrackEventWithProperties(_rawObject, eventName, properties);
}
}
public void TrackEvent(string eventName, IDictionary<string, string> properties, Flags flags)
{
if (properties == null)
{
TrackEvent(eventName, flags);
}
else
{
TransmissionTargetInternal.TrackEventWithProperties(_rawObject, eventName, properties, (int)flags);
}
}
public void TrackEvent(string eventName, EventProperties properties)
{
if (properties == null)
{
TrackEvent(eventName);
}
else
{
TransmissionTargetInternal.TrackEventWithProperties(_rawObject, eventName, properties);
}
}
public void TrackEvent(string eventName, EventProperties properties, Flags flags)
{
if (properties == null)
{
TrackEvent(eventName, flags);
}
else
{
TransmissionTargetInternal.TrackEventWithProperties(_rawObject, eventName, properties, (int)flags);
}
}
public AppCenterTask<bool> IsEnabledAsync()
{
return TransmissionTargetInternal.IsEnabledAsync(_rawObject);
}
public AppCenterTask SetEnabledAsync(bool enabled)
{
return TransmissionTargetInternal.SetEnabledAsync(_rawObject, enabled);
}
public TransmissionTarget GetTransmissionTarget(string childTransmissionTargetToken)
{
if (string.IsNullOrEmpty(childTransmissionTargetToken))
{
return null;
}
bool success;
var internalObject = TransmissionTargetInternal.GetTransmissionTarget(_rawObject, childTransmissionTargetToken, out success);
return success ? new TransmissionTarget(internalObject) : null;
}
public PropertyConfigurator GetPropertyConfigurator()
{
return new PropertyConfigurator(TransmissionTargetInternal.GetPropertyConfigurator(_rawObject));
}
public void Pause()
{
TransmissionTargetInternal.Pause(_rawObject);
}
public void Resume()
{
TransmissionTargetInternal.Resume(_rawObject);
}
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 713452dbc18f44e7da0005d414778b9a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,87 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if UNITY_WSA_10_0 && !UNITY_EDITOR
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Microsoft.AppCenter.Unity.Analytics.Internal
{
using UWPAnalytics = Microsoft.AppCenter.Analytics.Analytics;
class AnalyticsInternal
{
private static bool _warningLogged = false;
public static void PrepareEventHandlers()
{
}
public static void AddNativeType(List<Type> nativeTypes)
{
nativeTypes.Add(typeof(UWPAnalytics));
}
public static void TrackEvent(string eventName)
{
UWPAnalytics.TrackEvent(eventName);
}
public static void TrackEvent(string eventName, int flags)
{
TrackEvent(eventName);
}
public static void TrackEventWithProperties(string eventName, IDictionary<string, string> properties)
{
UWPAnalytics.TrackEvent(eventName, properties);
}
public static void TrackEventWithProperties(string eventName, EventProperties properties)
{
if (!_warningLogged)
{
Debug.LogWarning("Warning: Strongly typed properties are not supported on UWP platform. " +
"All property values will be converted to strings for this and all the future calls.");
_warningLogged = true;
}
UWPAnalytics.TrackEvent(eventName, properties.GetRawObject());
}
public static void TrackEventWithProperties(string eventName, IDictionary<string, string> properties, int flags)
{
TrackEventWithProperties(eventName, properties);
}
public static void TrackEventWithProperties(string eventName, EventProperties properties, int flags)
{
TrackEventWithProperties(eventName, properties);
}
public static AppCenterTask SetEnabledAsync(bool isEnabled)
{
return new AppCenterTask(UWPAnalytics.SetEnabledAsync(isEnabled));
}
public static AppCenterTask<bool> IsEnabledAsync()
{
return new AppCenterTask<bool>(UWPAnalytics.IsEnabledAsync());
}
public static Type GetTransmissionTarget(string transmissionTargetToken, out bool success)
{
success = false;
return null;
}
public static void Pause()
{
}
public static void Resume()
{
}
}
}
#endif
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 9a6f77be941594c1389be7cfade7f372
timeCreated: 1499378836
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,46 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if UNITY_WSA_10_0 && !UNITY_EDITOR
using System;
using System.Collections.Generic;
using System.Globalization;
namespace Microsoft.AppCenter.Unity.Analytics.Internal
{
class EventPropertiesInternal
{
public static Dictionary<string, string> Create()
{
return new Dictionary<string, string>();
}
public static void SetString(Dictionary<string, string> properties, string key, string val)
{
properties[key] = val;
}
public static void SetNumber(Dictionary<string, string> properties, string key, long val)
{
properties[key] = val.ToString(CultureInfo.InvariantCulture);
}
public static void SetNumber(Dictionary<string, string> properties, string key, double val)
{
properties[key] = val.ToString(CultureInfo.InvariantCulture);
}
public static void SetBool(Dictionary<string, string> properties, string key, bool val)
{
properties[key] = val.ToString();
}
public static void SetDate(Dictionary<string, string> properties, string key, DateTime val)
{
var format = "yyyy-MM-dd'T'HH:mm:ss.fffK";
var dateString = val.ToString(format, CultureInfo.InvariantCulture);
properties[key] = dateString;
}
}
}
#endif
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: d05cde6a93c1790458dbfb4a909075e9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,58 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if UNITY_WSA_10_0 && !UNITY_EDITOR
using System;
using System.Collections.Generic;
using Microsoft.AppCenter.Unity.Analytics.Internal;
namespace Microsoft.AppCenter.Unity.Analytics
{
public class PropertyConfiguratorInternal
{
public static void SetAppName(object propertyConfigurator, string appName)
{
}
public static void SetUserId(object propertyConfigurator, string userId)
{
}
public static void SetAppVersion(object propertyConfigurator, string appVersion)
{
}
public static void SetAppLocale(object propertyConfigurator, string appLocale)
{
}
public static void SetEventProperty(object propertyConfigurator, string key, string value)
{
}
public static void SetEventProperty(object propertyConfigurator, string key, DateTime value)
{
}
public static void SetEventProperty(object propertyConfigurator, string key, long value)
{
}
public static void SetEventProperty(object propertyConfigurator, string key, double value)
{
}
public static void SetEventProperty(object propertyConfigurator, string key, bool value)
{
}
public static void RemoveEventProperty(object propertyConfigurator, string key)
{
}
public static void CollectDeviceId(object propertyConfigurator)
{
}
}
}
#endif
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 1da96695a43e9487086154cd35a3b8d0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,67 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if UNITY_WSA_10_0 && !UNITY_EDITOR
using Microsoft.AppCenter.Unity.Analytics.Internal;
using System;
using System.Collections.Generic;
namespace Microsoft.AppCenter.Unity.Analytics
{
public class TransmissionTargetInternal
{
public static void TrackEvent(object transmissionTarget, string eventName)
{
}
public static void TrackEvent(object transmissionTarget, string eventName, int flags)
{
}
public static void TrackEventWithProperties(object transmissionTarget, string eventName, IDictionary<string, string> properties)
{
}
public static void TrackEventWithProperties(object transmissionTarget, string eventName, EventProperties properties)
{
}
public static void TrackEventWithProperties(object transmissionTarget, string eventName, IDictionary<string, string> properties, int flags)
{
}
public static void TrackEventWithProperties(object transmissionTarget, string eventName, EventProperties properties, int flags)
{
}
public static AppCenterTask SetEnabledAsync(object transmissionTarget, bool enabled)
{
return AppCenterTask.FromCompleted();
}
public static AppCenterTask<bool> IsEnabledAsync(object transmissionTarget)
{
return AppCenterTask<bool>.FromCompleted(false);
}
public static TransmissionTargetInternal GetTransmissionTarget(object transmissionTargetParent, string transmissionTargetToken, out bool success)
{
success = false;
return null;
}
public static PropertyConfiguratorInternal GetPropertyConfigurator(object transmissionTargetParent)
{
return null;
}
public static void Pause(object transmissionTarget)
{
}
public static void Resume(object transmissionTarget)
{
}
}
}
#endif
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: cef60ebaae8af49db8dc3de5394263ae
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: eac6a5c11600045b39d3063cb58cd244
folderAsset: yes
timeCreated: 1498059871
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -1,114 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if UNITY_IOS && !UNITY_EDITOR
using System;
using System.Linq;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace Microsoft.AppCenter.Unity.Analytics.Internal
{
class AnalyticsInternal
{
public static void PrepareEventHandlers()
{
}
public static void AddNativeType(List<IntPtr> nativeTypes)
{
nativeTypes.Add(appcenter_unity_analytics_get_type());
}
public static void TrackEvent(string eventName)
{
appcenter_unity_analytics_track_event(eventName, (int)Flags.PersistenceNormal);
}
public static void TrackEvent(string eventName, int flags)
{
appcenter_unity_analytics_track_event(eventName, flags);
}
public static void TrackEventWithProperties(string eventName, EventProperties properties)
{
appcenter_unity_analytics_track_event_with_typed_properties(eventName, properties.GetRawObject(), (int)Flags.PersistenceNormal);
}
public static void TrackEventWithProperties(string eventName, IDictionary<string, string> properties)
{
appcenter_unity_analytics_track_event_with_properties(eventName, properties.Keys.ToArray(), properties.Values.ToArray(), properties.Count, (int)Flags.PersistenceNormal);
}
public static void TrackEventWithProperties(string eventName, EventProperties properties, int flags)
{
appcenter_unity_analytics_track_event_with_typed_properties(eventName, properties.GetRawObject(), flags);
}
public static void TrackEventWithProperties(string eventName, IDictionary<string, string> properties, int flags)
{
appcenter_unity_analytics_track_event_with_properties(eventName, properties.Keys.ToArray(), properties.Values.ToArray(), properties.Count, flags);
}
public static AppCenterTask SetEnabledAsync(bool isEnabled)
{
appcenter_unity_analytics_set_enabled(isEnabled);
return AppCenterTask.FromCompleted();
}
public static AppCenterTask<bool> IsEnabledAsync()
{
var isEnabled = appcenter_unity_analytics_is_enabled();
return AppCenterTask<bool>.FromCompleted(isEnabled);
}
public static IntPtr GetTransmissionTarget(string transmissionTargetToken, out bool success)
{
var target = appcenter_unity_analytics_transmission_target_for_token(transmissionTargetToken);
success = target != IntPtr.Zero;
return target;
}
public static void Pause()
{
appcenter_unity_analytics_pause();
}
public static void Resume()
{
appcenter_unity_analytics_resume();
}
#region External
[DllImport("__Internal")]
private static extern IntPtr appcenter_unity_analytics_get_type();
[DllImport("__Internal")]
private static extern void appcenter_unity_analytics_track_event(string eventName, int flags);
[DllImport("__Internal")]
private static extern void appcenter_unity_analytics_track_event_with_properties(string eventName, string[] keys, string[] values, int count, int flags);
[DllImport("__Internal")]
private static extern void appcenter_unity_analytics_track_event_with_typed_properties(string eventName, IntPtr properties, int flags);
[DllImport("__Internal")]
private static extern void appcenter_unity_analytics_set_enabled(bool isEnabled);
[DllImport("__Internal")]
private static extern bool appcenter_unity_analytics_is_enabled();
[DllImport("__Internal")]
private static extern IntPtr appcenter_unity_analytics_transmission_target_for_token(string transmissionTargetToken);
[DllImport("__Internal")]
private static extern void appcenter_unity_analytics_pause();
[DllImport("__Internal")]
private static extern void appcenter_unity_analytics_resume();
#endregion
}
}
#endif
@@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: cc68bbbb6d6464cec8e7a070fc38b921
timeCreated: 1497463657
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,65 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if UNITY_IOS && !UNITY_EDITOR
using System;
using System.Runtime.InteropServices;
using Microsoft.AppCenter.Unity.Internal.Utility;
namespace Microsoft.AppCenter.Unity.Analytics.Internal
{
class EventPropertiesInternal
{
public static IntPtr Create()
{
return appcenter_unity_analytics_create_event_properties();
}
public static void SetString(IntPtr properties, string key, string val)
{
appcenter_unity_analytics_event_properties_set_string(properties, key, val);
}
public static void SetNumber(IntPtr properties, string key, long val)
{
appcenter_unity_analytics_event_properties_set_long(properties, key, val);
}
public static void SetNumber(IntPtr properties, string key, double val)
{
appcenter_unity_analytics_event_properties_set_double(properties, key, val);
}
public static void SetBool(IntPtr properties, string key, bool val)
{
appcenter_unity_analytics_event_properties_set_bool(properties, key, val);
}
public static void SetDate(IntPtr properties, string key, DateTime val)
{
appcenter_unity_analytics_event_properties_set_date(properties, key, NSDateHelper.DateTimeConvert(val));
}
#region External
[DllImport("__Internal")]
private static extern IntPtr appcenter_unity_analytics_create_event_properties();
[DllImport("__Internal")]
private static extern void appcenter_unity_analytics_event_properties_set_string(IntPtr properties, string key, string val);
[DllImport("__Internal")]
private static extern void appcenter_unity_analytics_event_properties_set_long(IntPtr properties, string key, long val);
[DllImport("__Internal")]
private static extern void appcenter_unity_analytics_event_properties_set_double(IntPtr properties, string key, double val);
[DllImport("__Internal")]
private static extern void appcenter_unity_analytics_event_properties_set_bool(IntPtr properties, string key, bool val);
[DllImport("__Internal")]
private static extern void appcenter_unity_analytics_event_properties_set_date(IntPtr properties, string key, IntPtr val);
#endregion
}
}
#endif
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: ebf8af998d139794cb3ce191795c70ac
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,109 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if UNITY_IOS && !UNITY_EDITOR
using AOT;
using System;
using System.Linq;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Microsoft.AppCenter.Unity.Internal.Utility;
namespace Microsoft.AppCenter.Unity.Analytics.Internal
{
public class PropertyConfiguratorInternal
{
public static void SetAppName(IntPtr propertyConfigurator, string appName)
{
appcenter_unity_property_configurator_set_app_name(propertyConfigurator, appName);
}
public static void SetUserId(IntPtr propertyConfigurator, string userId)
{
appcenter_unity_property_configurator_set_user_id(propertyConfigurator, userId);
}
public static void SetAppVersion(IntPtr propertyConfigurator, string appVersion)
{
appcenter_unity_property_configurator_set_app_version(propertyConfigurator, appVersion);
}
public static void SetAppLocale(IntPtr propertyConfigurator, string appLocale)
{
appcenter_unity_property_configurator_set_app_locale(propertyConfigurator, appLocale);
}
public static void SetEventProperty(IntPtr propertyConfigurator, string key, string value)
{
appcenter_unity_property_configurator_set_event_property(propertyConfigurator, key, value);
}
public static void SetEventProperty(IntPtr propertyConfigurator, string key, DateTime value)
{
appcenter_unity_property_configurator_set_event_datetime_property(propertyConfigurator, key, NSDateHelper.DateTimeConvert(value));
}
public static void SetEventProperty(IntPtr propertyConfigurator, string key, long value)
{
appcenter_unity_property_configurator_set_event_long_property(propertyConfigurator, key, value);
}
public static void SetEventProperty(IntPtr propertyConfigurator, string key, double value)
{
appcenter_unity_property_configurator_set_event_double_property(propertyConfigurator, key, value);
}
public static void SetEventProperty(IntPtr propertyConfigurator, string key, bool value)
{
appcenter_unity_property_configurator_set_event_bool_property(propertyConfigurator, key, value);
}
public static void CollectDeviceId(IntPtr propertyConfigurator)
{
appcenter_unity_property_configurator_collect_device_id(propertyConfigurator);
}
public static void RemoveEventProperty(IntPtr propertyConfigurator, string key)
{
appcenter_unity_property_configurator_remove_event_property(propertyConfigurator, key);
}
#region External
[DllImport("__Internal")]
private static extern void appcenter_unity_property_configurator_set_app_name(IntPtr propertyConfigurator, string appName);
[DllImport("__Internal")]
private static extern void appcenter_unity_property_configurator_set_user_id(IntPtr propertyConfigurator, string userId);
[DllImport("__Internal")]
private static extern void appcenter_unity_property_configurator_set_app_version(IntPtr propertyConfigurator, string appVersion);
[DllImport("__Internal")]
private static extern void appcenter_unity_property_configurator_set_app_locale(IntPtr propertyConfigurator, string appLocale);
[DllImport("__Internal")]
private static extern void appcenter_unity_property_configurator_set_event_property(IntPtr propertyConfigurator, string key, string value);
[DllImport("__Internal")]
private static extern void appcenter_unity_property_configurator_set_event_datetime_property(IntPtr propertyConfigurator, string key, IntPtr value);
[DllImport("__Internal")]
private static extern void appcenter_unity_property_configurator_set_event_long_property(IntPtr propertyConfigurator, string key, long value);
[DllImport("__Internal")]
private static extern void appcenter_unity_property_configurator_set_event_double_property(IntPtr propertyConfigurator, string key, double value);
[DllImport("__Internal")]
private static extern void appcenter_unity_property_configurator_set_event_bool_property(IntPtr propertyConfigurator, string key, bool value);
[DllImport("__Internal")]
private static extern void appcenter_unity_property_configurator_collect_device_id(IntPtr propertyConfigurator);
[DllImport("__Internal")]
private static extern void appcenter_unity_property_configurator_remove_event_property(IntPtr propertyConfigurator, string key);
#endregion
}
}
#endif
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 118ac3c5fef534a808089752a140c8a4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,110 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#if UNITY_IOS && !UNITY_EDITOR
using AOT;
using System;
using System.Linq;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace Microsoft.AppCenter.Unity.Analytics.Internal
{
public class TransmissionTargetInternal
{
public static void TrackEvent(IntPtr transmissionTarget, string eventName)
{
appcenter_unity_transmission_target_track_event(transmissionTarget, eventName, (int)Flags.PersistenceNormal);
}
public static void TrackEvent(IntPtr transmissionTarget, string eventName, int flags)
{
appcenter_unity_transmission_target_track_event(transmissionTarget, eventName, flags);
}
public static void TrackEventWithProperties(IntPtr transmissionTarget, string eventName, IDictionary<string, string> properties)
{
appcenter_unity_transmission_target_track_event_with_props(transmissionTarget, eventName, properties.Keys.ToArray(), properties.Values.ToArray(), properties.Count, (int)Flags.PersistenceNormal);
}
public static void TrackEventWithProperties(IntPtr transmissionTarget, string eventName, EventProperties properties)
{
appcenter_unity_transmission_target_track_event_with_typed_props(transmissionTarget, eventName, properties.GetRawObject(), (int)Flags.PersistenceNormal);
}
public static void TrackEventWithProperties(IntPtr transmissionTarget, string eventName, IDictionary<string, string> properties, int flags)
{
appcenter_unity_transmission_target_track_event_with_props(transmissionTarget, eventName, properties.Keys.ToArray(), properties.Values.ToArray(), properties.Count, flags);
}
public static void TrackEventWithProperties(IntPtr transmissionTarget, string eventName, EventProperties properties, int flags)
{
appcenter_unity_transmission_target_track_event_with_typed_props(transmissionTarget, eventName, properties.GetRawObject(), flags);
}
public static AppCenterTask SetEnabledAsync(IntPtr transmissionTarget, bool enabled)
{
appcenter_unity_transmission_target_set_enabled(transmissionTarget, enabled);
return AppCenterTask.FromCompleted();
}
public static AppCenterTask<bool> IsEnabledAsync(IntPtr transmissionTarget)
{
bool isEnabled = appcenter_unity_transmission_target_is_enabled(transmissionTarget);
return AppCenterTask<bool>.FromCompleted(isEnabled);
}
public static IntPtr GetTransmissionTarget(IntPtr transmissionTargetParent, string transmissionTargetToken, out bool success)
{
var target = appcenter_unity_transmission_transmission_target_for_token(transmissionTargetParent, transmissionTargetToken);
success = target != IntPtr.Zero;
return target;
}
public static IntPtr GetPropertyConfigurator(IntPtr transmissionTarget)
{
return appcenter_unity_transmission_get_property_configurator(transmissionTarget);
}
public static void Pause(IntPtr transmissionTarget)
{
appcenter_unity_transmission_pause(transmissionTarget);
}
public static void Resume(IntPtr transmissionTarget)
{
appcenter_unity_transmission_resume(transmissionTarget);
}
#region External
[DllImport("__Internal")]
private static extern void appcenter_unity_transmission_target_track_event(IntPtr transmissionTarget, string eventName, int flags);
[DllImport("__Internal")]
private static extern void appcenter_unity_transmission_target_track_event_with_props(IntPtr transmissionTarget, string eventName, string[] keys, string[] values, int count, int flags);
[DllImport("__Internal")]
private static extern void appcenter_unity_transmission_target_track_event_with_typed_props(IntPtr transmissionTarget, string eventName, IntPtr properties, int flags);
[DllImport("__Internal")]
private static extern void appcenter_unity_transmission_target_set_enabled(IntPtr transmissionTarget, bool enabled);
[DllImport("__Internal")]
private static extern bool appcenter_unity_transmission_target_is_enabled(IntPtr transmissionTarget);
[DllImport("__Internal")]
private static extern IntPtr appcenter_unity_transmission_transmission_target_for_token(IntPtr transmissionTargetParent, string transmissionTargetToken);
[DllImport("__Internal")]
private static extern IntPtr appcenter_unity_transmission_get_property_configurator(IntPtr transmissionTarget);
[DllImport("__Internal")]
private static extern void appcenter_unity_transmission_pause(IntPtr transmissionTarget);
[DllImport("__Internal")]
private static extern void appcenter_unity_transmission_resume(IntPtr transmissionTarget);
#endregion
}
}
#endif
Loaded 100 of 1713 files, more files were not shown because too many files have changed in this diff. Show more