diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 98a552f..50258c2 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -8,6 +8,11 @@ + + + + + diff --git a/笔记文件/2.笔记/File.Copy.md b/笔记文件/2.笔记/File.Copy.md new file mode 100644 index 0000000..4612722 --- /dev/null +++ b/笔记文件/2.笔记/File.Copy.md @@ -0,0 +1,27 @@ +#unity/日常积累 + +这个接口,只会拷贝文件内容,不会修改文件名,例如数据库缓存,可以使用它,把备份数据库,替换正常的数据库文件,逻辑参考: + +``` cs + /// + /// 从备份数据库中,恢复数据库 + /// + /// + /// + /// + private bool BackupDB(string backupPath,string dbPath) + { + if (File.Exists(backupPath)) + { + File.Copy(backupPath,dbPath,true); + Debug.Log("已从备份恢复数据库"); + return true; + } + else + { + File.Delete(dbPath); + Debug.LogError("无备份可用,已删除 损坏数据库"); + return false; + } + } +``` \ No newline at end of file diff --git a/笔记文件/2.笔记/xcode依赖处理 打包后处理通过podfile添加第三方库.md b/笔记文件/2.笔记/xcode依赖处理 打包后处理通过podfile添加第三方库 PostProcessBuildClass.md similarity index 100% rename from 笔记文件/2.笔记/xcode依赖处理 打包后处理通过podfile添加第三方库.md rename to 笔记文件/2.笔记/xcode依赖处理 打包后处理通过podfile添加第三方库 PostProcessBuildClass.md diff --git a/笔记文件/2.笔记/安卓和ios读写文件权限.md b/笔记文件/2.笔记/安卓和ios读写文件权限.md new file mode 100644 index 0000000..6eee4c3 --- /dev/null +++ b/笔记文件/2.笔记/安卓和ios读写文件权限.md @@ -0,0 +1,56 @@ +#安卓 +#ios +#unity/日常积累 + +如果是私有目录,例如要操作,unity对应,数据持久化路径,参考[[【Unity】数据持久化路径Application.persistentDataPath]],是不需要,额外的权限申请; +如果需要读写,公共目录,例如相册相关等路径,就需要额外申请,对应的权限 +安卓的: +``` xml + + + + + +``` + +如果没有权限,也可以尝试,通过代码,动态获取一下 + +``` java +if (!Permission.HasUserAuthorizedPermission(Permission.ExternalStorageWrite)) +{ + Permission.RequestUserPermission(Permission.ExternalStorageWrite); + // 需要处理异步授权结果 +} +``` + +如果是ios的话,例如,如果要申请公共相册,相关的权限,就需要在Info.plist里面添加 + +``` xml + +NSPhotoLibraryUsageDescription +需要访问相册来保存文件 +``` + +unity后处理,参考[[xcode依赖处理 打包后处理通过podfile添加第三方库 PostProcessBuildClass]] + +``` cs + /// + /// 添加广告追踪权限 + /// + /// + private static void AddInfoByTracking(string path) + { + string plistPath = Path.Combine(path, "Info.plist"); + PlistDocument plist = new PlistDocument(); + plist.ReadFromFile(plistPath); + PlistElementDict rootDict = plist.root; + + // 添加广告追踪权限说明 + rootDict.SetString("NSUserTrackingUsageDescription", "We need your consent to track advertisements to provide better services."); + + // 添加定位服务权限说明 + rootDict.SetString("NSLocationWhenInUseUsageDescription", "We need your location to provide personalized services."); + + File.WriteAllText(plistPath, plist.WriteToString()); + } +``` \ No newline at end of file diff --git a/笔记文件/2.笔记/性能检测平台 临时记录.md b/笔记文件/2.笔记/性能检测平台 临时记录.md index f8650a9..72bf6c2 100644 --- a/笔记文件/2.笔记/性能检测平台 临时记录.md +++ b/笔记文件/2.笔记/性能检测平台 临时记录.md @@ -123,4 +123,12 @@ main函数运行到这里,就可以判断和创建数据库了 如果要还原,原本的服务器上报逻辑,参考这个注释,操作即可,一共修改3个地方 -![[Pasted image 20250418094607.png]] \ No newline at end of file +![[Pasted image 20250418094607.png]] + +跟日志上报区分一下,服务端,改成collect + +![[Pasted image 20250418151214.png]] + +客户端也同步修改一下后缀: + +![[Pasted image 20250418151248.png]] \ No newline at end of file diff --git a/笔记文件/2.笔记/查看linux发行版.md b/笔记文件/2.笔记/查看linux发行版.md new file mode 100644 index 0000000..44c2a6f --- /dev/null +++ b/笔记文件/2.笔记/查看linux发行版.md @@ -0,0 +1,15 @@ +#杂七杂八常识 + +通过以下指令,可以查看,使用linux,对应的版本,有俩可选: + +``` shell +# 查看系统信息 +cat /etc/os-release + +# 或查看发行版 +uname -a +``` + +根据对应的版本,去安装对应的package包即可 + +![[Pasted image 20250418182214.png]] \ No newline at end of file diff --git a/笔记文件/2.笔记/瀑布 新项目 临时记录.md b/笔记文件/2.笔记/瀑布 新项目 临时记录.md index df09ff4..639ab0c 100644 --- a/笔记文件/2.笔记/瀑布 新项目 临时记录.md +++ b/笔记文件/2.笔记/瀑布 新项目 临时记录.md @@ -28,4 +28,13 @@ lua逻辑入口:GameMain 核心驱动,进游戏,是这里 -![[Pasted image 20250119195959.png]] \ No newline at end of file +![[Pasted image 20250119195959.png]] + +用这几个主题 + +![[Pasted image 20250418172858.png]] + +主题所在路径: +``` +Assets\ZSlotKing\MiniGame\Themes\ +``` \ No newline at end of file diff --git a/笔记文件/日记/2025_04_17_星期四.md b/笔记文件/日记/2025_04_17_星期四.md index 5a2e41f..1a67e20 100644 --- a/笔记文件/日记/2025_04_17_星期四.md +++ b/笔记文件/日记/2025_04_17_星期四.md @@ -23,10 +23,12 @@ - [ ] 思考一下,每天的时间安排调整 - [ ] 确定一个新的slot svn分支来处理,上架相关事宜 -- [ ] 数据库文件安卓异常处理,新增db缓存 -- [ ] 记得说一下钥匙的事情 +- [x] 数据库文件安卓异常处理,新增db缓存 +- [x] 记得说一下钥匙的事情 - [x] 记得带身份证 --- [[谷歌支付 问题收集]] [[三消 删号 清除存档逻辑]] +[[安卓和ios读写文件权限]] +[[File.Copy]] # Journal diff --git a/笔记文件/日记/2025_04_18_星期五.md b/笔记文件/日记/2025_04_18_星期五.md index f56f299..17cb8e3 100644 --- a/笔记文件/日记/2025_04_18_星期五.md +++ b/笔记文件/日记/2025_04_18_星期五.md @@ -22,9 +22,11 @@ # 今日任务 - [x] 记得订周日晚酒店 -- [ ] 测试一下 注册事件缓存 -- [ ] 写一下 性能检测工具 +- [x] 测试一下 注册事件缓存 +- [x] 部署性能检测 go 服务器 到内网测试服 --- 停电通知: ![[Pasted image 20250418091238.png]] + +[[查看linux发行版]] # Journal diff --git a/笔记文件/附件/Pasted image 20250418151214.png b/笔记文件/附件/Pasted image 20250418151214.png new file mode 100644 index 0000000..53b195d Binary files /dev/null and b/笔记文件/附件/Pasted image 20250418151214.png differ diff --git a/笔记文件/附件/Pasted image 20250418151248.png b/笔记文件/附件/Pasted image 20250418151248.png new file mode 100644 index 0000000..8ae6de1 Binary files /dev/null and b/笔记文件/附件/Pasted image 20250418151248.png differ diff --git a/笔记文件/附件/Pasted image 20250418172858.png b/笔记文件/附件/Pasted image 20250418172858.png new file mode 100644 index 0000000..9840166 Binary files /dev/null and b/笔记文件/附件/Pasted image 20250418172858.png differ diff --git a/笔记文件/附件/Pasted image 20250418182214.png b/笔记文件/附件/Pasted image 20250418182214.png new file mode 100644 index 0000000..d767d10 Binary files /dev/null and b/笔记文件/附件/Pasted image 20250418182214.png differ