GeWuYou 7919c93f44 feat(resource): 添加资源管理系统和日志集成
- 实现了完整的资源管理系统,包括资源加载、缓存和卸载功能
- 添加了 IResourceHandle、IResourceLoader、IResourceManager 和 IResourceReleaseStrategy 接口定义
- 实现了 AutoReleaseStrategy 和 ManualReleaseStrategy 两种资源释放策略
- 创建了 ResourceCache 缓存系统和 ResourceHandle 资源句柄管理
- 在 ConfigurationManager 和 CoroutineScheduler 中集成了 ILogger 日志功能
- 添加了全面的 ResourceManagerTests 单元测试覆盖各种使用场景
2026-03-05 08:34:05 +08:00

35 lines
1.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace GFramework.Core.Abstractions.resource;
/// <summary>
/// 资源加载器接口,用于加载特定类型的资源
/// </summary>
/// <typeparam name="T">资源类型</typeparam>
public interface IResourceLoader<T> where T : class
{
/// <summary>
/// 同步加载资源
/// </summary>
/// <param name="path">资源路径</param>
/// <returns>加载的资源实例</returns>
T Load(string path);
/// <summary>
/// 异步加载资源
/// </summary>
/// <param name="path">资源路径</param>
/// <returns>加载的资源实例</returns>
Task<T> LoadAsync(string path);
/// <summary>
/// 卸载资源
/// </summary>
/// <param name="resource">要卸载的资源</param>
void Unload(T resource);
/// <summary>
/// 检查是否支持加载指定路径的资源
/// </summary>
/// <param name="path">资源路径</param>
/// <returns>如果支持返回 true否则返回 false</returns>
bool CanLoad(string path);
}