docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Implement a block node

    Important

    This experimental package is deprecated and no longer supported as of Unity version 6.4. Unity Graph Toolkit is included as a module in the Editor as of Unity version 6.4 and later, and does not require a separate installation. You can find the samples and accompanying documentation in the Unity Graph Toolkit samples package com.unity.graphtoolkit-samples.

    This procedure assumes you have already implemented a context node, as described in Implement a context node.

    To implement a block node:

    1. Define a class that inherits from the BlockNode base class
    2. Add the UseWithContext attribute to connect it to your context node

    The resulting code looks like:

    
    [UseWithContext(typeof(MyContextNode))]
    [Serializable]
    public class MyBlockNode : BlockNode
    {
    }
    
    

    To relate a block node to several context nodes, list them separated with a comma in your UseWithContext attribute:

    
    [UseWithContext(typeof(MyContextNode), typeof(MyOtherContextNode))]
    [Serializable]
    public class MyBlockNodeWithMultipleContexts : BlockNode
    {
    }
    
    

    Block nodes inherit all features available in its parent Node class. Review Implement a node to learn how to customize your node with node options, ports, and orientation settings.

    Next step

    • Instantiate and manage block nodes

    Related scripting API documentation

    • ContextNode
    • BlockNode
    • UseWithContextAttribute
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)