GFFlowPort¶
API Reference / Flow / 类索引
- 路径:
addons/gf/extensions/flow/resources/gf_flow_port.gd - 模块:
Flow - 继承:
Resource - API:
public - 类别:资源定义 (
resource_definition) - 首次版本:
3.17.0
流程节点端口描述。 端口只描述节点对外暴露的输入/输出能力,供编辑器、校验器或项目层 构建可视化流程使用;运行时如何解释端口数据仍由具体节点决定。
成员概览¶
| 类型 | 名称 | 签名 |
|---|---|---|
| 枚举 | Direction |
enum Direction |
| 枚举 | ValueType |
enum ValueType |
| 属性 | port_id |
var port_id: StringName = &"" |
| 属性 | display_name |
var display_name: String = "" |
| 属性 | direction |
var direction: Direction = Direction.OUTPUT |
| 属性 | value_type |
var value_type: ValueType = ValueType.ANY |
| 属性 | allow_multiple |
var allow_multiple: bool = false |
| 属性 | editor_color |
var editor_color: Color = Color.TRANSPARENT |
| 属性 | type_hint |
var type_hint: StringName = &"" |
| 属性 | class_name_hint |
var class_name_hint: StringName = &"" |
| 属性 | semantic_tags |
var semantic_tags: PackedStringArray = PackedStringArray() |
| 属性 | metadata |
var metadata: Dictionary = {} |
| 方法 | get_port_id |
func get_port_id() -> StringName: |
| 方法 | get_display_name |
func get_display_name() -> String: |
| 方法 | has_semantic_tag |
func has_semantic_tag(tag: StringName) -> bool: |
| 方法 | is_compatible_with |
func is_compatible_with(target_port: GFFlowPort) -> bool: |
| 方法 | get_compatibility_report |
func get_compatibility_report(target_port: GFFlowPort) -> Dictionary: |
| 方法 | describe |
func describe() -> Dictionary: |
枚举¶
Direction¶
- API:
public
端口方向。
ValueType¶
- API:
public
enum ValueType { ## 任意值。 ANY, ## 布尔。 BOOL, ## 数值。 NUMBER, ## 字符串。 STRING, ## Vector2。 VECTOR2, ## Vector3。 VECTOR3, ## Dictionary。 DICTIONARY, ## Array。 ARRAY, ## Object 或 Resource。 OBJECT, }
端口值类型提示。
属性¶
port_id¶
- API:
public
端口稳定标识。
display_name¶
- API:
public
显示名称。
direction¶
- API:
public
端口方向。
value_type¶
- API:
public
值类型提示。
allow_multiple¶
- API:
public
是否允许多条连接。
editor_color¶
- API:
public
编辑器或可视化工具使用的端口颜色。透明色表示由工具自行决定。
type_hint¶
- API:
public
更细粒度的值类型提示,例如项目自定义数据结构名。框架不解释该字段。
class_name_hint¶
- API:
public
Object / Resource 端口的类名提示。仅在项目或校验器显式使用时参与兼容性判断。
semantic_tags¶
- API:
public
语义标签列表,供搜索、编辑器过滤或项目工具使用。
metadata¶
- API:
public
项目自定义元数据。框架不解释该字段。
结构:
metadata: 项目自定义元数据 Dictionary;框架保留并复制该字段,但不解释其中键值。
方法¶
get_port_id¶
- API:
public
获取端口标识。
返回:端口标识。
get_display_name¶
- API:
public
获取显示名称。
返回:显示名称。
has_semantic_tag¶
- API:
public
检查是否包含语义标签。
参数:
| 名称 | 说明 |
|---|---|
tag |
标签。 |
返回:包含返回 true。
is_compatible_with¶
- API:
public
判断当前端口是否可连接到目标端口。
参数:
| 名称 | 说明 |
|---|---|
target_port |
目标端口。 |
返回:兼容返回 true。
get_compatibility_report¶
- API:
public
获取当前端口连接到目标端口的兼容性报告。
参数:
| 名称 | 说明 |
|---|---|
target_port |
目标端口。 |
返回:兼容性报告。
结构:
return: 包含 ok、reason、message、source_port_id、source_value_type、target_port_id 和 target_value_type 字段的 Dictionary。
describe¶
- API:
public
描述端口。
返回:端口描述字典。
结构:
return: 包含 port_id、display_name、direction、value_type、allow_multiple、editor_color、type_hint、class_name_hint、semantic_tags 和 metadata 字段的 Dictionary。