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

16 lines
532 B
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>
public interface IResourceReleaseStrategy
{
/// <summary>
/// 判断是否应该释放资源
/// </summary>
/// <param name="path">资源路径</param>
/// <param name="refCount">当前引用计数</param>
/// <returns>如果应该释放返回 true否则返回 false</returns>
bool ShouldRelease(string path, int refCount);
}