feat: 性格维度图接入真实初始矩阵数据 - #27
Merged
Merged
Conversation
- 宠物 prefab 绑定 PersonalityMatrixSO(Angel/Devil),初始 7 维性格有真实来源 - PersonalityEvolutionBootstrap 启动时扫描已激活宠物补种初始矩阵,修复编辑器 Play 流程 Boot 晚于宠物场景加载导致 PetControllerInitializedEvent 被错过 - PersonalityEvolutionService 存档版本迁移:忽略 v1(0 基数累计的脏数据), 由真实初始矩阵为基数重建;CaptureJson 升到 v2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目的
性格维度图(雷达图)接入真实数据。此前 radar 一直显示全 0:宠物 prefab 没绑定
PersonalityMatrixSO(初始矩阵为空),且编辑器 Play 流程里 Boot 场景晚于宠物场景加载,PetControllerInitializedEvent在服务订阅前被发布、事件被错过,GetMatrix永远返回默认值。改动
Pet_Angel→PersonalityMatrix_Angel.asset(善良 0.7 / 恶 -0.3 …),Pet_Devil→PersonalityMatrix_Devil.asset(善良 -0.2 / 恶 0.6 …)PetController.InitialPersonalityMatrix访问器:暴露 Inspector 绑定的初始矩阵PersonalityEvolutionBootstrap.SeedInitialMatricesFromActivePets:启动时FindObjectsOfType<PetController>()扫描已激活宠物,补种初始矩阵。兜底编辑器 Play 时序缺口(Boot 用 delayCall 附加加载、晚于主场景),事件被错过也能拿到真实初始值IPersonalityEvolutionService.SeedInitialMatrixIfAbsent:仅当该宠物尚无任何写入时设置,不覆盖存档恢复值;返回是否实际写入RestoreJson忽略 v1 性格存档(初始矩阵接入前、基于全 0 基数累计的脏数据,恢复会覆盖补种的真实矩阵),由真实初始矩阵重建;CaptureJson升到 v2验证
编辑器 Play 后打开性格维度面板:
[PersonalityEvolutionBootstrap] 启动补种初始性格: 2 只宠物,随后一条[PersonalityEvolutionService] 忽略旧版性格存档(v1…)