Add MainHUD gameplay UI, net handshake updates, and server maintenance mode.

Introduce UiManager/MainHUD prefab flow, strengthen GameNet/WsClient, and add AIServer maintenance endpoint support.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
udx
2026-09-21 17:34:42 +08:00
co-authored by Cursor
parent 10d9b98637
commit c94b8fefeb
32 changed files with 1907 additions and 74 deletions
@@ -0,0 +1,39 @@
using UnityEngine;
using YooAsset;
namespace HotUpdate.UI
{
/// <summary>
/// UI Prefab 加载:编辑器 AssetDatabase;运行时优先 DefaultPackage 寻址。
/// </summary>
public sealed class UiPrefabLoader
{
public const string PrefabFolder = "Assets/Bundles/UI/Prefab";
public GameObject Load(string prefabName)
{
if (string.IsNullOrEmpty(prefabName)) return null;
if (YooAssets.IsInitialized)
{
// DefaultPackage 或任意已初始化包
var packages = new[] { "DefaultPackage", "Art" };
foreach (var name in packages)
{
if (!YooAssets.TryGetPackage(name, out var pkg)) continue;
if (pkg.InitializeStatus != EOperationStatus.Succeeded) continue;
var handle = pkg.LoadAssetSync<GameObject>(prefabName);
if (handle.Status == EOperationStatus.Succeeded)
return handle.GetAssetObject<GameObject>();
}
}
#if UNITY_EDITOR
var path = $"{PrefabFolder}/{prefabName}.prefab";
return UnityEditor.AssetDatabase.LoadAssetAtPath<GameObject>(path);
#else
return null;
#endif
}
}
}