重构
This commit is contained in:
@@ -3,6 +3,7 @@ using UnityEditor;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
using GameFramework;
|
||||
using Architecture.Core;
|
||||
|
||||
/// <summary>
|
||||
/// 一键搭建游戏 UI:HUD Canvas + 游戏结果 Canvas + 主菜单标题。
|
||||
@@ -300,6 +301,13 @@ public static class UIBuilder
|
||||
so.FindProperty("loseConfirmButton").objectReferenceValue = loseBtn.GetComponent<Button>();
|
||||
so.FindProperty("loseTitleText").objectReferenceValue = loseTitle.GetComponent<Text>();
|
||||
so.FindProperty("loseScoreText").objectReferenceValue = loseScore.GetComponent<Text>();
|
||||
|
||||
// 连接 SO 事件通道(与 GameManager 发布方使用同一资产,建立解耦监听)
|
||||
// 注意:GameResultScreen 现已明确只负责「胜利」,不再订阅 OnGameOver(失败由 GameLostOverlay 接管)。
|
||||
var onGameWin = AssetDatabase.LoadAssetAtPath<GameEvent>("Assets/Architecture/Assets/OnGameWin.asset");
|
||||
if (onGameWin != null) so.FindProperty("onGameWinEvent").objectReferenceValue = onGameWin;
|
||||
else Debug.LogWarning("[UIBuilder] 未找到 OnGameWin 资产,请先运行 Architecture > Bootstrap Core Assets");
|
||||
|
||||
so.ApplyModifiedProperties();
|
||||
|
||||
Debug.Log("[UIBuilder] ResultScreen Canvas 搭建完成");
|
||||
|
||||
Reference in New Issue
Block a user