26 lines
873 B
C#
26 lines
873 B
C#
namespace XWorld.Framework
|
|
{
|
|
// 资源加载抽象,避免共享层引用 UnityEngine;客户端实现里再转成具体 Unity 对象。
|
|
// 统一异步:客户端薄层按需从 CDN 下载并在 onLoaded 回调里返回对象(失败回调 null)。
|
|
public interface IAssetLoader
|
|
{
|
|
void Load(string path, System.Action<object> onLoaded); // 结果由客户端薄层按需强转
|
|
}
|
|
|
|
public interface IGameClientCtx
|
|
{
|
|
IAssetLoader Assets { get; }
|
|
ILogger Logger { get; }
|
|
void Send(NetMessage message); // 发往服务端(Game 通道)
|
|
void Exit(); // 请求退出当前小游戏
|
|
}
|
|
|
|
public interface IGameClient
|
|
{
|
|
void OnEnter(IGameClientCtx ctx);
|
|
void OnNetMessage(NetMessage message);
|
|
void OnUpdate(float deltaTime);
|
|
void OnExit();
|
|
}
|
|
}
|