文档

Unity Engine

Unity Engine

OnDefineSubgraphNodeOptions(IOptionDefinitionContext)

Called to define the INodeOption s available on subgraph nodes that reference this type of graph. Similar in function to Node.OnDefineOptions.
阅读时间1 分钟最后更新于 1 个月前

Definition

protected virtual void OnDefineSubgraphNodeOptions(Node.IOptionDefinitionContext context)

Parameters

Provides methods for defining node options.

Remarks

Override this method to add options to all subgraph nodes that point to this type of graph using the provided Node.IOptionDefinitionContext. This method is only applicable to graphs that can act as subgraphs. If the graph is not a subgraph, this method has no effect. To qualify as a subgraph, the graph must be marked with SubgraphAttribute.

Examples

protected override void OnDefineSubgraphNodeOptions(Node.IOptionDefinitionContext context){ context.AddOption<int>("ID") .WithTooltip("The ID of the subgraph.") .Delayed(); context.AddOption<string>("Description") .WithDefaultValue("What is the purpose of this subgraph?") .Delayed();}