
joywayerandClaude Opus 4.8
fccd87df6b
fix(enemy): 修复退出 Play 时巡逻调试 Inspector 的 NRE 与 IMGUI 报错
退出 Play 有一个窗口:Application.isPlaying 仍为 true 但 PBWorld 已销毁,此时 Inspector
调 nav.CanReach → PBWorld.PathTo(instance=null) 抛 NRE;该异常在 IMGUI 布局组中途中断,
使 BeginHorizontal 组失衡 → 级联 ArgumentException("control N in a group with only N controls")。
修:
- 订阅 playModeStateChanged,ExitingPlayMode 置 _exitingPlay,CanReach 调用点加
!_exitingPlay && isPlaying 守卫,退出期不再查询已销毁的 PBWorld。
- 运行时区块的绘制判定只在 Layout 事件锁定、Repaint 复用,避免 isPlaying 在两趟 GUI
间翻转导致控件数不一致。
实测:选中敌人连续两次进/退 Play,Console 无 NRE/ArgumentException。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 15:33:41 +08:00
..
2026-06-05 18:41:33 +08:00
2026-05-26 16:17:24 +08:00
2026-07-21 16:35:15 +08:00
2026-06-12 11:59:35 +08:00
2026-06-09 10:41:43 +08:00
2026-06-06 09:00:11 +08:00
2026-07-23 15:33:41 +08:00
2026-05-22 00:09:50 +08:00
2026-05-20 11:52:17 +08:00
2026-06-08 11:26:17 +08:00
2026-05-25 00:05:15 +08:00
2026-06-10 14:14:08 +08:00
2026-05-25 13:21:41 +08:00
2026-06-06 09:00:11 +08:00
2026-07-10 13:43:51 +08:00
2026-05-20 11:52:17 +08:00
2026-05-25 11:54:37 +08:00
2026-07-21 16:18:07 +08:00
2026-06-05 18:41:33 +08:00
2026-07-21 11:40:44 +08:00
2026-05-21 07:09:53 +08:00
2026-07-20 10:32:07 +08:00
2026-06-10 14:14:08 +08:00
2026-05-23 00:10:23 +08:00
2026-06-05 18:41:33 +08:00
2026-06-05 18:41:33 +08:00
2026-05-15 14:47:24 +08:00
2026-07-23 11:57:02 +08:00
2026-05-15 14:47:24 +08:00
2026-06-05 18:41:33 +08:00
2026-05-15 14:47:24 +08:00
2026-05-20 11:52:17 +08:00
2026-05-15 14:47:24 +08:00
2026-06-05 18:41:33 +08:00
2026-05-25 00:05:15 +08:00
2026-05-15 14:47:24 +08:00
2026-05-15 14:47:24 +08:00
2026-05-15 14:47:24 +08:00
2026-05-15 14:47:24 +08:00
2026-05-21 07:09:53 +08:00
2026-05-23 00:10:23 +08:00
2026-05-25 13:21:41 +08:00
2026-05-25 11:54:37 +08:00
2026-05-21 07:09:53 +08:00
2026-05-20 11:52:17 +08:00
2026-05-20 11:52:17 +08:00
2026-05-25 00:05:15 +08:00
2026-05-15 14:47:24 +08:00
2026-06-05 18:41:33 +08:00
2026-05-15 14:47:24 +08:00
2026-05-15 14:47:24 +08:00
2026-06-05 18:41:33 +08:00
2026-05-15 14:47:24 +08:00
2026-05-25 11:54:37 +08:00
2026-05-15 14:47:24 +08:00
2026-06-05 18:41:33 +08:00
2026-05-15 14:47:24 +08:00