# OnDefineOptions(IOptionDefinitionContext)

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

## Definition

* **Type:** Method
* **Namespace:** [Unity.GraphToolkit.Editor](/engine/6000.6/script-reference/unity/graphtoolkit/editor.md)
* **Assembly:** UnityEditor

```csharp
protected virtual void OnDefineOptions(Node.IOptionDefinitionContext context)
```

### Parameters

**** (\[IOptionDefinitionContext]\(/engine/6000.6/script-reference/unity/graphtoolkit/editor/node/ioptiondefinitioncontext)): Provides methods for defining node options.

### Remarks

This method is called before [Node.OnDefinePorts](/engine/6000.6/script-reference/unity/graphtoolkit/editor/node/ondefineports.md). Override this method to add node options using the provided [Node.IOptionDefinitionContext](/engine/6000.6/script-reference/unity/graphtoolkit/editor/node/ioptiondefinitioncontext.md).

### Examples

```csharp
protected override void OnDefineOptions(IOptionDefinitionContext context)
{
    context.AddOption<bool>(
        optionName: "myBoolId",
        optionDisplayName: "My Bool");

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