Introduce UiManager/MainHUD prefab flow, strengthen GameNet/WsClient, and add AIServer maintenance endpoint support. Co-authored-by: Cursor <cursoragent@cursor.com>
46 lines
1.1 KiB
C#
46 lines
1.1 KiB
C#
using AOT.Boot;
|
|
using HotUpdate.Gameplay;
|
|
using HotUpdate.Net;
|
|
using UnityEngine;
|
|
|
|
namespace HotUpdate
|
|
{
|
|
/// <summary>
|
|
/// 热更稳定入口(壳通过反射/Assembly.Load 调用,签名勿改)。
|
|
/// </summary>
|
|
public static class Entry
|
|
{
|
|
public static void Start(BootContext ctx)
|
|
{
|
|
Debug.Log($"[HotUpdate.Entry] Start app={ctx?.AppVersion} res={ctx?.ResVersion}");
|
|
|
|
var root = new GameObject("HotUpdateRoot");
|
|
Object.DontDestroyOnLoad(root);
|
|
root.AddComponent<HotUpdateBootstrap>().Bind(ctx);
|
|
}
|
|
}
|
|
|
|
public sealed class HotUpdateBootstrap : MonoBehaviour
|
|
{
|
|
BootContext _ctx;
|
|
|
|
public void Bind(BootContext ctx)
|
|
{
|
|
_ctx = ctx;
|
|
}
|
|
|
|
void Start()
|
|
{
|
|
Debug.Log($"[HotUpdate] Bootstrap ready. CDN={_ctx?.CdnRoot}");
|
|
|
|
var net = gameObject.AddComponent<GameNet>();
|
|
net.Bind(_ctx);
|
|
|
|
var gameplay = gameObject.AddComponent<GameplayBootstrap>();
|
|
gameplay.Bind(_ctx, net);
|
|
|
|
net.StartGuestSession();
|
|
}
|
|
}
|
|
}
|