mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 将 AbstractAssetCatalogSystem 从 GFramework.Godot 移动到 GFramework.Game - 引入 GameUnitId、TemplateId 和 AssetId 替代原有的 SceneId 和 ResourceId - 更新注册与查询接口以区分不同类型资源 - 修改相关系统类以适配新的资产标识符类型 - 调整项目引用依赖关系,确保正确的程序集链接 - 扩展资源工厂系统以处理新增的资源类别 - [no tag]
46 lines
1.4 KiB
C#
46 lines
1.4 KiB
C#
|
||
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;
|
||
|
||
}
|