Version: Unity 6.4 Alpha (6000.4)
LanguageEnglish
  • C#

Node.OnDefineOptions

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 OnDefineOptions(Unity.GraphToolkit.Editor.Node.IOptionDefinitionContext context);

Parameters

Parameter Description
context Provides methods for defining node options.

Description

Called during DefineNode to define the options available on the node.

This method is called before OnDefinePorts. Override this method to add node options using the provided IOptionDefinitionContext.

 protected override void OnDefineOptions(IOptionDefinitionContext context)
 {
     context.AddNodeOption&lt;bool&gt;(
         optionName: "My Bool",
         optionDisplayName: "myBoolId");

context.AddNodeOption( optionName: "Label", dataType: typeof(string), optionDisplayName: "labelId", tooltip: "A label.", defaultValue: "Default Value"); }