GFExtensionManifest¶
API Reference / Kernel / 类索引
- 路径:
addons/gf/kernel/extension/gf_extension_manifest.gd - 模块:
Kernel - 继承:
RefCounted - API:
public - 类别:资源定义 (
resource_definition) - 首次版本:
3.17.0
GF 扩展元数据描述。 用于描述 GF 扩展的稳定 ID、版本、依赖、安装入口和编辑器扩展。
成员概览¶
| 类型 | 名称 | 签名 |
|---|---|---|
| 常量 | FILE_NAME |
const FILE_NAME: String = "gf_extension.json" |
| 常量 | KIND_STANDARD |
const KIND_STANDARD: String = "standard" |
| 常量 | KIND_EXTENSION |
const KIND_EXTENSION: String = "extension" |
| 属性 | id |
var id: String = "" |
| 属性 | display_name |
var display_name: String = "" |
| 属性 | version |
var version: String = "" |
| 属性 | extension_version |
var extension_version: String = "" |
| 属性 | kind |
var kind: String = KIND_EXTENSION |
| 属性 | root_path |
var root_path: String = "" |
| 属性 | description |
var description: String = "" |
| 属性 | dependencies |
var dependencies: Array[String] = [] |
| 属性 | installer_paths |
var installer_paths: Array[String] = [] |
| 属性 | editor_action_paths |
var editor_action_paths: Array[String] = [] |
| 属性 | editor_dock_paths |
var editor_dock_paths: Array[String] = [] |
| 属性 | editor_dock_order |
var editor_dock_order: int = 1000 |
| 属性 | editor_dock_short_label |
var editor_dock_short_label: String = "" |
| 属性 | editor_inspector_paths |
var editor_inspector_paths: Array[String] = [] |
| 属性 | import_plugin_paths |
var import_plugin_paths: Array[String] = [] |
| 属性 | export_plugin_paths |
var export_plugin_paths: Array[String] = [] |
| 属性 | gltf_document_extension_paths |
var gltf_document_extension_paths: Array[String] = [] |
| 属性 | access_generator_extension_paths |
var access_generator_extension_paths: Array[String] = [] |
| 属性 | tags |
var tags: Array[String] = [] |
| 属性 | enabled_by_default |
var enabled_by_default: bool = false |
| 属性 | source_path |
var source_path: String = "" |
| 方法 | from_dictionary |
static func from_dictionary( data: Dictionary, extension_root_path: String = "", manifest_source_path: String = "" ) -> GFExtensionManifest: |
| 方法 | from_json_file |
static func from_json_file(path: String) -> GFExtensionManifest: |
| 方法 | to_dictionary |
func to_dictionary() -> Dictionary: |
| 方法 | is_valid |
func is_valid() -> bool: |
| 方法 | get_validation_errors |
func get_validation_errors() -> Array[String]: |
常量¶
FILE_NAME¶
- API:
public
GF 扩展 manifest 文件名。
KIND_STANDARD¶
- API:
public
扩展类型:GF 标准库内置能力。
KIND_EXTENSION¶
- API:
public
扩展类型:GF 可选扩展。
属性¶
id¶
- API:
public
稳定扩展 ID,推荐格式为反向域名或作者命名空间,例如 author.extension_name。
display_name¶
- API:
public
面向用户显示的扩展名。
version¶
- API:
public
扩展发行版本号。GF 内置扩展必须与当前 GF 发行版本一致。
extension_version¶
- API:
public
扩展自身版本号。GF 内置扩展按扩展内公开行为变化独立递增;未声明时回退到 version。
kind¶
- API:
public
扩展类型,应为 standard 或 extension。
root_path¶
- API:
public
扩展根目录。
description¶
- API:
public
简短说明。
dependencies¶
- API:
public
依赖的扩展 ID 列表。
installer_paths¶
- API:
public
可选 GFInstaller 路径列表。需要自动装配运行时模块时使用。
editor_action_paths¶
- API:
public
可选编辑器菜单动作脚本路径列表。
editor_dock_paths¶
- API:
public
可选编辑器工作区页面脚本路径列表。
editor_dock_order¶
- API:
public
编辑器工作区页面排序。数值越小越靠前。
editor_dock_short_label¶
- API:
public
编辑器工作区页面短标签。为空时使用扩展显示名。
editor_inspector_paths¶
- API:
public
可选 EditorInspectorPlugin 路径列表。需要为扩展内类型提供 Inspector 增强时使用。
import_plugin_paths¶
- API:
public
可选 EditorImportPlugin 路径列表。需要为自定义资源格式提供导入器时使用。
export_plugin_paths¶
- API:
public
可选 EditorExportPlugin 路径列表。
gltf_document_extension_paths¶
- API:
public
可选 GLTFDocumentExtension 路径列表。用于导入期资产元数据桥接等编辑器能力。
access_generator_extension_paths¶
- API:
public
可选 GFAccessGenerator 扩展脚本路径列表。
tags¶
- API:
public
便于工具筛选的标签。
enabled_by_default¶
- API:
public
是否在项目首次启用 GF 时默认启用该扩展。
source_path¶
- API:
public
manifest 文件路径。
方法¶
from_dictionary¶
- API:
public
static func from_dictionary( data: Dictionary, extension_root_path: String = "", manifest_source_path: String = "" ) -> GFExtensionManifest:
从字典创建扩展 manifest。
参数:
| 名称 | 说明 |
|---|---|
data |
manifest 字典。 |
extension_root_path |
扩展根目录。 |
manifest_source_path |
manifest 文件路径。 |
返回:扩展 manifest 实例。
结构:
data: Dictionary decoded from gf_extension.json.
from_json_file¶
- API:
public
从 JSON 文件读取扩展 manifest。
参数:
| 名称 | 说明 |
|---|---|
path |
gf_extension.json 文件路径。 |
返回:读取成功时返回 manifest;失败时返回 null。
to_dictionary¶
- API:
public
转换为字典。
返回:manifest 字典副本。
结构:
return: Dictionary matching the gf_extension.json manifest shape.
is_valid¶
- API:
public
检查 manifest 是否满足基本规范。
返回:满足规范时返回 true。
get_validation_errors¶
- API:
public
获取 manifest 规范错误。
返回:错误消息列表。