GeWuYou 2db09e72d7 refactor(assets): 重构资产目录系统以支持多种资源类型
- 将 AbstractAssetCatalogSystem 从 GFramework.Godot 移动到 GFramework.Game
- 引入 GameUnitId、TemplateId 和 AssetId 替代原有的 SceneId 和 ResourceId
- 更新注册与查询接口以区分不同类型资源
- 修改相关系统类以适配新的资产标识符类型
- 调整项目引用依赖关系,确保正确的程序集链接
- 扩展资源工厂系统以处理新增的资源类别
- [no tag]
2025-12-20 13:45:49 +08:00

46 lines
1.4 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.Game.assets;
/// <summary>
/// 资源目录类,用于定义和管理游戏中的场景和资源标识符
/// </summary>
public static class AssetCatalog
{
/// <summary>
/// 资源标识符接口,定义了资源路径的访问接口
/// </summary>
public interface IAssetId
{
/// <summary>
/// 获取资源的路径
/// </summary>
string Path { get; }
}
/// <summary>
/// 资源目录映射结构体,用于存储资源目录的键值对映射关系
/// </summary>
/// <param name="Key">资源目录的键</param>
/// <param name="Id">资源标识符</param>
public readonly record struct AssetCatalogMapping(string Key, IAssetId Id);
/// <summary>
/// 模板资源标识符结构体实现IAssetId接口
/// </summary>
/// <param name="Path">资源路径</param>
public readonly record struct TemplateId(string Path) : IAssetId;
/// <summary>
/// 游戏单位资源标识符结构体实现IAssetId接口
/// </summary>
/// <param name="Path">资源路径</param>
public readonly record struct GameUnitId(string Path) : IAssetId;
/// <summary>
/// 通用资源标识符结构体实现IAssetId接口
/// </summary>
/// <param name="Path">资源路径</param>
public readonly record struct AssetId(string Path) : IAssetId;
}