fix(fix): 调整对话气泡加载时机与销售态槽位优先级
Enter 中先 LoadBubbles 再 SwitchCamera,避免 me: 释放log 时找不到 Player 槽位。 SalesState 中优先使用 salesManager.bubbleSlotGroup,缺失时回退 ScreenSystem。 Made-with: Cursor
This commit is contained in:
@@ -122,12 +122,12 @@ namespace AibisDream.FixSystem
|
||||
|
||||
public IEnumerator Enter()
|
||||
{
|
||||
// 切换相机
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.Clinic);
|
||||
// 注册对话气泡
|
||||
// 先加载对话气泡,避免 Yarn 对话(如 测试 节点 me: 释放log)在相机切换完成前执行时找不到 Player 槽位
|
||||
var clinicSystem = FixSystemCenter.SystemDic.Get<ClinicSystem>();
|
||||
var data = clinicSystem.bubbleSlotGroup.CollectData();
|
||||
DialogUIManager.Instance.LoadBubbles(data);
|
||||
// 切换相机
|
||||
yield return CameraKit.Instance.SwitchCamera(CameraEnum.Clinic);
|
||||
}
|
||||
|
||||
public IEnumerator Exit()
|
||||
@@ -799,9 +799,16 @@ namespace AibisDream.FixSystem
|
||||
// FadeOut
|
||||
yield return UIManager.Instance.GetPanel<PlayToolPanel>().FadeOutAsync(0.5f);
|
||||
|
||||
// 注册对话气泡(与其他 state 一致)
|
||||
// 销售模块使用自身的气泡槽位;缺失时再回退到 ScreenSystem,避免读到错误的槽位配置
|
||||
if (salesManager.bubbleSlotGroup != null)
|
||||
{
|
||||
var data = salesManager.bubbleSlotGroup.CollectData();
|
||||
Debug.Log("[SalesState] Loaded bubble slots from SalesManager.");
|
||||
DialogUIManager.Instance.LoadBubbles(data);
|
||||
}
|
||||
else if (screenSystem.BubbleSlotGroup != null)
|
||||
{
|
||||
Debug.LogWarning("[SalesState] SalesManager.bubbleSlotGroup is null, fallback to ScreenSystem bubble slots.");
|
||||
var data = screenSystem.BubbleSlotGroup.CollectData();
|
||||
DialogUIManager.Instance.LoadBubbles(data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user