GFramework/GFramework.Core/resource/ManualReleaseStrategy.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

19 lines
566 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.

using GFramework.Core.Abstractions.resource;
namespace GFramework.Core.resource;
/// <summary>
/// 手动释放策略
/// 引用计数降为 0 时不自动卸载资源,需要手动调用 Unload
/// </summary>
public class ManualReleaseStrategy : IResourceReleaseStrategy
{
/// <summary>
/// 判断是否应该释放资源(始终返回 false
/// </summary>
public bool ShouldRelease(string path, int refCount)
{
// 手动释放策略:永远不自动释放,由用户显式调用 Unload
return false;
}
}