Compare commits

...
225 Commits
Author SHA1 Message Date
Caiyanpeng 55d7304de1 pc打包错误 2021-10-09 15:05:41 +08:00
Caiyanpeng f1ddde8a2e Merge branch 'dev_mobile' into dev_gesture 2021-10-09 10:45:56 +08:00
Caiyanpeng cad2e92fd2 编辑页面手势应用 2021-10-09 10:42:27 +08:00
Caiyanpeng 4aa6178495 赛事卡片bug修正 2021-10-08 17:04:55 +08:00
Caiyanpeng fd8f419f09 手势插件引入暂存 2021-10-08 16:03:55 +08:00
Caiyanpeng 6d1bc8e2c8 暂存 2021-10-08 15:22:20 +08:00
Caiyanpeng d035361718 ios端时间格式错误问题 2021-09-30 17:09:52 +08:00
Caiyanpeng 6501284bbc 地球收藏问题,ios 蓝牙有返回值处理,划船机倒计时1时重置 2021-09-30 15:23:40 +08:00
Caiyanpeng 9511e30e50 蓝牙问题 2021-09-30 09:06:35 +08:00
Caiyanpeng 561ad993b8 调整动画和chart图标细节,重置命令 2021-09-29 14:37:43 +08:00
Caiyanpeng 8d8fd59a80 修改细节 2021-09-28 20:35:16 +08:00
Caiyanpeng b74c3b57b4 倒计时;三按钮弹窗 2021-09-28 17:51:58 +08:00
Caiyanpeng 85e0a13f08 增加选择页,修改记录列表pc兼容 2021-09-28 15:25:52 +08:00
Caiyanpeng 8802676b98 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile 2021-09-28 11:31:11 +08:00
lishuo 486b385c84 列表搜索调整 2021-09-28 11:30:51 +08:00
Caiyanpeng 5bd1c3b1ca Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile
# Conflicts:
#	Assets/Scripts/Scenes/MainController.cs
2021-09-28 11:30:08 +08:00
Caiyanpeng c73545d912 划船机暂存 2021-09-28 11:27:24 +08:00
lishuo 75900ccf3d 修复海拔图头像切换以及移动错位问题 2021-09-27 18:43:41 +08:00
lishuo 65e7d9c4f4 优化赛事人数多卡的问题&解决蓝牙连接133错误码 2021-09-24 19:16:40 +08:00
Caiyanpeng 1c73701e73 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile 2021-09-17 22:20:47 +08:00
lishuo 125e9a48c6 赛事排名微调 2021-09-17 22:20:05 +08:00
Caiyanpeng 9eab7c847b 苹果横屏翻转 2021-09-17 20:21:45 +08:00
Caiyanpeng f35dea5c6a Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile 2021-09-17 18:51:33 +08:00
Caiyanpeng 18b330fa30 两个平台屏幕可转 2021-09-17 18:50:50 +08:00
lishuo 211967dda2 骑行字体微调 2021-09-17 18:37:58 +08:00
lishuo edf0313155 微调 2021-09-17 18:31:00 +08:00
lishuo 62e88668e0 修复影子选手隐藏后仍然可以点击问题 2021-09-17 14:18:50 +08:00
lishuo b89322c59b 合并ant速度计修改和界面微调 2021-09-17 11:37:42 +08:00
lishuo a67602b00b Merge remote-tracking branch 'origin/fit_speed_device' into dev_mobile_ble
# Conflicts:
#	Assets/Scripts/Devices/Ble/Devices/SpeedCadence.cs
2021-09-17 09:42:27 +08:00
Caiyanpeng 65f2b0af0a 判断int型异常 2021-09-17 09:35:15 +08:00
Caiyanpeng 40b6205abc Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile 2021-09-16 20:35:25 +08:00
lishuo 9b0c86aefb watch按钮只读样式 2021-09-16 20:35:12 +08:00
lishuo e6e519d166 赛事提醒样式微调 2021-09-16 20:12:13 +08:00
Caiyanpeng 750d9107b4 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile 2021-09-16 19:50:38 +08:00
Caiyanpeng 26250f3e47 iphone7以下光圈去掉 2021-09-16 19:49:45 +08:00
lishuo a999bf1b72 解决大地图移动后选中线路不显示卡片 2021-09-16 19:48:56 +08:00
Caiyanpeng 806116af19 修改样式 2021-09-16 17:09:40 +08:00
lishuo 58fe43d59f Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble 2021-09-16 16:25:26 +08:00
lishuo 27881fbb6b 切换app调整 2021-09-16 16:24:54 +08:00
lishuo 8fde11f985 赛事结果页面和赛事怕排行界面微调 2021-09-16 16:21:52 +08:00
lishuo bd8089d0a9 微调 2021-09-16 15:59:08 +08:00
Caiyanpeng 1b7e585027 修改包名 2021-09-16 15:36:36 +08:00
lishuo d7486c920c Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble 2021-09-15 21:16:30 +08:00
Caiyanpeng 8c7a9afaa3 取消开始应用请求权限;淡入淡出ios 2021-09-15 21:11:21 +08:00
Caiyanpeng 49c264ff36 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile 2021-09-15 20:06:35 +08:00
lishuo 6640780c93 Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble 2021-09-15 19:56:38 +08:00
lishuo b5c78aba4f 解决地球不能点击滑动&蓝牙踏频增加初始轮径&骑行灵敏度设置增宽 2021-09-15 19:55:50 +08:00
Caiyanpeng 7d4617eca6 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile 2021-09-15 19:30:47 +08:00
Caiyanpeng 48397f3d1d 修改细节,安卓一进应用请求权限 2021-09-15 19:30:41 +08:00
lishuo ad26419654 设备连接微调 2021-09-15 14:17:11 +08:00
Caiyanpeng 15015f83a8 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile
# Conflicts:
#	Assets/Scripts/App.cs
2021-09-15 10:45:53 +08:00
Caiyanpeng 6fa4504e46 替换图片,push问题,ios配置,常亮 2021-09-15 10:45:11 +08:00
lishuo afb8c358f5 解决场景变慢的原因 2021-09-15 09:26:41 +08:00
lishuo 0b1247249d Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble 2021-09-14 11:18:35 +08:00
lishuo 7bd058004d 骑行和设备连接图标&发送tcp带上客户端版本号 2021-09-14 11:18:04 +08:00
Caiyanpeng e84f14250b 比赛卡片效果修改;useragent修改;微信错误提示 2021-09-14 11:14:51 +08:00
lishuo ae6769e24f 合并微调 2021-09-13 18:30:38 +08:00
lishuo 939d6f1d0c Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble
# Conflicts:
#	Assets/Scenes/Login-Mobile.unity
2021-09-13 18:28:05 +08:00
lishuo dfb80658dd 登录增加loading&赛事提醒修改 2021-09-13 18:21:43 +08:00
Caiyanpeng 969835e4d7 微信登录接入;卡片点击效果 2021-09-13 17:33:58 +08:00
lishuo 51cea743be 骑行界面图标微调 2021-09-09 16:41:36 +08:00
lishuo ca51e06d37 Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble 2021-09-09 16:32:17 +08:00
lishuo ee1114e2cf 解决累计爬升不准问题&本地文件记录样式 2021-09-09 16:29:22 +08:00
Caiyanpeng f1f982b90c iosbug;android不需要导出项目;修改样式;可修改头像 2021-09-09 15:44:28 +08:00
Caiyanpeng 50ad74bb09 赛事角标刷新;处理弹窗层次问题 2021-09-08 17:53:43 +08:00
Caiyanpeng 5a148c28a8 赛事筛选;微信角标切口;选择图片功能权限问题
选择图片功能权限问题,需先导出项目,将res/xml文件夹复制到unitylibrary的res文件夹下
2021-09-08 10:29:20 +08:00
lishuo 8a4657c11c Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble 2021-09-07 16:13:12 +08:00
Caiyanpeng b86cb01ea2 修改样式,增加图片 2021-09-07 16:12:16 +08:00
lishuo 99081519bb 骑行界面&赛事界面调整&设备断开功能 2021-09-07 16:11:15 +08:00
Caiyanpeng fe65b83c89 ios选择图片功能,结果列表扩大 2021-09-07 15:26:43 +08:00
Caiyanpeng 510cd11049 意见反馈增加图片 2021-09-07 11:14:42 +08:00
Caiyanpeng b11c5de681 修改样式 2021-09-06 17:50:01 +08:00
lishuo 467a6f3810 Merge remote-tracking branch 'origin/dev_m1' into dev_mobile_ble
# Conflicts:
#	Assets/Scripts/App.cs
2021-09-03 15:12:01 +08:00
Caiyanpeng 169b9719f6 图片改名 2021-09-03 15:10:18 +08:00
Caiyanpeng 1254414415 修改细节 2021-09-03 15:03:54 +08:00
lishuo 7af935118e 赛事界面&骑行界面调整 2021-09-03 13:06:26 +08:00
lishuo 3fb8aee922 骑行界面细节调整 2021-09-02 11:04:50 +08:00
lishuo c280408192 Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble
# Conflicts:
#	Assets/Scripts/App.cs
#	Assets/Scripts/Mobile/WeChatController.cs
2021-09-02 10:10:06 +08:00
lishuo c5586b3eb1 单人骑行界面 2021-09-02 10:08:46 +08:00
Caiyanpeng 2663068574 地球页面;反馈页面样式修改 2021-09-01 16:14:45 +08:00
Caiyanpeng 3ec6fd0569 比赛;编辑页面 2021-08-31 17:11:43 +08:00
lishuo cdccd78602 设备连接界面完善 2021-08-31 16:27:36 +08:00
lishuo 3a360d3437 附近的人逻辑优化&Android进入骑行提示开启定位服务问题修复 2021-08-31 14:24:08 +08:00
suntao 29aef943b9 适配速度计和踏频计 2021-08-31 09:09:49 +08:00
lishuo 99540eb1fd ios蓝牙适配 2021-08-30 18:28:26 +08:00
Caiyanpeng 85130ce6c3 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile
# Conflicts:
#	Assets/Scripts/Scenes/MainController.cs
2021-08-27 10:13:17 +08:00
Caiyanpeng 428a7c5507 暫存 2021-08-27 10:12:50 +08:00
lishuo d8927ceca5 蓝牙停止扫描和一些bug修复 2021-08-26 19:33:43 +08:00
Caiyanpeng f21b83697b 暂存 2021-08-26 15:49:06 +08:00
Caiyanpeng 723c881790 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile 2021-08-26 09:29:42 +08:00
Caiyanpeng e1a85eeb5e 结果列表页,用户页 2021-08-26 09:29:35 +08:00
lishuo 0139cbc173 Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble 2021-08-25 16:09:18 +08:00
lishuo eb87fe07aa 设备连接页面调整 2021-08-25 16:07:26 +08:00
Caiyanpeng 89e3a04fe9 暂存 2021-08-25 15:35:41 +08:00
lishuo 92c8f246b8 Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble 2021-08-25 11:22:23 +08:00
lishuo bb08b6b762 tcp库更新&附近人下拉调整 2021-08-25 11:20:59 +08:00
Caiyanpeng 88beff5b89 条件编译报错问题 2021-08-25 10:31:20 +08:00
Caiyanpeng f155b2b627 Merge remote-tracking branch 'origin/dev_mobile_ble' into dev_mobile
# Conflicts:
#	Assets/Plugins/Android/AndroidManifest.xml
#	Assets/Plugins/Android/AndroidManifest.xml.meta
#	Assets/Plugins/iOS.meta
#	Assets/Scripts/App.cs
#	Assets/Scripts/Devices/MainDeviceAdapter.cs
#	Assets/Scripts/Scenes/LoginController.cs
#	Assets/Scripts/Scenes/Ride/Scripts/PlayerController.cs
2021-08-25 10:23:51 +08:00
Caiyanpeng 341195d78d 暂存 2021-08-25 10:20:33 +08:00
lishuo 3de8b1d555 移动端蓝牙设备正常骑行 2021-08-24 18:34:41 +08:00
Caiyanpeng 3c9d489c76 增加移动端界面暂存 2021-08-24 17:50:14 +08:00
Caiyanpeng 31e8e3bebb 移动端微信接入 2021-08-24 09:28:46 +08:00
lishuo d6c3ea2007 插件文件上传 2021-08-20 19:01:24 +08:00
lishuo 6fab61f97d 移动端蓝牙框架初步导入 2021-08-20 18:45:16 +08:00
lishuo f6740d31bb Merge branch 'dev_lishuo' into dev_mobile 2021-08-19 18:11:12 +08:00
lishuo 81a18de9f4 蓝牙抽象成接口 2021-08-19 18:03:25 +08:00
Caiyanpeng ca91f45ef3 切换移动端暂存 2021-08-19 16:28:57 +08:00
Caiyanpeng f14a071179 修改字 2021-08-19 16:24:54 +08:00
lishuo 688c12b28e Merge branch 'dev_lishuo' of https://gitlab.com/rhino4biz/powerfun/powerfun-unity into dev_lishuo 2021-08-19 14:10:11 +08:00
lishuo f39500c560 附近的人删除逻辑 2021-08-19 14:09:42 +08:00
Caiyanpeng 34a2c0bbb2 稍微逻辑修改 2021-08-19 13:23:22 +08:00
lishuo dd669d74f5 线路列表排序增加near下拉项 2021-08-19 11:24:57 +08:00
lishuo a6f673f805 设备连接速度踏频计title和logo显示问题 2021-08-18 10:46:00 +08:00
lishuo 49da1493d5 nearby重合问题&线路排序修改&显示赛事编号 2021-08-17 18:43:41 +08:00
Caiyanpeng 35b5ab59d3 切换移动端暂存 2021-08-13 17:19:02 +08:00
lishuo 11e9acdb14 修复单人骑行ridingtime差一秒 2021-08-12 18:57:30 +08:00
Caiyanpeng 906dc7dec8 闪动问题 2021-08-12 16:29:00 +08:00
Caiyanpeng 3902865658 Merge remote-tracking branch 'origin/dev_lishuo' into dev_cyp 2021-08-12 13:24:38 +08:00
lishuo 32b6e28736 修复右边排名问题 2021-08-12 13:24:00 +08:00
Caiyanpeng 25dcf0fde3 序列帧缺失问题 2021-08-12 11:22:37 +08:00
lishuo c91bf7ae2f Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-08-12 10:04:28 +08:00
lishuo a9530096e4 tcp逻辑微调 2021-08-12 10:04:01 +08:00
Caiyanpeng bb8a0712b7 处理空广告页情况 2021-08-12 10:03:29 +08:00
lishuo 570bd1554f 微调 2021-08-11 16:56:17 +08:00
lishuo 3fcc6c0489 人物动画调整&网页url移除#号&riding time 差一秒的问题 2021-08-11 10:30:23 +08:00
lishuo c717b93169 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-08-10 16:36:33 +08:00
lishuo 5642d3f1c9 赛事微调&mapbox sqlite dll 更新 2021-08-10 16:36:13 +08:00
Caiyanpeng 81a7af517a 修改台湾旗帜 2021-08-10 09:41:14 +08:00
Caiyanpeng 40bb16a132 修改all race跳到顶上的bug 2021-08-09 17:11:14 +08:00
Caiyanpeng 7a1042d184 修改细节 2021-08-09 16:32:47 +08:00
lishuo 9f19e951cc Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-30 20:45:51 +08:00
Caiyanpeng 317f7c6d8c cookie bug 2021-07-30 20:44:45 +08:00
lishuo 8b5070214e Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-30 20:40:30 +08:00
Caiyanpeng fe2c0280dc cookiebug修改 2021-07-30 20:39:23 +08:00
lishuo b8a5982bc5 微调 2021-07-30 19:39:01 +08:00
lishuo da4fed58b0 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-30 18:08:49 +08:00
lishuo ea70e04ec0 提高骑行时间精准度和一些细节调整 2021-07-30 18:08:31 +08:00
Caiyanpeng be677e766d 切換背景圖 2021-07-30 17:42:41 +08:00
lishuo 07a7a95aa8 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-30 15:39:59 +08:00
lishuo 074200cb4f 倒计时的算法及界面调整 2021-07-30 15:38:40 +08:00
Caiyanpeng b4e97d5514 Race按钮恢复原样,增加是否创建比赛 2021-07-30 15:38:14 +08:00
lishuo bea0e40ec1 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-30 09:54:06 +08:00
lishuo 12838266ba 骑行结束时间误差问题解决 2021-07-30 09:53:49 +08:00
Caiyanpeng 44c1b771f7 status=0情况 2021-07-29 21:15:26 +08:00
Caiyanpeng 3c6edc624b 修改結束狀態按钮 2021-07-29 20:58:48 +08:00
lishuo 1919370a23 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-29 20:01:52 +08:00
lishuo 9ab8165630 消息通知bug&赛事界面调整 2021-07-29 20:01:38 +08:00
Caiyanpeng 7884e7ac7e 修改细节 2021-07-29 19:55:29 +08:00
lishuo 50fd9c3af6 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-29 16:13:39 +08:00
lishuo 33df128750 修复小人移动动画显示异常和一些界面调整 2021-07-29 16:13:23 +08:00
Caiyanpeng edce9c676d 修改细节 2021-07-29 15:45:44 +08:00
Caiyanpeng 6ab3ee19f2 修改细节 2021-07-29 13:55:33 +08:00
lishuo b9db3325a8 微调 2021-07-29 09:26:19 +08:00
lishuo b8ffdcbffe Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-28 21:12:06 +08:00
lishuo 09f72d10bd 英文文案调整 2021-07-28 21:11:46 +08:00
Caiyanpeng 5c96b10385 下载速度,修改文案 2021-07-28 21:09:48 +08:00
lishuo 7d0a4fbd97 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-28 18:56:37 +08:00
lishuo c96cdbb163 英文文案调整 2021-07-28 18:56:23 +08:00
Caiyanpeng abf913b467 修改细节 2021-07-28 18:41:40 +08:00
lishuo 978debcd23 修复比赛结束时观察者模式看不到结果&观察者不用连接设备 2021-07-28 16:30:07 +08:00
lishuo 4a8239a2db Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo
# Conflicts:
#	Assets/Scripts/Apis/Models/MapCompetition.cs
2021-07-28 15:01:40 +08:00
Caiyanpeng 952e5038ed 修改细节 2021-07-28 14:59:21 +08:00
lishuo 3307d96ff3 修复重现时间没有转换成本地时间的bug 2021-07-28 14:57:11 +08:00
lishuo ea717ccdb8 海拔图小头像&比赛状态实时刷新 2021-07-28 14:00:03 +08:00
lishuo e29f0a8116 比赛进行中前后面板微调,修复比赛一直处于开始状态的bug 2021-07-27 20:35:23 +08:00
lishuo cfcb302a31 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-27 19:34:44 +08:00
lishuo 0eb399be9a 赛事loading页面状态实时变化和一些微调 2021-07-27 19:34:33 +08:00
Caiyanpeng ca938ab6f5 修改细节 2021-07-27 18:36:49 +08:00
lishuo ea79b6cfc5 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-27 13:29:55 +08:00
lishuo c9b5520331 赛事loading页面按钮可用性调整 2021-07-27 13:29:41 +08:00
Caiyanpeng 164db7c013 修改卡片样式 2021-07-27 13:28:00 +08:00
lishuo d4ae01cd32 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-27 09:18:49 +08:00
lishuo 17f2b1cedd 赛事消息通知面板和界面微调 2021-07-27 09:18:34 +08:00
Caiyanpeng ab9b6a86f3 样式调整 2021-07-26 19:50:10 +08:00
lishuo 7d0128d912 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo
# Conflicts:
#	Assets/Scripts/UI/Prefab/Race/RaceButtonGroupScript.cs
2021-07-26 14:11:10 +08:00
lishuo 1f3485846f 细节调整 2021-07-26 14:09:21 +08:00
Caiyanpeng 929fb0a1a7 修改细节 2021-07-26 14:08:43 +08:00
lishuo ac59808915 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo
# Conflicts:
#	Assets/Scripts/Apis/Models/MapCompetition.cs
#	Assets/Scripts/UI/Prefab/Race/RaceButtonGroupScript.cs
2021-07-23 18:11:58 +08:00
lishuo 7f8ac10d47 合并后微调,增加赛事提醒功能 2021-07-23 18:07:12 +08:00
Caiyanpeng b93fbd2f2e 加链接,文件位置 2021-07-23 17:59:38 +08:00
Caiyanpeng ae3f9d2101 一些细节修改 2021-07-23 15:04:46 +08:00
lishuo 21529db9dc Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo 2021-07-23 10:18:23 +08:00
Caiyanpeng 1c2afb4125 增加一些图片,enter数据源 2021-07-23 10:02:09 +08:00
lishuo d18ff09002 Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo
# Conflicts:
#	Assets/Scripts/Apis/Models/MapCompetition.cs
2021-07-23 09:43:46 +08:00
Caiyanpeng d9d66ab96c 赛事首页和列表 2021-07-23 09:41:20 +08:00
lishuo e76b5c443f 赛事功能完善
创建比赛按钮;loading页面more按钮等
2021-07-23 09:04:56 +08:00
lishuo eed2d13624 loading页&结果页面&代码结构微调 2021-07-16 18:37:02 +08:00
lishuo eb1803c9ef 赛事逻辑细节调整 2021-07-09 18:16:50 +08:00
lishuo b2a527f518 观察者TCP通信对接,实时列表优化,观察者模式界面显示逻辑 2021-07-06 18:24:15 +08:00
lishuo d6a7cd798f tcp逻辑调整,历史逻辑增加赛事相关派生类 2021-07-01 18:41:35 +08:00
lishuo ec45246aa4 骑行代码迁移,赛事逻辑初步框架完成 2021-06-29 18:03:20 +08:00
lishuo 380e67cc1e 完成比赛相关接口&历史代码整合 2021-06-24 18:19:28 +08:00
lishuo 58ec860669 结果页面日期格式修正 2021-06-22 17:46:07 +08:00
suntao 858b76d4d2 解决utc时间问题 2021-06-22 13:50:08 +08:00
lishuo 2f8318b24e Revert "修复其骑行记录详情URL错误"
This reverts commit 23d049d176.
2021-06-22 10:04:08 +08:00
lishuo 23d049d176 修复其骑行记录详情URL错误 2021-06-22 09:56:28 +08:00
lishuo 6ad01c50df 路书上在线的人过滤掉比赛中的用户,获取服务器UTC时间转换成当地时间 2021-06-18 18:26:25 +08:00
lishuo dcc65cdd86 骑行记录详细页面跳转附加token 2021-06-16 18:12:58 +08:00
lishuo 3f718f1490 地球列表下拉动作修改 2021-06-11 10:57:04 +08:00
suntao ebe3dc11e6 解决设备页标题显示错误的问题 2021-06-10 19:11:14 +08:00
lishuo 8dfd4d696c 骑行页面增加错误诊断,解决视角切换箭头位置回到起点问题 2021-06-10 18:14:14 +08:00
suntao 734893ff83 支持蓝牙可用状态变更。搜索不到设备自动停止当前线程。 2021-06-10 17:46:43 +08:00
suntao dd474f1f61 Merge remote-tracking branch 'origin/dev_lishuo' into dev 2021-06-09 19:56:26 +08:00
lishuo 936d325cf9 解决法语修改个人体重小数点不报错以及首页卡路里为0 2021-06-09 19:44:06 +08:00
suntao 5f7cc43593 解决蓝牙设备丢失以后状态不变的问题 2021-06-09 18:16:35 +08:00
lishuo 15e440715d 年月日改成日月年 2021-06-09 17:29:38 +08:00
lishuo abd35810bc 附近的人区域处理,骑行结果页面标题大小写问题 2021-06-09 17:17:11 +08:00
lishuo 5ec6f4caca Merge remote-tracking branch 'origin/dev' into dev_lishuo 2021-06-09 15:22:52 +08:00
suntao 25c866d090 修改连接设备界面;修改大地图在panel上缩放大地图也缩放的问题 2021-06-09 11:27:11 +08:00
lishuo 4064d4294a 解决切换视角地图高度变化的问题 2021-06-08 17:39:51 +08:00
lishuo 541aefe4dd 蓝牙监听调整 2021-06-08 16:28:00 +08:00
suntao 1020632757 Merge remote-tracking branch 'origin/dev_lishuo' into dev 2021-06-08 13:07:48 +08:00
lishuo 35b50efded 用户信息与路书列表地图背景区域化处理 2021-06-08 11:32:06 +08:00
suntao aa75bb281f 解决蓝牙卡顿问题 2021-06-08 10:30:26 +08:00
lishuo b6d70e6856 解决金额区域差异问题 2021-06-07 17:05:49 +08:00
Caiyanpeng 432e02e3de 调整微信登录 2021-06-07 14:48:09 +08:00
lishuo 17eaccb72e 蓝牙调用调整 2021-06-04 19:23:32 +08:00
suntao 5671b35dce 修复设备选择界面多设备选择bug 2021-06-04 18:28:11 +08:00
suntao 7729332f41 接入基本设备 2021-06-04 13:22:59 +08:00
suntao 2f84f70a5f 接入蓝牙基本结构 2021-06-04 13:22:59 +08:00
suntao 84e8b50bbf Merge branch 'dev_lishuo' into dev 2021-06-04 13:21:23 +08:00
lishuo 8e1b4bbbca 解决区域标点符号问题 2021-06-04 13:19:37 +08:00
lishuo e88f32e99b 搜索面板条件关闭重新打开重置 2021-05-26 18:04:58 +08:00
lishuo 4e4da38252 伴侣骑行不选人点击确定报错bug修复;3d视角调整;倒计时优化; 2021-05-25 18:13:59 +08:00
lishuo 3757ae6e6c 继续骑行海图初始位置,地图属性调整 2021-05-24 10:16:35 +08:00
1444 changed files with 358089 additions and 47261 deletions

