GFRenderWarmupManifest¶
API Reference / Standard / 类索引
- 路径:
addons/gf/standard/utilities/display/gf_render_warmup_manifest.gd - 模块:
Standard - 继承:
Resource - API:
public - 类别:资源定义 (
resource_definition) - 首次版本:
3.17.0
通用渲染预热清单。 只描述需要提前触碰的渲染相关资源,不绑定具体关卡、材质命名或项目加载流程。
成员概览¶
| 类型 | 名称 | 签名 |
|---|---|---|
| 属性 | manifest_id |
var manifest_id: StringName = &"" |
| 属性 | entries |
var entries: Array[Dictionary] = [] |
| 属性 | metadata |
var metadata: Dictionary = {} |
| 方法 | add_resource_path |
func add_resource_path( entry_resource_path: String, kind: StringName = &"", type_hint: String = "", entry_metadata: Dictionary = {} ) -> int: |
| 方法 | add_resource |
func add_resource(resource: Resource, kind: StringName = &"", entry_metadata: Dictionary = {}) -> int: |
| 方法 | append_manifest |
func append_manifest(manifest: GFRenderWarmupManifest) -> int: |
| 方法 | clear |
func clear() -> void: |
| 方法 | get_entry_count |
func get_entry_count() -> int: |
| 方法 | is_empty |
func is_empty() -> bool: |
| 方法 | normalize_entry |
static func normalize_entry(entry: Dictionary) -> Dictionary: |
| 方法 | get_entries |
func get_entries() -> Array[Dictionary]: |
| 方法 | describe |
func describe() -> Dictionary: |
属性¶
manifest_id¶
- API:
public
清单稳定标识,便于诊断和队列统计。
entries¶
- API:
public
预热条目列表。条目字段为 resource_path、resource、kind、type_hint、metadata。
结构:
entries: Array[Dictionary],元素包含 resource_path: String、resource: Resource 或 null、kind: StringName、type_hint: String 和 metadata: Dictionary。
metadata¶
- API:
public
项目自定义元数据。框架不解释该字段。
结构:
metadata: Dictionary[String, Variant],会复制到 describe() 结果中。
方法¶
add_resource_path¶
- API:
public
func add_resource_path( entry_resource_path: String, kind: StringName = &"", type_hint: String = "", entry_metadata: Dictionary = {} ) -> int:
添加资源路径条目。
参数:
| 名称 | 说明 |
|---|---|
entry_resource_path |
资源路径。 |
kind |
资源类别提示。 |
type_hint |
ResourceLoader 类型提示。 |
entry_metadata |
条目元数据。 |
返回:添加后的条目索引;失败返回 -1。
结构:
entry_metadata: Dictionary[String, Variant],会复制到 manifest 条目的 metadata。
add_resource¶
- API:
public
func add_resource(resource: Resource, kind: StringName = &"", entry_metadata: Dictionary = {}) -> int:
添加已持有的资源条目。
参数:
| 名称 | 说明 |
|---|---|
resource |
资源实例。 |
kind |
资源类别提示。 |
entry_metadata |
条目元数据。 |
返回:添加后的条目索引;失败返回 -1。
结构:
entry_metadata: Dictionary[String, Variant],会复制到 manifest 条目的 metadata。
append_manifest¶
- API:
public
合并另一个清单的条目。
参数:
| 名称 | 说明 |
|---|---|
manifest |
来源清单。 |
返回:新增条目数量。
clear¶
- API:
public
清空清单条目。
get_entry_count¶
- API:
public
获取条目数量。
返回:条目数量。
is_empty¶
- API:
public
检查清单是否为空。
返回:为空返回 true。
normalize_entry¶
- API:
public
规范化预热条目字典。
参数:
| 名称 | 说明 |
|---|---|
entry |
输入条目。 |
返回:包含 resource_path、resource、kind、type_hint、metadata 的规范化副本。
结构:
entry: Dictionary,包含 resource_path、resource、kind、type_hint 和 metadata 的 manifest 条目。return: Dictionary,规范化后的 manifest 条目,包含 resource_path、resource、kind、type_hint 和 metadata。
get_entries¶
- API:
public
获取条目副本。
返回:条目数组副本。
结构:
return: Array[Dictionary],规范化后的 manifest 条目列表。
describe¶
- API:
public
描述清单。
返回:清单描述字典。
结构:
return: Dictionary,包含 manifest_id、entry_count、entries 和 metadata。