安装 Newtonsoft-json
com.unity.nuget.newtonsoft-json
创建 GameSaveData
创建 ISaveable
创建 SaveLoadManager
修改 ISaveable
创建 DataGUID
修改 ISaveable
给 Player 绑定 GUID
运行,然后停止,然后再运行,这时 GUID 就一直存在了
修改 Player 脚本
给所有 Manager 都添加 ISaveable 接口和 GUID
Inventory Manager
Item Manager
Time Manager
注意,gameSeason 写错成 gameSecond 了
GridMap Manager
添加 GUID 组件
Transition Manager
下节课再写
每个 NPC
下节课再写
项目相关代码
代码仓库:https://gitee.com/nbda1121440/farm-tutorial.git
标签:02,存储,框架,ISaveable,创建,json,Manager,GUID From: https://www.cnblogs.com/hellozjf/p/18143653