No files matched your search

+1
View File
@@ -91,3 +91,4 @@ Assets/Mapbox/User
Assets/Mapbox/User.meta
Packages/packages-lock.json
GPUCache
Assets/Shatalmic/plugin.unitypackage.meta
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace ChartAndGraph
{
@@ -24,7 +25,9 @@ namespace ChartAndGraph
public static string DateToTimeString(DateTime dateTime)
{
return dateTime.ToString("t");
Debug.Log("暫時");
return dateTime.ToString(@"HH:mm");
//return dateTime.ToString("t");
}
public static string DateToDateString(DateTime dateTime)
@@ -2,6 +2,7 @@
using UnityEngine;
using ChartAndGraph;
using System.Collections;
using System.Collections.Generic;
public class GraphChartFeed : MonoBehaviour
{
@@ -15,22 +16,21 @@ public class GraphChartFeed : MonoBehaviour
graph.DataSource.StartBatch();
graph.DataSource.ClearCategory("Player 1");
graph.DataSource.ClearAndMakeBezierCurve("Player 2");
for (int i = 0; i <10000; i++)
for (int i = 0; i < 10000; i++)
{
graph.DataSource.AddPointToCategory("Player 1",i*5,Random.value*10f + 20f);
graph.DataSource.AddPointToCategory("Player 1", i * 5, Random.value * 10f + 20f);
if (i == 0)
graph.DataSource.SetCurveInitialPoint("Player 2",i*5, Random.value * 10f + 10f);
graph.DataSource.SetCurveInitialPoint("Player 2", i * 5, Random.value * 10f + 10f);
else
graph.DataSource.AddLinearCurveToCategory("Player 2",
new DoubleVector2(i*5 , Random.value * 10f + 10f));
graph.DataSource.AddLinearCurveToCategory("Player 2",
new DoubleVector2(i * 5, Random.value * 10f + 10f));
}
graph.DataSource.MakeCurveCategorySmooth("Player 2");
graph.DataSource.EndBatch();
}
// StartCoroutine(ClearAll());
// StartCoroutine(ClearAll());
}
IEnumerator ClearAll()
{
yield return new WaitForSeconds(5f);
@@ -18,7 +18,7 @@ public partial class LargeDataFeed : MonoBehaviour, IComparer<DoubleVector2>
void Start()
{
graph = GetComponent<GraphChartBase>();
SetInitialData();
//SetInitialData();
}
/// <summary>
@@ -26,14 +26,15 @@ public partial class LargeDataFeed : MonoBehaviour, IComparer<DoubleVector2>
/// </summary>
void SetInitialData()
{
List<DoubleVector2> data = new List<DoubleVector2>(250000);
List<DoubleVector2> data = new List<DoubleVector2>(75);
double x = 0f;
double y = 200f;
for (int i = 0; i < 25000; i++) // initialize with random data
double y = 20f;
for (int i = 0; i < 75; i++) // initialize with random data
{
y = 20 + UnityEngine.Random.value*80;
Debug.Log(y);
x += 1;
data.Add(new DoubleVector2(x, y));
y += UnityEngine.Random.value * 10f - 5f;
x += UnityEngine.Random.value;
}
SetData(data);
}
File diff suppressed because it is too large. Load diff
+63
View File
@@ -0,0 +1,63 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ContentFitterController : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void Refresh()
{
LayoutRebuilder.ForceRebuildLayoutImmediate(transform.GetComponent<RectTransform>());
//Canvas.ForceUpdateCanvases();
//HorizontalOrVerticalLayoutGroup layout = GetComponent<HorizontalLayoutGroup>();
//if (layout)
//{
// UpdateRect(layout);
//}
//else
//{
// layout = GetComponent<VerticalLayoutGroup>();
// if (layout)
// {
// UpdateRect(layout);
// }
//}
}
private void OnRectTransformDimensionsChange()
{
Debug.Log("cf刷新一次2");
Refresh();
}
private IEnumerator UpdateRect()
{
LayoutRebuilder.ForceRebuildLayoutImmediate(transform.GetComponent<RectTransform>());
yield return new WaitForSeconds(0.1F);
var round = GetComponent<ImageWithIndependentRoundedCorners>();
if (round)
{
round.Refresh();
}
}
public void UpdateRect(HorizontalOrVerticalLayoutGroup layout)
{
if (layout is HorizontalLayoutGroup)
{
layout.SetLayoutHorizontal();
}
if (layout is VerticalLayoutGroup)
{
layout.SetLayoutVertical();
}
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 6adf1f0c1d929374aac00f3a6a2445bf
guid: d832f1dc5650bd24b90dbd3efdc2780e
MonoImporter:
externalObjects: {}
serializedVersion: 2
+60
View File
@@ -0,0 +1,60 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using DG.Tweening;
using UnityEngine.UI;
public class CountDownAnimation : PFUIPanel
{
// Start is called before the first frame update
void Start()
{
}
public void StartTime(UnityAction action,UnityAction action2)
{
HandleAnimation("5", action, action2);
}
void HandleAnimation(string s, UnityAction action, UnityAction action2)
{
var text = transform.Find("Text");
text.GetComponent<Text>().text = s;
text.transform.GetComponent<RectTransform>().DOScale(Vector3.one * 2, 0.5f).onComplete = () =>
{
text.GetComponent<RectTransform>().DOScale(Vector3.one * 0.5f, 0.5f).onComplete = ()=>
{
if (s == "Go")
{
action.Invoke();
gameObject.SetActive(false);
return;
}
var flag = int.TryParse(s,out int a);
if (flag)
{
if (a == 1 && action2 != null)
{
action2.Invoke();
}
if (a - 1 == 0)
{
HandleAnimation("Go", action, action2);
}
else
{
HandleAnimation((a - 1).ToString(), action, action2);
}
}
};
};
}
// Update is called once per frame
void Update()
{
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ae92e0e9dabf0114abd73458f7733f36
guid: 85535621a7b20f24b91b9a8e80b84ffa
MonoImporter:
externalObjects: {}
serializedVersion: 2
File diff suppressed because it is too large. Load diff
-71
View File
@@ -1,71 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using UnityEngine.SceneManagement;
public class ButtonScript : MonoBehaviour
{
[SerializeField] Button button;
[SerializeField] Text text;
[SerializeField] GUISkin skin;
[SerializeField] InputField input;
[SerializeField] Image image;
[SerializeField] RawImage rawImage;
[SerializeField] EventSystem ec;
[SerializeField] UnityEngine.UIElements.ScrollView scroll;
private string btnText = "This is a button";
// Start is called before the first frame update
private void OnGUI()
{
//GUI.skin = skin;
GUI.Label(new Rect(0, 0, 200, 100), "Hi - I'm a label looking like a box", "box");
// 创建使用"“切换键" GUIStyle 的按钮
if (Time.time % 2 < 1 && GUI.Button(new Rect(10, 140, 180, 20), btnText))
{
btnText = "hello world" + Time.time;
}
GUI.Button(new Rect(100, 100, 300, 30), "Skinned Button");
}
void Start()
{
var a = GameObject.Find("ViewportGrid");
Debug.Log($"{Screen.width},{Screen.height}");
Debug.Log(gameObject.name);
button.onClick.AddListener(() =>
{
if (SceneManager.GetActiveScene().name == "Demo1")
{
SceneManager.LoadScene("Demo2");
}
else
{
SceneManager.LoadScene("Demo1");
}
});
input.onEndEdit.AddListener((t)=>
{
Debug.Log(t);
text.text = t;
});
//image.flexibleWidth = Screen.width;
//image.flexibleHeight = Screen.height;
}
// Update is called once per frame
void Update()
{
}
void OnDestroy()
{
button.onClick.RemoveAllListeners();
input.onEndEdit.RemoveAllListeners();
}
}
File diff suppressed because it is too large. Load diff
-36
View File
@@ -1,36 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.UI;
public class ScrollTest : MonoBehaviour
{
// Start is called before the first frame update
private ScrollRect scroll;
void Start()
{
scroll = gameObject.GetComponent<ScrollRect>();
}
private bool dir = true;
// Update is called once per frame
void Update()
{
if (dir)
{
scroll.horizontalNormalizedPosition += 0.01f;
if (scroll.horizontalNormalizedPosition >= 1)
{
dir = false;
}
}
else
{
scroll.horizontalNormalizedPosition -= 0.01f;
if (scroll.horizontalNormalizedPosition <= 0)
{
dir = true;
}
}
}
}
-102
View File
@@ -1,102 +0,0 @@
Shader "Custom/ImageMask"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Mask ("Base (RGB)", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
}
SubShader
{
Tags
{
"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" "CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#pragma multi_compile __ UNITY_UI_ALPHACLIP
struct a2v
{
fixed2 uv : TEXCOORD0;
half4 vertex : POSITION;
float4 color : COLOR;
};
fixed4 _Color;
struct v2f
{
fixed2 uv : TEXCOORD0;
half4 vertex : SV_POSITION;
float4 color : COLOR;
};
sampler2D _MainTex;
sampler2D _Mask;
v2f vert (a2v i)
{
v2f o;
o.vertex = UnityObjectToClipPos(i.vertex);
o.uv = i.uv;
o.color = i.color * _Color;
return o;
}
fixed4 frag (v2f i) : COLOR
{
half4 color = tex2D(_MainTex, i.uv) * i.color;
half4 mask = tex2D(_Mask, i.uv);
color.a *= mask.a;
return color;
}
ENDCG
}
}
}
-9
View File
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 36c797600830d844eaec2cfe2b90bfb0
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large. Load diff
-40
View File
@@ -1,40 +0,0 @@
Shader "Custom/RotateUVs" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_RotationSpeed ("Rotation Speed", Float) = 2.0
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert vertex:vert
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
};
float _RotationSpeed;
void vert (inout appdata_full v) {
v.texcoord.xy -=0.5;
float s = sin ( _RotationSpeed * _Time );
float c = cos ( _RotationSpeed * _Time );
float2x2 rotationMatrix = float2x2( c, -s, s, c);
rotationMatrix *=0.5;
rotationMatrix +=0.5;
rotationMatrix = rotationMatrix * 2-1;
v.texcoord.xy = mul ( v.texcoord.xy, rotationMatrix );
v.texcoord.xy += 0.5;
}
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}
-9
View File
@@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 5a1aa2bd026c81c48bdbc2d02be7dd04
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

-256
View File
@@ -1,256 +0,0 @@
fileFormatVersion: 2
guid: 6ab82263af6297c409a983013c26f174
TextureImporter:
internalIDToNameTable:
- first:
213: 134134969389708294
second: png-4_0
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 0
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: 0
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: png-4_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 100
height: 60
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 28, y: 0, z: 25, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 6047e624b0b8cd100800000000000000
internalID: 134134969389708294
vertices: []
indices:
edges: []
weights: []
outline:
- - {x: 0, y: 30}
- {x: -2.453384, y: 29.963863}
- {x: -4.900857, y: 29.855541}
- {x: -7.3365235, y: 29.675295}
- {x: -9.754517, y: 29.423557}
- {x: -12.14901, y: 29.100937}
- {x: -14.514234, y: 28.70821}
- {x: -16.844492, y: 28.246323}
- {x: -19.13417, y: 27.716387}
- {x: -21.377752, y: 27.119678}
- {x: -23.569836, y: 26.457638}
- {x: -25.705137, y: 25.731857}
- {x: -27.778513, y: 24.944088}
- {x: -29.784966, y: 24.096226}
- {x: -31.719667, y: 23.190313}
- {x: -33.57795, y: 22.22853}
- {x: -35.355343, y: 21.213202}
- {x: -37.047558, y: 20.146767}
- {x: -38.650528, y: 19.031796}
- {x: -40.16038, y: 17.870975}
- {x: -41.573486, y: 16.667103}
- {x: -42.886436, y: 15.423078}
- {x: -44.09607, y: 14.141897}
- {x: -45.19947, y: 12.826647}
- {x: -46.19398, y: 11.480496}
- {x: -47.07721, y: 10.106688}
- {x: -47.84702, y: 8.708532}
- {x: -48.501568, y: 7.2893963}
- {x: -49.03927, y: 5.8527}
- {x: -49.458828, y: 4.401904}
- {x: -49.75924, y: 2.9405036}
- {x: -49.939774, y: 1.4720187}
- {x: -50, y: -0.000012040178}
- {x: -49.939774, y: -1.4720428}
- {x: -49.75923, y: -2.9405274}
- {x: -49.458824, y: -4.401928}
- {x: -49.03926, y: -5.852724}
- {x: -48.501556, y: -7.2894197}
- {x: -47.847008, y: -8.708555}
- {x: -47.077194, y: -10.106711}
- {x: -46.193966, y: -11.480519}
- {x: -45.199455, y: -12.826665}
- {x: -44.096054, y: -14.1419115}
- {x: -42.886425, y: -15.42309}
- {x: -41.57348, y: -16.66711}
- {x: -40.160378, y: -17.870981}
- {x: -38.650524, y: -19.031797}
- {x: -37.04756, y: -20.146767}
- {x: -35.355347, y: -21.213198}
- {x: -33.57796, y: -22.228527}
- {x: -31.71968, y: -23.190306}
- {x: -29.784986, y: -24.096216}
- {x: -27.77854, y: -24.944077}
- {x: -25.705168, y: -25.731848}
- {x: -23.569874, y: -26.457626}
- {x: -21.377796, y: -27.119667}
- {x: -19.134218, y: -27.716373}
- {x: -16.844545, y: -28.246311}
- {x: -14.514293, y: -28.7082}
- {x: -12.149074, y: -29.100927}
- {x: -9.754586, y: -29.42355}
- {x: -7.3365993, y: -29.67529}
- {x: -4.9009376, y: -29.855536}
- {x: -2.4534698, y: -29.963861}
- {x: -0.00009099629, y: -30}
- {x: 2.4532878, y: -29.963867}
- {x: 4.9007564, y: -29.855547}
- {x: 7.336419, y: -29.675304}
- {x: 9.754408, y: -29.423573}
- {x: 12.148896, y: -29.100954}
- {x: 14.514118, y: -28.708231}
- {x: 16.844374, y: -28.246347}
- {x: 19.13405, y: -27.716415}
- {x: 21.377632, y: -27.119713}
- {x: 23.569714, y: -26.457678}
- {x: 25.705013, y: -25.731903}
- {x: 27.778387, y: -24.944138}
- {x: 29.78484, y: -24.096281}
- {x: 31.719542, y: -23.190374}
- {x: 33.577827, y: -22.2286}
- {x: 35.35522, y: -21.213276}
- {x: 37.04744, y: -20.146847}
- {x: 38.650417, y: -19.031878}
- {x: 40.160282, y: -17.871056}
- {x: 41.573395, y: -16.667185}
- {x: 42.886356, y: -15.423158}
- {x: 44.095997, y: -14.141976}
- {x: 45.199406, y: -12.826725}
- {x: 46.193928, y: -11.480574}
- {x: 47.077164, y: -10.106763}
- {x: 47.846985, y: -8.708605}
- {x: 48.501537, y: -7.2894673}
- {x: 49.039246, y: -5.852768}
- {x: 49.45881, y: -4.4019685}
- {x: 49.759228, y: -2.9405649}
- {x: 49.93977, y: -1.4720769}
- {x: 50, y: -0.0000425576}
- {x: 49.939774, y: 1.4719919}
- {x: 49.759243, y: 2.9404802}
- {x: 49.45883, y: 4.4018846}
- {x: 49.039272, y: 5.852684}
- {x: 48.50157, y: 7.2893844}
- {x: 47.847027, y: 8.708524}
- {x: 47.077213, y: 10.106684}
- {x: 46.19398, y: 11.4804945}
- {x: 45.19947, y: 12.826648}
- {x: 44.096066, y: 14.141901}
- {x: 42.88643, y: 15.423084}
- {x: 41.573475, y: 16.667112}
- {x: 40.160362, y: 17.870989}
- {x: 38.650505, y: 19.03181}
- {x: 37.047535, y: 20.146784}
- {x: 35.355312, y: 21.21322}
- {x: 33.57791, y: 22.228554}
- {x: 31.719622, y: 23.190334}
- {x: 29.784914, y: 24.096249}
- {x: 27.778456, y: 24.94411}
- {x: 25.705072, y: 25.731882}
- {x: 23.569765, y: 26.457663}
- {x: 21.377674, y: 27.119701}
- {x: 19.134083, y: 27.716408}
- {x: 16.844397, y: 28.246344}
- {x: 14.514129, y: 28.70823}
- {x: 12.148896, y: 29.100954}
- {x: 9.754395, y: 29.423574}
- {x: 7.3363943, y: 29.675306}
- {x: 4.90072, y: 29.85555}
- {x: 2.453239, y: 29.963867}
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 581 KiB

+33
View File
@@ -0,0 +1,33 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class CEditor : Editor
{
[MenuItem("GameObject/CopyHierarchyPath", false, 11)]
public static void CopyHierarchy()
{
GameObject go = Selection.activeGameObject;
string path = go.GetRPath();
path = path.Replace("Canvas (Environment)/", "");
GUIUtility.systemCopyBuffer = path;
}
}
public static class Ex
{
public static string GetRPath(this GameObject go)
{
GameObject current = go;
string path = current.name;
while (null != current.transform.parent)
{
current = current.transform.parent.gameObject;
path = current.name + "/" + path;
}
return path;
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ab770f3fae92ac1478b8a7c28eccb895
guid: c50a36b17c46c9b4396813a8b0ec2e88
MonoImporter:
externalObjects: {}
serializedVersion: 2
+2 -1
View File
@@ -12,10 +12,11 @@ public class MyBuildPostprocessor
{
//Debug.Log(pathToBuiltProject);
//System.IO.File.AppendAllText("D:\\test.txt",pathToBuiltProject);
#if !(UNITY_IOS || UNITY_ANDROID)
var dir = Path.GetDirectoryName(pathToBuiltProject);
File.Copy(dir + "\\PowerFun_Data\\Plugins\\x86_64\\ANT_WrappedLib.dll", dir + "\\PowerFun_Data\\Managed\\ANT_WrappedLib.dll");
File.Copy(dir + "\\PowerFun_Data\\Plugins\\x86_64\\DSI_CP210xManufacturing_3_1.dll", dir + "\\PowerFun_Data\\Managed\\DSI_CP210xManufacturing_3_1.dll");
File.Copy(dir + "\\PowerFun_Data\\Plugins\\x86_64\\DSI_SiUSBXp_3_1.dll", dir + "\\PowerFun_Data\\Managed\\DSI_SiUSBXp_3_1.dll");
#endif
}
}
+106
View File
@@ -0,0 +1,106 @@
#if UNITY_IOS && UNITY_EDITOR
using UnityEditor;
using System.IO;
using UnityEngine;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
#endif
public static class XCodePostProcessBuild
{
#if UNITY_IOS && UNITY_EDITOR
private static readonly string[] csAddFrameworks = new string[]{
"Security.framework","WebKit.framework", "CoreGraphics.framework"
};
[PostProcessBuild(1)]
public static void OnPostprocessBuild(BuildTarget buildTarget, string pathToBuiltProject)
{
if (BuildTarget.iOS != buildTarget)
{
return;
}
string projectPath = pathToBuiltProject + "/Unity-iPhone.xcodeproj/project.pbxproj";
SetFrameworksAndBuildSettings(projectPath);
SetInfoList(pathToBuiltProject, "com.ZhiXingPai.PowerFun", "wxe3573a84e7e29902");
SetAssociatedDomains(projectPath, "wx.powerfun.com.cn");
}
private static void SetFrameworksAndBuildSettings(string path)
{
PBXProject proj = new PBXProject();
proj.ReadFromString(File.ReadAllText(path));
string target = proj.GetUnityMainTargetGuid();
Debug.Log("Target Name is " + target);
// 设置 BuildSettings
proj.AddBuildProperty(target, "Other Linker Flags", "-Objc -all_load");
proj.SetBuildProperty(target, "ENABLE_BITCODE", "NO");
//根据微信SDK文档的要求,加入相关的Frameworks
for (int i = 0; i < csAddFrameworks.Length; ++i)
{
if (!proj.ContainsFramework(target, csAddFrameworks[i]))
proj.AddFrameworkToProject(target, csAddFrameworks[i], false);
}
File.WriteAllText(path, proj.WriteToString());
}
public static void SetInfoList(string buildPath, string wxUrlName, string wxScheme)
{
string listPath = buildPath + "/Info.plist";
PlistDocument plist = new PlistDocument();
plist.ReadFromString(File.ReadAllText(listPath));
// 在“info”标签栏的“URL type“添加“URL scheme”,值为你在微信后台注册的应用程序的 AppID
PlistElementArray urlArray = plist.root.CreateArray("CFBundleURLTypes");
PlistElementDict dict = urlArray.AddDict();
dict.SetString("CFBundleTypeRole", "Editor");
dict.SetString("CFBundleURLName", wxUrlName);
PlistElementArray urlSchemes = dict.CreateArray("CFBundleURLSchemes");
urlSchemes.AddString(wxScheme);
PlistElementDict dictMine = urlArray.AddDict();
dictMine.SetString("CFBundleTypeRole", "Editor");
dictMine.SetString("CFBundleURLName", "powerfunx");
PlistElementArray urlSchemesMine = dictMine.CreateArray("CFBundleURLSchemes");
urlSchemesMine.AddString("powerfunx");
// 在 “info”标签栏的“LSApplicationQueriesSchemes“添加weixin wechat和weixinULAPI
PlistElementArray wxArray = plist.root.CreateArray("LSApplicationQueriesSchemes");
wxArray.AddString("weixin");
wxArray.AddString("wechat");
wxArray.AddString("weixinULAPI");
wxArray.AddString("powerfun");
// 设置转向
//var orientations = plist.root.CreateArray("UISupportedInterfaceOrientations");
//orientations.AddString("UIInterfaceOrientationLandscapeRight");
//orientations.AddString("UIInterfaceOrientationLandscapeLeft");
PlistElementDict qxLoc = plist.root.CreateDict("NSLocationWhenInUseUsageDescription");
qxLoc.SetBoolean("NSLocationWhenInUseUsageDescription", true);
plist.root.SetString("NSCameraUsageDescription","cameraDesciption");
plist.root.SetString("NSContactsUsageDescription", "contactsDesciption");
plist.root.SetString("NSMicrophoneUsageDescription", "microphoneDesciption");
plist.root.SetString("NSPhotoLibraryUsageDescription", "photoLibraryDesciption");
plist.root.SetString("NSLocationWhenInUseUsageDescription", "locationWhenInUseUsageDescription");
plist.root.SetBoolean("ITSAppUsesNonExemptEncryption", false);
File.WriteAllText(listPath, plist.WriteToString());
}
// 设置Associated Domains
public static void SetAssociatedDomains(string pbxProjectPath, string domainUrl)
{
//默认 Target Name, 你自己的可能不一样
string targetName = "Unity-iPhone";
//Set the entitlements file name to what you want but make sure it has this extension
string entitlementsFileName = "my_app.entitlements";
var entitlements = new ProjectCapabilityManager(pbxProjectPath, entitlementsFileName, targetName);
entitlements.AddAssociatedDomains(new string[] { "applinks:" + domainUrl });
entitlements.WriteToFile();
}
#endif
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 84ef3790c38d9564cb7770687283c42d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,4 +1,4 @@
#import <MapboxMobileEvents/MapboxMobileEvents.h>
#import "MapboxMobileEvents/include/MapboxMobileEvents/MapboxMobileEvents.h"
void initialize(const char* accessToken, const char* userAgentBase, const char* hostSDKVersion) {
[[MMEEventsManager sharedManager] initializeWithAccessToken:[NSString stringWithUTF8String:accessToken]
@@ -8,7 +8,7 @@ FOUNDATION_EXPORT const unsigned char MapboxMobileEventsVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <MapboxMobileEvents/PublicHeader.h>
#import <MapboxMobileEvents/MMEConstants.h>
#import <MapboxMobileEvents/MMEEvent.h>
#import <MapboxMobileEvents/MMETypes.h>
#import <MapboxMobileEvents/MMEEventsManager.h>
#import <MMEConstants.h>
#import <MMEEvent.h>
#import <MMETypes.h>
#import <MMEEventsManager.h>
Binary file not shown.
+1 -1
View File
@@ -1137,7 +1137,7 @@ namespace Mapbox.Unity.Map
public virtual void SetCenterLatitudeLongitude(Vector2d centerLatitudeLongitude)
{
_options.locationOptions.latitudeLongitude = string.Format("{0}, {1}", centerLatitudeLongitude.x, centerLatitudeLongitude.y);
_options.locationOptions.latitudeLongitude = string.Format("{0}, {1}", centerLatitudeLongitude.x.ToString(CultureInfo.InvariantCulture), centerLatitudeLongitude.y.ToString(CultureInfo.InvariantCulture));
_centerLatitudeLongitude = centerLatitudeLongitude;
}
@@ -23,8 +23,16 @@
protected virtual IEnumerator Start()
{
yield return null;
_locationProvider = LocationProviderFactory.Instance.DefaultLocationProvider;
_locationProvider.OnLocationUpdated += LocationProvider_OnLocationUpdated; ;
//_locationProvider = LocationProviderFactory.Instance.DefaultLocationProvider;
//_locationProvider.OnLocationUpdated += LocationProvider_OnLocationUpdated; ;
var mainController = transform.parent.GetComponent<CyclingController>();
if (mainController != null)
{
//初始化map
var point = mainController.GetCenterCoordinate();
_map.Initialize(point, _map.AbsoluteZoom);
}
}
void LocationProvider_OnLocationUpdated(Unity.Location.Location location)
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 9c10d8a67a9a13f46bb4f2111feb60ff
guid: 6c0b73ecbec479c43a99fc8513bbf95b
folderAsset: yes
DefaultImporter:
externalObjects: {}
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<application android:requestLegacyExternalStorage="true">
<activity android:name="com.unityplugins.imageselector.TestMainActivity"
android:theme="@style/UnityThemeSelector"
android:screenOrientation="landscape"
android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:hardwareAccelerated="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="powerfunx" android:host="app" />
</intent-filter>
</activity>
<activity
android:launchMode="singleInstance"
android:name="com.unityplugins.imageselector.SelectActivity">
</activity>
</application>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.bluetooth_le" android:required="false"/>
</manifest>
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4abd69b18c4ab45ec976851430122248
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
@@ -0,0 +1,32 @@
fileFormatVersion: 2
guid: 9722f205596f2fd499991ea299119cc8
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,32 @@
fileFormatVersion: 2
guid: 53d84661e0b3c5349a17e6043175d0d9
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,51 @@
// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
apply plugin: 'com.android.library'
**APPLY_PLUGINS**
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation(name: 'animated-vector-drawable-25.1.0', ext:'aar')
implementation(name: 'appcompat-v7-25.1.0', ext:'aar')
implementation(name: 'com.mapbox.android.unity-debug', ext:'aar')
implementation(name: 'libcore-release', ext:'aar')
implementation(name: 'libtelemetry-full-release', ext:'aar')
implementation(name: 'support-compat-25.1.0', ext:'aar')
implementation(name: 'support-core-ui-25.1.0', ext:'aar')
implementation(name: 'support-core-utils-25.1.0', ext:'aar')
implementation(name: 'support-media-compat-25.1.0', ext:'aar')
implementation(name: 'support-v4-25.1.0', ext:'aar')
implementation(name: 'support-vector-drawable-25.1.0', ext:'aar')
implementation(name: 'UnityCallWechatShare-release', ext:'aar')
implementation files ('libs/ImageSelector-release.aar')
}
android {
compileSdkVersion **APIVERSION**
buildToolsVersion '**BUILDTOOLS**'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
minSdkVersion **MINSDKVERSION**
targetSdkVersion **TARGETSDKVERSION**
ndk {
abiFilters **ABIFILTERS**
}
versionCode **VERSIONCODE**
versionName '**VERSIONNAME**'
consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
}
lintOptions {
abortOnError false
}
aaptOptions {
ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
}**PACKAGING_OPTIONS**
}**REPOSITORIES****SOURCE_BUILD_SETUP**
**EXTERNAL_SOURCES**
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 6d3a9f3ee7ee70e408ce98d319d0b7f4
guid: 27f3715cd06fd6c4f883fc6cf73e0632
DefaultImporter:
externalObjects: {}
userData:
Binary file not shown.
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5b7f613e45c7cb44b95d09b1966102e3
guid: 306a0c395439baa468b3bcd3fe5983ae
DefaultImporter:
externalObjects: {}
userData:
@@ -0,0 +1,32 @@
fileFormatVersion: 2
guid: f158ceee465c745bc89002ae57bc033e
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Android: Android
second:
enabled: 1
settings: {}
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
+401
View File
@@ -0,0 +1,401 @@
using System;
using System.Collections.Generic;
using UnityEngine;
public class BluetoothDeviceScript : MonoBehaviour
{
#if UNITY_IOS
public Dictionary<string, string> BLEStandardUUIDs = new Dictionary<string, string>();
#endif
public List<string> DiscoveredDeviceList;
public Action InitializedAction { get; set; }
public Action DeinitializedAction;
public Action<string> ErrorAction;
public Action<string> ServiceAddedAction;
public Action<int> BleStatusChangedAction;
public Action StartedAdvertisingAction;
public Action StoppedAdvertisingAction;
public Action<string, string> DiscoveredPeripheralAction;
public Action<string, string, int, string[]> DiscoveredPeripheralWithAdvertisingInfoAction;
public Action<BluetoothLEHardwareInterface.iBeaconData> DiscoveredBeaconAction;
public Action<string, string> RetrievedConnectedPeripheralAction;
public Action<string, byte[]> PeripheralReceivedWriteDataAction;
public Action<string> ConnectedPeripheralAction;
public Action<string> ConnectedDisconnectPeripheralAction { get; set; }
public Action<string> DisconnectedPeripheralAction;
public Action<string> DeviceBleStatusDisconnectedAction;
public Action<string, string> DiscoveredServiceAction;
public Action<string, string, string> DiscoveredCharacteristicAction;
public Action<string> DidWriteCharacteristicAction;
public Dictionary<string, Dictionary<string, Action<string>>> DidUpdateNotificationStateForCharacteristicAction;
public Dictionary<string, Dictionary<string, Action<string, string>>> DidUpdateNotificationStateForCharacteristicWithDeviceAddressAction;
public Dictionary<string, Dictionary<string, Action<string, byte[]>>> DidUpdateCharacteristicValueAction;
public Dictionary<string, Dictionary<string, Action<string, string, byte[]>>> DidUpdateCharacteristicValueWithDeviceAddressAction;
public Action<string, int> RequestMtuAction;
// Use this for initialization
void Start ()
{
DiscoveredDeviceList = new List<string> ();
DidUpdateNotificationStateForCharacteristicAction = new Dictionary<string, Dictionary<string, Action<string>>> ();
DidUpdateNotificationStateForCharacteristicWithDeviceAddressAction = new Dictionary<string, Dictionary<string, Action<string, string>>> ();
DidUpdateCharacteristicValueAction = new Dictionary<string, Dictionary<string, Action<string, byte[]>>> ();
DidUpdateCharacteristicValueWithDeviceAddressAction = new Dictionary<string, Dictionary<string, Action<string, string, byte[]>>> ();
#if UNITY_IOS
BLEStandardUUIDs["Heart Rate Measurement"] = "00002A37-0000-1000-8000-00805F9B34FB";
#endif
}
// Update is called once per frame
void Update ()
{
}
const string deviceInitializedString = "Initialized";
const string deviceDeInitializedString = "DeInitialized";
const string deviceErrorString = "Error";
const string deviceServiceAdded = "ServiceAdded";
const string deviceStartedAdvertising = "StartedAdvertising";
const string deviceStoppedAdvertising = "StoppedAdvertising";
const string deviceDiscoveredPeripheral = "DiscoveredPeripheral";
const string deviceDiscoveredBeacon = "DiscoveredBeacon";
const string deviceRetrievedConnectedPeripheral = "RetrievedConnectedPeripheral";
const string devicePeripheralReceivedWriteData = "PeripheralReceivedWriteData";
const string deviceConnectedPeripheral = "ConnectedPeripheral";
const string deviceDisconnectedPeripheral = "DisconnectedPeripheral";
const string deviceDiscoveredService = "DiscoveredService";
const string deviceDiscoveredCharacteristic = "DiscoveredCharacteristic";
const string deviceDidWriteCharacteristic = "DidWriteCharacteristic";
const string deviceDidUpdateNotificationStateForCharacteristic = "DidUpdateNotificationStateForCharacteristic";
const string deviceDidUpdateValueForCharacteristic = "DidUpdateValueForCharacteristic";
const string deviceLog = "Log";
const string deviceRequestMtu = "MtuChanged";
const string bleStatusChanged = "BleStatusChanged";
public void OnBluetoothMessage (string message)
{
if (message != null)
{
char[] delim = new char[] { '~' };
string[] parts = message.Split (delim);
if (parts[0].Equals("DeviceStateChanged"))
{
if (DeviceBleStatusDisconnectedAction != null && parts[1].Equals("0"))
{
DeviceBleStatusDisconnectedAction(parts[2]);
}
}
if (parts[0].Equals(bleStatusChanged))
{
if (BleStatusChangedAction != null)
{
BleStatusChangedAction(int.Parse(parts[1]));
}
}
for (int i = 0; i < parts.Length; ++i) ;
//Debug.Log(string.Format("Part: {0} - {1}", i, parts[i]));
if (message.Length >= deviceInitializedString.Length && message.Substring (0, deviceInitializedString.Length) == deviceInitializedString)
{
if (InitializedAction != null)
InitializedAction ();
}
else if (message.Length >= deviceLog.Length && message.Substring (0, deviceLog.Length) == deviceLog)
{
BluetoothLEHardwareInterface.Log (parts[1]);
}
else if (message.Length >= deviceDeInitializedString.Length && message.Substring (0, deviceDeInitializedString.Length) == deviceDeInitializedString)
{
BluetoothLEHardwareInterface.FinishDeInitialize ();
if (DeinitializedAction != null)
DeinitializedAction ();
}
else if (message.Length >= deviceErrorString.Length && message.Substring (0, deviceErrorString.Length) == deviceErrorString)
{
string error = "";
if (parts.Length >= 2)
error = parts[1];
if (ErrorAction != null)
ErrorAction (error);
}
else if (message.Length >= deviceServiceAdded.Length && message.Substring (0, deviceServiceAdded.Length) == deviceServiceAdded)
{
if (parts.Length >= 2)
{
if (ServiceAddedAction != null)
ServiceAddedAction (parts[1]);
}
}
else if (message.Length >= deviceStartedAdvertising.Length && message.Substring (0, deviceStartedAdvertising.Length) == deviceStartedAdvertising)
{
BluetoothLEHardwareInterface.Log ("Started Advertising");
if (StartedAdvertisingAction != null)
StartedAdvertisingAction ();
}
else if (message.Length >= deviceStoppedAdvertising.Length && message.Substring (0, deviceStoppedAdvertising.Length) == deviceStoppedAdvertising)
{
BluetoothLEHardwareInterface.Log ("Stopped Advertising");
if (StoppedAdvertisingAction != null)
StoppedAdvertisingAction ();
}
else if (message.Length >= deviceDiscoveredPeripheral.Length && message.Substring (0, deviceDiscoveredPeripheral.Length) == deviceDiscoveredPeripheral)
{
if (parts.Length >= 3)
{
// the first callback will only get called the first time this device is seen
// this is because it gets added to the a list in the DiscoveredDeviceList
// after that only the second callback will get called and only if there is
// advertising data available
if (!DiscoveredDeviceList.Contains (parts[1] + "|" + parts[2]))
{
DiscoveredDeviceList.Add (parts[1] + "|" + parts[2]);
if (DiscoveredPeripheralAction != null)
DiscoveredPeripheralAction (parts[1], parts[2]);
}
if (parts.Length >= 5 && DiscoveredPeripheralWithAdvertisingInfoAction != null)
{
// get the rssi from the 4th value
int rssi = 0;
if (!int.TryParse (parts[3], out rssi))
rssi = 0;
List<string> uuidList = new List<string>();
if (parts[4].Contains(","))
{
string[] s = parts[4].Split(',');
foreach (var o in s)
{
if (!string.IsNullOrEmpty(o))
{
uuidList.Add(o);
}
}
}
//// parse the base 64 encoded data that is the 5th value
//byte[] bytes = System.Convert.FromBase64String (parts[4]);
DiscoveredPeripheralWithAdvertisingInfoAction (parts[1], parts[2], rssi, uuidList.ToArray());
}
}
}
else if (message.Length >= deviceDiscoveredBeacon.Length && message.Substring (0, deviceDiscoveredBeacon.Length) == deviceDiscoveredBeacon)
{
if (parts.Length >= 7)
{
var iBeaconData = new BluetoothLEHardwareInterface.iBeaconData ();
iBeaconData.UUID = parts[1];
if (!int.TryParse (parts[2], out iBeaconData.Major))
iBeaconData.Major = 0;
if (!int.TryParse (parts[3], out iBeaconData.Minor))
iBeaconData.Minor = 0;
if (!int.TryParse (parts[4], out iBeaconData.RSSI))
iBeaconData.RSSI = 0;
if (!int.TryParse (parts[5], out iBeaconData.AndroidSignalPower))
iBeaconData.AndroidSignalPower = 0;
int iOSProximity = 0;
if (!int.TryParse (parts[6], out iOSProximity))
iOSProximity = 0;
iBeaconData.iOSProximity = (BluetoothLEHardwareInterface.iOSProximity)iOSProximity;
if (DiscoveredBeaconAction != null)
DiscoveredBeaconAction (iBeaconData);
}
}
else if (message.Length >= deviceRetrievedConnectedPeripheral.Length && message.Substring (0, deviceRetrievedConnectedPeripheral.Length) == deviceRetrievedConnectedPeripheral)
{
if (parts.Length >= 3)
{
DiscoveredDeviceList.Add (parts[1]);
if (RetrievedConnectedPeripheralAction != null)
RetrievedConnectedPeripheralAction (parts[1], parts[2]);
}
}
else if (message.Length >= devicePeripheralReceivedWriteData.Length && message.Substring (0, devicePeripheralReceivedWriteData.Length) == devicePeripheralReceivedWriteData)
{
if (parts.Length >= 3)
OnPeripheralData (parts[1], parts[2]);
}
else if (message.Length >= deviceConnectedPeripheral.Length && message.Substring (0, deviceConnectedPeripheral.Length) == deviceConnectedPeripheral)
{
if (parts.Length >= 2 && ConnectedPeripheralAction != null)
ConnectedPeripheralAction (parts[1]);
}
else if (message.Length >= deviceDisconnectedPeripheral.Length && message.Substring (0, deviceDisconnectedPeripheral.Length) == deviceDisconnectedPeripheral)
{
if (parts.Length >= 2)
{
if (ConnectedDisconnectPeripheralAction != null)
ConnectedDisconnectPeripheralAction(parts[1]);
if (DisconnectedPeripheralAction != null)
DisconnectedPeripheralAction(parts[1]);
}
}
else if (message.Length >= deviceDiscoveredService.Length && message.Substring (0, deviceDiscoveredService.Length) == deviceDiscoveredService)
{
if (parts.Length >= 3 && DiscoveredServiceAction != null)
DiscoveredServiceAction (parts[1], FullUUID(parts[2]));
}
else if (message.Length >= deviceDiscoveredCharacteristic.Length && message.Substring (0, deviceDiscoveredCharacteristic.Length) == deviceDiscoveredCharacteristic)
{
if (parts.Length >= 4 && DiscoveredCharacteristicAction != null)
DiscoveredCharacteristicAction (parts[1], FullUUID(parts[2]), FullUUID(parts[3]));
}
else if (message.Length >= deviceDidWriteCharacteristic.Length && message.Substring (0, deviceDidWriteCharacteristic.Length) == deviceDidWriteCharacteristic)
{
if (parts.Length >= 2 && DidWriteCharacteristicAction != null)
DidWriteCharacteristicAction (parts[1]);
}
else if (message.Length >= deviceDidUpdateNotificationStateForCharacteristic.Length && message.Substring (0, deviceDidUpdateNotificationStateForCharacteristic.Length) == deviceDidUpdateNotificationStateForCharacteristic)
{
if (parts.Length >= 3)
{
if (DidUpdateNotificationStateForCharacteristicAction != null && DidUpdateNotificationStateForCharacteristicAction.ContainsKey (parts[1]))
{
var characteristicAction = DidUpdateNotificationStateForCharacteristicAction[parts[1]];
if (characteristicAction != null && characteristicAction.ContainsKey (FullUUID(parts[2])))
{
var action = characteristicAction[FullUUID(parts[2])];
if (action != null)
action (FullUUID(parts[2]));
}
}
if (DidUpdateNotificationStateForCharacteristicWithDeviceAddressAction != null && DidUpdateNotificationStateForCharacteristicWithDeviceAddressAction.ContainsKey (parts[1]))
{
var characteristicAction = DidUpdateNotificationStateForCharacteristicWithDeviceAddressAction[parts[1]];
if (characteristicAction != null && characteristicAction.ContainsKey (parts[2]))
{
var action = characteristicAction[FullUUID(parts[2])];
if (action != null)
action (parts[1], FullUUID(parts[2]));
}
}
}
}
else if (message.Length >= deviceDidUpdateValueForCharacteristic.Length && message.Substring (0, deviceDidUpdateValueForCharacteristic.Length) == deviceDidUpdateValueForCharacteristic)
{
if (parts.Length >= 4)
OnBluetoothData (parts[1], FullUUID(parts[2]), parts[3]);
}
else if (message.Length >= deviceRequestMtu.Length && message.Substring(0, deviceRequestMtu.Length) == deviceRequestMtu)
{
if (parts.Length >= 3)
{
if (RequestMtuAction != null)
{
int mtu = 0;
if (int.TryParse(parts[2], out mtu))
RequestMtuAction(parts[1], mtu);
}
}
}
}
}
public static string FullUUID(string uuid)
{
if (uuid.Length == 4)
return "0000" + uuid + "-0000-1000-8000-00805F9B34FB";
return uuid;
}
public void OnBluetoothData (string base64Data)
{
OnBluetoothData ("", "", base64Data);
}
public void OnBluetoothData (string deviceAddress, string characteristic, string base64Data)
{
if (base64Data != null)
{
byte[] bytes = System.Convert.FromBase64String (base64Data);
if (bytes.Length > 0)
{
deviceAddress = deviceAddress.ToUpper ();
characteristic = characteristic.ToUpper ();
#if UNITY_IOS
if (BLEStandardUUIDs.ContainsKey(characteristic))
characteristic = BLEStandardUUIDs[characteristic];
#endif
BluetoothLEHardwareInterface.Log ("Device: " + deviceAddress + " Characteristic Received: " + characteristic);
string byteString = "";
foreach (byte b in bytes)
byteString += string.Format ("{0:X2}", b);
BluetoothLEHardwareInterface.Log (byteString);
if (DidUpdateCharacteristicValueAction != null && DidUpdateCharacteristicValueAction.ContainsKey (deviceAddress))
{
var characteristicAction = DidUpdateCharacteristicValueAction[deviceAddress];
#if UNITY_ANDROID
characteristic = characteristic.ToLower ();
#endif
if (characteristicAction != null && characteristicAction.ContainsKey (characteristic))
{
var action = characteristicAction[characteristic];
if (action != null)
action (characteristic, bytes);
}
}
if (DidUpdateCharacteristicValueWithDeviceAddressAction != null && DidUpdateCharacteristicValueWithDeviceAddressAction.ContainsKey (deviceAddress))
{
var characteristicAction = DidUpdateCharacteristicValueWithDeviceAddressAction[deviceAddress];
#if UNITY_ANDROID
characteristic = characteristic.ToLower ();
#endif
if (characteristicAction != null && characteristicAction.ContainsKey (characteristic))
{
var action = characteristicAction[characteristic];
if (action != null)
action (deviceAddress, characteristic, bytes);
}
}
}
}
}
public void OnPeripheralData (string characteristic, string base64Data)
{
if (base64Data != null)
{
byte[] bytes = System.Convert.FromBase64String (base64Data);
if (bytes.Length > 0)
{
BluetoothLEHardwareInterface.Log ("Peripheral Received: " + characteristic);
string byteString = "";
foreach (byte b in bytes)
byteString += string.Format ("{0:X2}", b);
BluetoothLEHardwareInterface.Log (byteString);
if (PeripheralReceivedWriteDataAction != null)
PeripheralReceivedWriteDataAction (characteristic, bytes);
}
}
}
#if UNITY_IOS
private void IncludeCoreLocationFramework()
{
// this method is here because Unity now only includes CoreLocation
// if there are methods in the .cs code that access it
Input.location.Stop ();
}
#endif
}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b188ba3ac565e48f58fc50dd5db4818d
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b8496a9b1a1df40af9ada2311d1d6d09
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
+43
View File
@@ -0,0 +1,43 @@
fileFormatVersion: 2
guid: 5383f7d08256547f6b36ee834b840062
folderAsset: yes
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
- first:
Standalone: OSXIntel
second:
enabled: 1
settings: {}
- first:
Standalone: OSXIntel64
second:
enabled: 1
settings: {}
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5786aec61946927418871e60a0bc7c63
guid: 34c7c97d38c834839be439bcf96a0267
folderAsset: yes
DefaultImporter:
externalObjects: {}
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>19F101</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>BluetoothLEOSX</string>
<key>CFBundleIdentifier</key>
<string>com.shatalmic.BluetoothLEOSX</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>BluetoothLEOSX</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>11E608c</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>19E258</string>
<key>DTSDKName</key>
<string>macosx10.15</string>
<key>DTXcode</key>
<string>1150</string>
<key>DTXcodeBuild</key>
<string>11E608c</string>
<key>LSMinimumSystemVersion</key>
<string>10.11</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 Shatalmic. All rights reserved.</string>
</dict>
</plist>
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8e7811284d1734fc2ba4b29fccd3ccf7
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4e9d68945c9234df3b7855f4e1006f0f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1a83baeb98e0141f587d978b89ecd37d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 673293518de2c4fbf913749ebdb36dd1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict/>
<key>files2</key>
<dict/>
<key>rules</key>
<dict>
<key>^Resources/</key>
<true/>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^.*</key>
<true/>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^[^/]+$</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2b362acd4e35f4bb380341cd3df2b9c0
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
Binary file not shown.
+27
View File
@@ -0,0 +1,27 @@
fileFormatVersion: 2
guid: cfc0710c09383b54f8aa661624975c47
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
+5
View File
@@ -0,0 +1,5 @@
fileFormatVersion: 2
guid: 8d3303514acc04853a1fbd8393630e00
folderAsset: yes
DefaultImporter:
userData:
+7
View File
@@ -0,0 +1,7 @@
//import 引用头文件 相当于Using
#import<QuartzCore/CADisplayLink.h>
//声明一个IOSCameraController类 继承自UIViewController <>里面是是协议/代理的调用声明 可以理解为c#的接口
@interface IOSCameraController : UIViewController<UIImagePickerControllerDelegate,UINavigationControllerDelegate>{
@public NSString * pageName;
}
@end
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: a11b3afe071c6854388ea27186ccaf4f
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
iPhone: iOS
second:
enabled: 1
settings:
AddToEmbeddedBinaries: false
userData:
assetBundleName:
assetBundleVariant:
+175
View File
@@ -0,0 +1,175 @@
#import "IOSCameraController.h"
@implementation IOSCameraController
-(void)OpenTarget:(UIImagePickerControllerSourceType)type{
//创建UIImagePickerController实例
UIImagePickerController *picker;
picker= [[UIImagePickerController alloc]init];
//设置代理
picker.delegate = self;
//是否允许编辑 (默认为NO)
picker.allowsEditing = YES;
//设置照片的来源
// UIImagePickerControllerSourceTypePhotoLibrary, // 来自图库
// UIImagePickerControllerSourceTypeCamera, // 来自相机
// UIImagePickerControllerSourceTypeSavedPhotosAlbum // 来自相册
picker.sourceType = type;
//这里需要判断设备是iphone还是ipad 如果使用的是iphone并没有问题 但是如果 是在ipad上调用相册获取图片 会出现没有确定(选择)的按钮 所以这里判断
//了一下设备,针对ipad 使用另一种方法 但是这种方法是弹出一个界面 并不是覆盖整个界面 需要改进 试过另一种方式 重写一个相册界面
//(QQ的ipad选择头像的界面 就使用了这种方式 但是这里我们先不讲 (因为我也不太懂 但是我按照简书的一位老哥的文章写出来了 这里放一下这个简书的链接
//https://www.tlbyxzcx.com)
if (picker.sourceType == UIImagePickerControllerSourceTypePhotoLibrary &&[[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
// 设置弹出的控制器的显示样式
picker.modalPresentationStyle = UIModalPresentationPopover;
//获取这个弹出控制器
UIPopoverPresentationController *popover = picker.popoverPresentationController;
//设置代理
popover.delegate = self;
//下面两个属性设置弹出位置
popover.sourceRect = CGRectMake(0, 0, 0, 0);
popover.sourceView = self.view;
//设置箭头的位置
popover.permittedArrowDirections = UIPopoverArrowDirectionAny;
//展示选取照片控制器
[self presentViewController:picker animated:YES completion:nil];
} else {
//展示选取照片控制器
[self presentViewController:picker animated:YES completion:^{}];
}
}
//选择完成,点击界面中的某个图片或者选择(Choose)按钮时触发
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info{
//关闭界面
[picker dismissViewControllerAnimated:YES completion:^{}];
//得到照片
UIImage *image = [info objectForKey:@"UIImagePickerControllerEditedImage"];
if (image == nil) {
image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
}
//有些时候我们拍照后经常发现导出的照片方向会有问题,要么横着,要么颠倒着,需要旋转才适合观看。但是在ios设备上是正常的
//所以在这里处理了图片 让他旋转成我们需要的
if (image.imageOrientation != UIImageOrientationUp) {
//图片旋转
image = [self fixOrientation:image];
}
//获取保存图片的地址
NSString *imagePath = [self GetSavePath:@"Temp.jpg"];
//保存图片到沙盒路径 对应unity中的Application.persistentDataPath 之后我们取图片就需要在这个路径下取 这是一个可读可写的路径
[self SaveFileToDoc:image path:imagePath];
}
//获取保存文件的路径 如果有返回路径 没有创建一个返回
-(NSString*)GetSavePath:(NSString *)filename{
NSArray *pathArray = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docPath = [pathArray objectAtIndex:0];
return [docPath stringByAppendingPathComponent:filename];
}
//将图片保存到沙盒路径
-(void)SaveFileToDoc:(UIImage *)image path:(NSString *)path{
NSData *data;
if (UIImagePNGRepresentation(image)==nil) {
data = UIImageJPEGRepresentation(image, 1);
}else{
data = UIImagePNGRepresentation(image);
}
[data writeToFile:path atomically:YES];
//保存之后通知unity 执行对应的回调
//UnitySendMessage 是用来给unity发消息的 有三个参数 1.挂载对应回调脚本的物体名 2.回调函数的名称 3.对应回调上的参数
UnitySendMessage(pageName.UTF8String, "OnMobileImageSelect", [NSString stringWithFormat:@"true,%@",path ].UTF8String);
}
#pragma mark 图片处理方法
//图片旋转处理
- (UIImage *)fixOrientation:(UIImage *)aImage {
CGAffineTransform transform = CGAffineTransformIdentity;
switch (aImage.imageOrientation) {
case UIImageOrientationDown:
case UIImageOrientationDownMirrored:
transform = CGAffineTransformTranslate(transform, aImage.size.width, aImage.size.height);
transform = CGAffineTransformRotate(transform, M_PI);
break;
case UIImageOrientationLeft:
case UIImageOrientationLeftMirrored:
transform = CGAffineTransformTranslate(transform, aImage.size.width, 0);
transform = CGAffineTransformRotate(transform, M_PI_2);
break;
case UIImageOrientationRight:
case UIImageOrientationRightMirrored:
transform = CGAffineTransformTranslate(transform, 0, aImage.size.height);
transform = CGAffineTransformRotate(transform, -M_PI_2);
break;
default:
break;
}
switch (aImage.imageOrientation) {
case UIImageOrientationUpMirrored:
case UIImageOrientationDownMirrored:
transform = CGAffineTransformTranslate(transform, aImage.size.width, 0);
transform = CGAffineTransformScale(transform, -1, 1);
break;
case UIImageOrientationLeftMirrored:
case UIImageOrientationRightMirrored:
transform = CGAffineTransformTranslate(transform, aImage.size.height, 0);
transform = CGAffineTransformScale(transform, -1, 1);
break;
default:
break;
}
// Now we draw the underlying CGImage into a new context, applying the transform
// calculated above.
CGContextRef ctx = CGBitmapContextCreate(NULL, aImage.size.width, aImage.size.height,
CGImageGetBitsPerComponent(aImage.CGImage), 0,
CGImageGetColorSpace(aImage.CGImage),
CGImageGetBitmapInfo(aImage.CGImage));
CGContextConcatCTM(ctx, transform);
switch (aImage.imageOrientation) {
case UIImageOrientationLeft:
case UIImageOrientationLeftMirrored:
case UIImageOrientationRight:
case UIImageOrientationRightMirrored:
// Grr...
CGContextDrawImage(ctx, CGRectMake(0,0,aImage.size.height,aImage.size.width), aImage.CGImage);
break;
default:
CGContextDrawImage(ctx, CGRectMake(0,0,aImage.size.width,aImage.size.height), aImage.CGImage);
break;
}
// And now we just create a new UIImage from the drawing context
CGImageRef cgimg = CGBitmapContextCreateImage(ctx);
UIImage *img = [UIImage imageWithCGImage:cgimg];
CGContextRelease(ctx);
CGImageRelease(cgimg);
return img;
}
@end
//由于C++编译器需要支持函数的重载,会改变函数的名称,因此dll的导出函数通常是标准C定义的。
//这就使得C和C++的互相调用变得很常见。但是有时可能又会直接用C来调用,不想重新写代码,
//让标准C编写的dll函数定义在C和C++编译器下都能编译通过,通常会使用以下的格式:(这个格式在很多成熟的代码中很常见)
#if defined(__cplusplus)
extern "C" {
#endif
//导出接口供unity使用
void IOS_OpenCamera(const char * pageName){
IOSCameraController *app = [[IOSCameraController alloc]init];
app->pageName = [NSString stringWithUTF8String:pageName];
UIViewController *vc = UnityGetGLViewController();
[vc.view addSubview:app.view];
[app OpenTarget:UIImagePickerControllerSourceTypeCamera];
}
void IOS_OpenAlbum(const char * pageName){
IOSCameraController *app = [[IOSCameraController alloc]init];
app->pageName = [NSString stringWithUTF8String:pageName];
UIViewController *vc = UnityGetGLViewController();
[vc.view addSubview:app.view];
[app OpenTarget:UIImagePickerControllerSourceTypePhotoLibrary];
}
#if defined(__cplusplus)
}
#endif
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: abaf756c4b6577148bdfc4e32d4e7a8e
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
iPhone: iOS
second:
enabled: 1
settings:
AddToEmbeddedBinaries: false
userData:
assetBundleName:
assetBundleVariant:
+69
View File
@@ -0,0 +1,69 @@
//
// IOSWechatController.m
// Unity-iPhone
//
// Created by Jooki Tsui on 2020/11/13.
//
#import "WXApi.h"
#import "UnityAppController.h"
#import <Foundation/Foundation.h>
extern void UnitySendMessage(const char *,const char *,const char *);
@interface IOSWechatController : UnityAppController<WXApiDelegate>
@end
IMPL_APP_CONTROLLER_SUBCLASS (IOSWechatController)
@implementation IOSWechatController
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity
#if defined(__IPHONE_12_0) || defined(__TVOS_12_0)
restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring> > * _Nullable restorableObjects))restorationHandler
#else
restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler
#endif
{
return [WXApi handleOpenUniversalLink:userActivity delegate:self];
}
- (BOOL)application:(UIApplication*)application openURL:(NSURL*)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
return [WXApi handleOpenURL:url delegate:self];
}
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
return [WXApi handleOpenURL:url delegate:self];
}
- (void)onResp:(BaseResp *)resp
{
NSLog(@"47");
if([resp isKindOfClass:[SendAuthResp class]])
{
SendAuthResp *temp = (SendAuthResp*)resp;
int errorCode = temp.errCode;
switch (errorCode) {
case 0:
UnitySendMessage("LoginPanel", "OnMobileWxLoginResp",[NSString stringWithFormat:@"true;%@",temp.code ].UTF8String);
break;
case -2:
UnitySendMessage("LoginPanel", "OnMobileWxLoginResp", "false;User deauthorisation");
break;
case -4:
UnitySendMessage("LoginPanel", "OnMobileWxLoginResp", "false;User refusal of authorisation");
break;
default:
UnitySendMessage("LoginPanel", "OnMobileWxLoginResp", "false;Login failed");
break;
}
}
}
- (void)onReq:(BaseReq *)req
{
// do something
}
@end
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 0cbd70da63d86a34ab0eca9767c1289b
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
iPhone: iOS
second:
enabled: 1
settings:
AddToEmbeddedBinaries: false
userData:
assetBundleName:
assetBundleVariant:
+107
View File
@@ -0,0 +1,107 @@
//
// UnityBluetoothLE.h
// Unity-iPhone
//
// Created by Tony Pitman on 03/05/2014.
//
//
#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
#if !TARGET_OS_TV
#import <CoreLocation/CoreLocation.h>
@interface UnityBluetoothLE : NSObject <CBCentralManagerDelegate, CBPeripheralManagerDelegate, CBPeripheralDelegate, CLLocationManagerDelegate>
#else
@interface UnityBluetoothLE : NSObject <CBCentralManagerDelegate, CBPeripheralManagerDelegate, CBPeripheralDelegate>
#endif
{
CBCentralManager *_centralManager;
#if !TARGET_OS_TV
CLLocationManager *_locationManager;
#endif
NSMutableDictionary *_peripherals;
#if !TARGET_OS_TV
CBPeripheralManager *_peripheralManager;
NSString *_peripheralName;
NSMutableDictionary *_services;
NSMutableDictionary *_characteristics;
#endif
NSMutableArray *_backgroundMessages;
BOOL _isPaused;
BOOL _alreadyNotified;
BOOL _isInitializing;
BOOL _rssiOnly;
int _recordType;
long _mtu;
unsigned char *_writeCharacteristicBytes;
long _writeCharacteristicLength;
long _writeCharacteristicPosition;
long _writeCharacteristicBytesToWrite;
CBCharacteristicWriteType _writeCharacteristicWithResponse;
int _writeCharacteristicRetries;
}
@property (atomic, strong) NSMutableDictionary *_peripherals;
@property (atomic) BOOL _rssiOnly;
- (void)initialize:(BOOL)asCentral asPeripheral:(BOOL)asPeripheral;
- (void)deInitialize;
- (void)scanForPeripheralsWithServices:(NSArray *)serviceUUIDs options:(NSDictionary *)options clearPeripheralList:(BOOL)clearPeripheralList recordType:(int)recordType;
- (void)stopScan;
- (void)retrieveListOfPeripheralsWithServices:(NSArray *)serviceUUIDs;
- (void)connectToPeripheral:(NSString *)name;
- (void)disconnectPeripheral:(NSString *)name;
- (CBCharacteristic *)getCharacteristic:(NSString *)name service:(NSString *)serviceString characteristic:(NSString *)characteristicString;
- (void)readCharacteristic:(NSString *)name service:(NSString *)serviceString characteristic:(NSString *)characteristicString;
- (void)writeCharacteristic:(NSString *)name service:(NSString *)serviceString characteristic:(NSString *)characteristicString data:(NSData *)data withResponse:(BOOL)withResponse;
- (void)subscribeCharacteristic:(NSString *)name service:(NSString *)serviceString characteristic:(NSString *)characteristicString;
- (void)unsubscribeCharacteristic:(NSString *)name service:(NSString *)serviceString characteristic:(NSString *)characteristicString;
- (void)writeCharactersticBytesReset;
- (void)writeCharactersticBytes:(CBPeripheral *)peripheral characteristic:(CBCharacteristic *)characteristic data:(NSData *)data withResponse:(CBCharacteristicWriteType)withResponse;
- (void)writeNextPacket:(CBPeripheral *)peripheral characteristic:(CBCharacteristic *)characteristic;
#if !TARGET_OS_TV
- (void)requestMtu:(NSString *)name mtu:(int)mtu;
- (void)scanForBeacons:(NSArray<CLBeaconRegion *> *)beaconRegions;
- (void)stopBeaconScan;
- (void)peripheralName:(NSString *)newName;
- (void)createService:(NSString *)uuid primary:(BOOL)primary;
- (void)removeService:(NSString *)uuid;
- (void)removeServices;
- (void)createCharacteristic:(NSString *)uuid properties:(CBCharacteristicProperties)properties permissions:(CBAttributePermissions)permissions value:(NSData *)value;
- (void)removeCharacteristic:(NSString *)uuid;
- (void)removeCharacteristics;
- (void)startAdvertising;
- (void)stopAdvertising;
- (void)updateCharacteristicValue:(NSString *)uuid value:(NSData *)value;
#endif
- (void)pauseMessages:(BOOL)isPaused;
- (void)sendUnityMessage:(BOOL)isString message:(NSString *)message;
+ (NSString *) base64StringFromData:(NSData *)data length:(int)length;
@end
@interface UnityMessage : NSObject
{
BOOL _isString;
NSString *_message;
}
- (void)initialize:(BOOL)isString message:(NSString *)message;
- (void)deInitialize;
- (void)sendUnityMessage;
@end
@@ -0,0 +1,95 @@
fileFormatVersion: 2
guid: 89fad22a839074ac08f9f7ffc9dbce4e
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
: OSXIntel
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
: OSXIntel64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Android: Android
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
iPhone: iOS
second:
enabled: 1
settings:
CompileFlags:
FrameworkDependencies:
- first:
tvOS: tvOS
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large. Load diff
+124
View File
@@ -0,0 +1,124 @@
fileFormatVersion: 2
guid: 6a40ca1fe2b7a48e5b257178dfdca41e
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 1
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
Exclude iOS: 0
- first:
: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
: OSXIntel
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
: OSXIntel64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
iPhone: iOS
second:
enabled: 1
settings:
AddToEmbeddedBinaries: false
CompileFlags: -fno-objc-arc
FrameworkDependencies: CoreBluetooth;
- first:
tvOS: tvOS
second:
enabled: 1
settings:
CompileFlags: -fno-objc-arc
FrameworkDependencies: CoreBluetooth;
userData:
assetBundleName:
assetBundleVariant:
+205
View File
@@ -0,0 +1,205 @@
//
// WXApi.h
// 所有Api接口
//
// Created by Wechat on 12-2-28.
// Copyright (c) 2012年 Tencent. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "WXApiObject.h"
NS_ASSUME_NONNULL_BEGIN
#pragma mark - WXApiDelegate
/*! @brief 接收并处理来自微信终端程序的事件消息
*
* 接收并处理来自微信终端程序的事件消息,期间微信界面会切换到第三方应用程序。
* WXApiDelegate 会在handleOpenURL:delegate:中使用并触发。
*/
@protocol WXApiDelegate <NSObject>
@optional
/*! @brief 收到一个来自微信的请求,第三方应用程序处理完后调用sendResp向微信发送结果
*
* 收到一个来自微信的请求,异步处理完成后必须调用sendResp发送处理结果给微信。
* 可能收到的请求有GetMessageFromWXReq、ShowMessageFromWXReq等。
* @param req 具体请求内容,是自动释放的
*/
- (void)onReq:(BaseReq*)req;
/*! @brief 发送一个sendReq后,收到微信的回应
*
* 收到一个来自微信的处理结果。调用一次sendReq后会收到onResp。
* 可能收到的处理结果有SendMessageToWXResp、SendAuthResp等。
* @param resp具体的回应内容,是自动释放的
*/
- (void)onResp:(BaseResp*)resp;
@end
#pragma mark - WXApiLogDelegate
@protocol WXApiLogDelegate <NSObject>
- (void)onLog:(NSString*)log logLevel:(WXLogLevel)level;
@end
#pragma mark - WXApi
/*! @brief 微信Api接口函数类
*
* 该类封装了微信终端SDK的所有接口
*/
@interface WXApi : NSObject
/*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。
*
* 需要在每次启动第三方应用程序时调用。
* @attention 请保证在主线程中调用此函数
* @param appid 微信开发者ID
* @param universalLink 微信开发者Universal Link
* @return 成功返回YES,失败返回NO。
*/
+ (BOOL)registerApp:(NSString *)appid universalLink:(NSString *)universalLink;
/*! @brief 处理旧版微信通过URL启动App时传递的数据
*
* 需要在 application:openURL:sourceApplication:annotation:或者application:handleOpenURL中调用。
* @param url 微信启动第三方应用时传递过来的URL
* @param delegate WXApiDelegate对象,用来接收微信触发的消息。
* @return 成功返回YES,失败返回NO。
*/
+ (BOOL)handleOpenURL:(NSURL *)url delegate:(nullable id<WXApiDelegate>)delegate;
/*! @brief 处理微信通过Universal Link启动App时传递的数据
*
* 需要在 application:continueUserActivity:restorationHandler:中调用。
* @param userActivity 微信启动第三方应用时系统API传递过来的userActivity
* @param delegate WXApiDelegate对象,用来接收微信触发的消息。
* @return 成功返回YES,失败返回NO。
*/
+ (BOOL)handleOpenUniversalLink:(NSUserActivity *)userActivity delegate:(nullable id<WXApiDelegate>)delegate;
/*! @brief 检查微信是否已被用户安装
*
* @return 微信已安装返回YES,未安装返回NO。
*/
+ (BOOL)isWXAppInstalled;
/*! @brief 判断当前微信的版本是否支持OpenApi
*
* @return 支持返回YES,不支持返回NO。
*/
+ (BOOL)isWXAppSupportApi;
/*! @brief 判断当前微信的版本是否支持分享微信状态功能
*
* @attention 需在工程LSApplicationQueriesSchemes配置中添加weixinStateAPI
* @return 支持返回YES,不支持返回NO。
*/
+ (BOOL)isWXAppSupportStateAPI;
/*! @brief 获取微信的itunes安装地址
*
* @return 微信的安装地址字符串。
*/
+ (NSString *)getWXAppInstallUrl;
/*! @brief 获取当前微信SDK的版本号
*
* @return 返回当前微信SDK的版本号
*/
+ (NSString *)getApiVersion;
/*! @brief 打开微信
*
* @return 成功返回YES,失败返回NO。
*/
+ (BOOL)openWXApp;
/*! @brief 发送请求到微信,等待微信返回onResp
*
* 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持以下类型
* SendAuthReq、SendMessageToWXReq、PayReq等。
* @param req 具体的发送请求。
* @param completion 调用结果回调block
*/
+ (void)sendReq:(BaseReq *)req completion:(void (^ __nullable)(BOOL success))completion;
/*! @brief 收到微信onReq的请求,发送对应的应答给微信,并切换到微信界面
*
* 函数调用后,会切换到微信的界面。第三方应用程序收到微信onReq的请求,异步处理该请求,完成后必须调用该函数。可能发送的相应有
* GetMessageFromWXResp、ShowMessageFromWXResp等。
* @param resp 具体的应答内容
* @param completion 调用结果回调block
*/
+ (void)sendResp:(BaseResp*)resp completion:(void (^ __nullable)(BOOL success))completion;
/*! @brief 发送Auth请求到微信,支持用户没安装微信,等待微信返回onResp
*
* 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持SendAuthReq类型。
* @param req 具体的发送请求。
* @param viewController 当前界面对象。
* @param delegate WXApiDelegate对象,用来接收微信触发的消息。
* @param completion 调用结果回调block
*/
+ (void)sendAuthReq:(SendAuthReq *)req viewController:(UIViewController*)viewController delegate:(nullable id<WXApiDelegate>)delegate completion:(void (^ __nullable)(BOOL success))completion;
/*! @brief 测试函数,用于排查当前App通过Universal Link方式分享到微信的流程
注意1: 调用自检函数之前必须要先调用registerApp:universalLink接口, 并确认调用成功
注意2: 自检过程中会有Log产生,可以先调用startLogByLevel函数,根据Log排查问题
注意3: 会多次回调block
注意4: 仅用于新接入SDK时调试使用,请勿在正式环境的调用
*
* 当completion回调的step为WXULCheckStepFinal时,表示检测通过,Universal Link接入成功
* @param completion 回调Block
*/
+ (void)checkUniversalLinkReady:(nonnull WXCheckULCompletion)completion;
/*! @brief WXApi的成员函数,接受微信的log信息。byBlock
注意1:SDK会强引用这个block,注意不要导致内存泄漏,注意不要导致内存泄漏
注意2:调用过一次startLog by block之后,如果再调用一次任意方式的startLoad,会释放上一次logBlock,不再回调上一个logBlock
*
* @param level 打印log的级别
* @param logBlock 打印log的回调block
*/
+ (void)startLogByLevel:(WXLogLevel)level logBlock:(WXLogBolock)logBlock;
/*! @brief WXApi的成员函数,接受微信的log信息。byDelegate
注意1:sdk会弱引用这个delegate,这里可加任意对象为代理,不需要与WXApiDelegate同一个对象
注意2:调用过一次startLog by delegate之后,再调用一次任意方式的startLoad,不会再回调上一个logDelegate对象
* @param level 打印log的级别
* @param logDelegate 打印log的回调代理,
*/
+ (void)startLogByLevel:(WXLogLevel)level logDelegate:(id<WXApiLogDelegate>)logDelegate;
/*! @brief 停止打印log,会清理block或者delegate为空,释放block
* @param
*/
+ (void)stopLog;
@end
NS_ASSUME_NONNULL_END
+33
View File
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 2ab0aef16a26f5644b74f28801dcf547
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
iPhone: iOS
second:
enabled: 1
settings:
AddToEmbeddedBinaries: false
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large. Load diff
+33
View File
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 6e517efafdbb3fd47aa83f1733cf045e
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
iPhone: iOS
second:
enabled: 1
settings:
AddToEmbeddedBinaries: false
userData:
assetBundleName:
assetBundleVariant:
+68
View File
@@ -0,0 +1,68 @@
//
// WechatAuthSDK.h
// WechatAuthSDK
//
// Created by 李凯 on 13-11-29.
// Copyright (c) 2013年 Tencent. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
enum AuthErrCode {
WechatAuth_Err_Ok = 0, //Auth成功
WechatAuth_Err_NormalErr = -1, //普通错误
WechatAuth_Err_NetworkErr = -2, //网络错误
WechatAuth_Err_GetQrcodeFailed = -3, //获取二维码失败
WechatAuth_Err_Cancel = -4, //用户取消授权
WechatAuth_Err_Timeout = -5, //超时
};
@protocol WechatAuthAPIDelegate<NSObject>
@optional
- (void)onAuthGotQrcode:(UIImage *)image; //得到二维码
- (void)onQrcodeScanned; //二维码被扫描
- (void)onAuthFinish:(int)errCode AuthCode:(nullable NSString *)authCode; //成功登录
@end
@interface WechatAuthSDK : NSObject{
NSString *_sdkVersion;
__weak id<WechatAuthAPIDelegate> _delegate;
}
@property(nonatomic, weak, nullable) id<WechatAuthAPIDelegate> delegate;
@property(nonatomic, readonly) NSString *sdkVersion; //authSDK版本号
/*! @brief 发送登录请求,等待WechatAuthAPIDelegate回调
*
* @param appId 微信开发者ID
* @param nonceStr 一个随机的尽量不重复的字符串,用来使得每次的signature不同
* @param timeStamp 时间戳
* @param scope 应用授权作用域,拥有多个作用域用逗号(,)分隔
* @param signature 签名
* @param schemeData 会在扫码后拼在scheme后
* @return 成功返回YES,失败返回NO
注:该实现只保证同时只有一个Auth在运行,Auth未完成或未Stop再次调用Auth接口时会返回NO。
*/
- (BOOL)Auth:(NSString *)appId
nonceStr:(NSString *)nonceStr
timeStamp:(NSString *)timeStamp
scope:(NSString *)scope
signature:(NSString *)signature
schemeData:(nullable NSString *)schemeData;
/*! @brief 暂停登录请求
*
* @return 成功返回YES,失败返回NO。
*/
- (BOOL)StopAuth;
@end
NS_ASSUME_NONNULL_END
+33
View File
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 5af5dbc4f818a804ebbedc9a933cd573
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
iPhone: iOS
second:
enabled: 1
settings:
AddToEmbeddedBinaries: false
userData:
assetBundleName:
assetBundleVariant:
+111
View File
@@ -0,0 +1,111 @@
//
// NativeBridge.m
// Unity-iPhone
//
#import <Foundation/Foundation.h>
#import "WXApi.h"
//这是向微信终端注册你的appid
void RegisterApp(const char* appid)
{
NSString *weichatId = [NSString stringWithFormat:@"%s", appid];
BOOL installed = [WXApi isWXAppInstalled];
NSLog(@"installed result: %@", installed?@"true":@"false");
BOOL result = [WXApi registerApp:weichatId universalLink:(@"https://wx.powerfun.com.cn/pf2/")];
NSLog(@"result: %@", result?@"true":@"false");
}
// 调起小程序
void LaunchMiniProgram(const char* miniProgramID, const char* path){
WXLaunchMiniProgramReq *launchMiniProgramReq = [WXLaunchMiniProgramReq object];
launchMiniProgramReq.userName = [NSString stringWithUTF8String:miniProgramID]; //拉起的小程序的username
launchMiniProgramReq.path = [NSString stringWithUTF8String:path]; ////拉起小程序页面的可带参路径,不填默认拉起小程序首页,对于小游戏,可以只传入 query 部分,来实现传参效果,如:传入 "?foo=bar"。
launchMiniProgramReq.miniProgramType = WXMiniProgramTypeRelease; //拉起小程序的类型
[WXApi sendReq:launchMiniProgramReq completion:^(BOOL success) {}];
}
// 分享图片至微信
void ShareImgToWX(int scene, UInt8 *msgByteArrayData, int arrayLength, const char* title, const char* description){
WXImageObject *imageObject = [WXImageObject object];
imageObject.imageData = [[NSData alloc] initWithBytes:msgByteArrayData length:arrayLength];
WXMediaMessage *message = [WXMediaMessage message];
message.title = [NSString stringWithUTF8String:title];
message.description = [NSString stringWithUTF8String:description];
// 用APP的Icon做缩略图
NSDictionary *infoPlist = [[NSBundle mainBundle] infoDictionary];
NSString *icon = [[infoPlist valueForKeyPath:@"CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconFiles"] lastObject];
[message setThumbImage:[UIImage imageNamed:icon]];
message.mediaObject = imageObject;
SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init];
req.bText = NO;
req.message = message;
req.scene = scene;
[WXApi sendReq:req completion:nil];
}
// 分享链接至微信
void ShareUrlToWX(int scene, const char* url, const char* title, const char* description){
WXWebpageObject *webpageObject = [WXWebpageObject object];
webpageObject.webpageUrl = [NSString stringWithUTF8String:url];
WXMediaMessage *message = [WXMediaMessage message];
message.title = [NSString stringWithUTF8String:title];
message.description = [NSString stringWithUTF8String:description];
// 用APP的Icon做缩略图
NSDictionary *infoPlist = [[NSBundle mainBundle] infoDictionary];
NSString *icon = [[infoPlist valueForKeyPath:@"CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconFiles"] lastObject];
[message setThumbImage:[UIImage imageNamed:icon]];
message.mediaObject = webpageObject;
SendMessageToWXReq *req = [[SendMessageToWXReq alloc] init];
req.bText = NO;
req.message = message;
req.scene = scene;
[WXApi sendReq:req completion:nil];
}
//判断是否安装微信
bool IsWechatInstalled_iOS()
{
return [WXApi isWXAppInstalled];
}
//微信登录
void WechatLogin(const char* scope,const char* state)
{
//登录
SendAuthReq* req = [[SendAuthReq alloc] init];
req.scope = [NSString stringWithUTF8String:scope];
req.state = [NSString stringWithUTF8String:state];
[WXApi sendReq:req completion:nil];
}
//打开微信(注意:需要先注册appid)
void OpenWXApp()
{
[WXApi openWXApp];
}
bool checkAPPIsExist(const char * URLScheme)
{
NSURL* url;
NSString * urls = [NSString stringWithUTF8String:URLScheme];
if ([urls containsString:@"://"])
{
url = [NSURL URLWithString:[NSString stringWithFormat:@"%@",urls]];
}
else
{
url = [NSURL URLWithString:[NSString stringWithFormat:@"%@://",urls]];
}
if([[UIApplication sharedApplication] canOpenURL:url])
{
return YES;
}
else
{
return NO;
}
}
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: 9ba744e6ebf3c3048baab0a17ad58af0
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
iPhone: iOS
second:
enabled: 1
settings:
AddToEmbeddedBinaries: false
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.
+80
View File
@@ -0,0 +1,80 @@
fileFormatVersion: 2
guid: 5fd23b9d6d5286d4fba4c1e792198a28
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
Exclude iOS: 0
- first:
Android: Android
second:
enabled: 0
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: x86_64
- first:
iPhone: iOS
second:
enabled: 1
settings:
AddToEmbeddedBinaries: false
CPU: AnyCPU
CompileFlags:
FrameworkDependencies: Security;WebKit;
userData:
assetBundleName:
assetBundleVariant:
@@ -65,7 +65,7 @@ public class ImageWithIndependentRoundedCorners : MonoBehaviour {
rect2props.y = origin.y;
}
private void Refresh(){
public void Refresh(){
if (material == null)
{
material = Instantiate(Resources.Load<Material>("UI/Material/IndependentCornersMaterial"));
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f71381890422d934694a45aeabea2f98
guid: 05133d14d67abd743954cf1d04471e99
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 9ec69ed9fb1e5cf49a927dfd46451979
guid: 4990d472dee7f3b428ae030c3a2b936f
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4a45086f0adfd5a4a9c2a60543866ea4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 B

@@ -0,0 +1,128 @@
fileFormatVersion: 2
guid: 2271888c26d8e3b4a9693e7297d74764
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,128 @@
fileFormatVersion: 2
guid: b506553c2e5ef6141975163f7c2fdffc
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 954 B

@@ -0,0 +1,128 @@
fileFormatVersion: 2
guid: a38e5e467140caa4d9bd38fd08291bf7
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,128 @@
fileFormatVersion: 2
guid: 79e2c0a32a9a14b47a41c3bd71e356bd
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
Loaded 100 of 1444 files, more files were not shown because too many files have changed in this diff. Show more