Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

Graph.OnDefineSubgraphNodeOptions

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

protected void OnDefineSubgraphNodeOptions(Unity.GraphToolkit.Editor.Node/IOptionDefinitionContext context);

Parameters

Parameter Description
context Provides methods for defining node options.

Description

Called to define the INodeOptions available on subgraph nodes that reference this type of graph. Similar in function to Node.OnDefineOptions.

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.

 protected override void OnDefineSubgraphNodeOptions(Node.IOptionDefinitionContext context)
 {
     context.AddOption&lt;int&gt;("ID")
         .WithTooltip("The ID of the subgraph.")
         .Delayed();

context.AddOption&lt;string&gt;("Description") .WithDefaultValue("What is the purpose of this subgraph?") .Delayed(); }