using System; using UnityEngine; using XGame.Framework.Asset; namespace XGame.Framework.Map { public interface IEntityViewHandle { TEntityView CreateEntity(EntityBehaviour behaviour) where TEntityView : class, IEntityView, new(); } public interface IMapAssetModule : IEntityViewHandle { /// /// 异步加载接口 /// 使用该接口加载的资源严禁使用Object.Destroy销毁,只能使用Recycle(obj)方法回收 /// /// 返回对象类型 /// 可寻址资源名字 /// 返回异步回调 IAssetLoadAsync LoadAsync(string addressableName) where TResult : UnityEngine.Object; IEntityViewLoadAsync LoadEntity(string addressableName, Transform parent) where TEntityView : class, IEntityView, new(); /// /// 回收资源 /// /// void Recycle(UnityEngine.Object obj); /// /// 回收Entity实例 /// 和LoadEntity配套 /// /// /// 是否销毁,默认false void Recycle(IEntityView entityView, bool isDestroy = false); /// /// 结束所有加载的异步 /// void StopAllAsyncs(); } }