using XGame.Framework.Asyncs;

namespace XGame.Framework.Asset
{
    /// <summary>
    /// 资源加载的Async
    /// </summary>
    public interface IAssetAsync : IAsync
    {
        ///// <summary>
        ///// 资源路径
        ///// </summary>
        //string Path { get; }
        /// <summary>
        /// 资源名字
        /// </summary>
        string AddressableName { get; }
        /// <summary>
        /// 开始
        /// </summary>
        void Start();
        /// <summary>
        /// 返回结果
        /// </summary>
        /// <returns></returns>
        object GetResult();
    }
    public interface IAssetCacheHandle
    {
        /// <summary>
        /// 从AssetManager获取Asset实例
        /// </summary>
        /// <param name="addressableName"></param>
        /// <returns></returns>
        object GetAssetFromCache(string addressableName);
        /// <summary>
        /// 释放缓存
        /// </summary>
        /// <param name="async"></param>
        void ReleaseAsync(IAsync async);
        /// <summary>
        /// 设置资源的预加载标记
        /// </summary>
        /// <param name="addressableName"></param>
        /// <param name="isPreload"></param>
        void SetPreloadTag(string addressableName, bool isPreload);
    }
}
