mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-07 17:21:16 +08:00
- 新增面向静态游戏内容的 AI-First 配表方案介绍 - 详细说明 YAML 作为配置源文件和 JSON Schema 结构描述功能 - 提供推荐目录结构和 Schema 示例配置 - 添加 VS Code 插件工具支持说明 - 包含 Godot 文本配置桥接使用指南 - 提供运行时读取和热重载模板示例 - 说明生成器接入约定和运行时校验行为 - 添加开发期热重载和工具支持详细说明 - 创建 Godot 测试项目配置文件 - 实现 GodotYamlConfigLoader 配置加载适配层
37 lines
1.6 KiB
C#
37 lines
1.6 KiB
C#
using GFramework.Game.Config;
|
||
|
||
namespace GFramework.Godot.Config;
|
||
|
||
/// <summary>
|
||
/// 描述 Godot YAML 配置加载器的初始化约定。
|
||
/// </summary>
|
||
public sealed class GodotYamlConfigLoaderOptions
|
||
{
|
||
/// <summary>
|
||
/// 获取或设置配置源根目录。
|
||
/// 默认值为 <c>res://</c>,表示从项目资源路径读取 YAML 与 schema 文本。
|
||
/// </summary>
|
||
public string SourceRootPath { get; init; } = "res://";
|
||
|
||
/// <summary>
|
||
/// 获取或设置运行时缓存根目录。
|
||
/// 当 <see cref="SourceRootPath" /> 在当前环境下无法直接映射为普通文件系统目录时,
|
||
/// 加载器会先把所需文本资产复制到这里,再交给底层 <see cref="YamlConfigLoader" />。
|
||
/// </summary>
|
||
public string RuntimeCacheRootPath { get; init; } = "user://config_cache";
|
||
|
||
/// <summary>
|
||
/// 获取或设置本次启动会访问到的配置表来源描述。
|
||
/// Godot 导出态无法假设任意文本目录都可被枚举,因此调用方应显式提供参与本轮加载的配置目录与 schema 文件。
|
||
/// </summary>
|
||
public IReadOnlyCollection<GodotYamlConfigTableSource> TableSources { get; init; } =
|
||
Array.Empty<GodotYamlConfigTableSource>();
|
||
|
||
/// <summary>
|
||
/// 获取或设置用于配置底层 <see cref="YamlConfigLoader" /> 的回调。
|
||
/// 调用方通常应在这里调用生成器产出的 <c>RegisterAllGeneratedConfigTables()</c>,
|
||
/// 或显式注册当前场景所需的手写表定义。
|
||
/// </summary>
|
||
public Action<YamlConfigLoader>? ConfigureLoader { get; init; }
|
||
}
|