mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 将 AssetCatalog.cs、IAssetCatalogSystem.cs、IResourceFactorySystem.cs 和 ResourceFactory.cs 从 GFramework.Game 移至 GFramework.Game.Abstractions - 在 GFramework.Game 项目中添加对 GFramework.Game.Abstractions 的引用 - 更新 AbstractAssetCatalogSystem.cs 以使用新的命名空间引用 - 在 GFramework.Godot 项目中添加对 GFramework.Game.Abstractions 的引用 - 更新 ResourceLoadSystem.cs 以使用新的命名空间并修正命名空间声明 - 在解决方案文件中注册新的 GFramework.Game.Abstractions 项目 - 为 GFramework.Game.Abstractions 项目添加 Directory.Build.props 配置文件 - 在主项目文件中排除新抽象模块的编译和资源文件以避免重复包含
52 lines
1.8 KiB
C#
52 lines
1.8 KiB
C#
namespace System.Runtime.CompilerServices
|
||
{
|
||
// 这个类用于支持C# 9.0中的init访问器和记录类型功能
|
||
internal static class IsExternalInit;
|
||
}
|
||
|
||
namespace GFramework.Game.Abstractions.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>
|
||
/// 场景页面资源标识符结构体,用于标识场景页面资源
|
||
/// </summary>
|
||
/// <param name="Path">场景页面资源路径</param>
|
||
public readonly record struct ScenePageId(string Path) : IAssetId;
|
||
|
||
|
||
/// <summary>
|
||
/// 场景单元资源标识符结构体,用于标识场景单元资源
|
||
/// </summary>
|
||
/// <param name="Path">场景单元资源路径</param>
|
||
public readonly record struct SceneUnitId(string Path) : IAssetId;
|
||
|
||
/// <summary>
|
||
/// 通用资源标识符结构体,实现IAssetId接口
|
||
/// </summary>
|
||
/// <param name="Path">资源路径</param>
|
||
public readonly record struct AssetId(string Path) : IAssetId;
|
||
}
|
||
} |