Databrain Documentation
databrain.ccDiscord
  • Welcome
  • Installation / Update
  • Interface
  • DataObject Property Drawer
    • No GUI Implemented - FIX
  • Getting started
  • Guides
    • Add data objects
    • Add data objects at runtime
    • Get initial data
    • Get/Set runtime data
    • Serialize DataObjects
    • Runtime Save & Load
    • Use custom serializer
    • Import
    • Search
    • Custom GUI
    • Custom GUI with Odin Inspector
    • Hierarchy Template
  • Separate DataObjects
  • Using Version Control
  • Attributes
    • DataObject attributes
    • Field attributes
  • API
    • DataLibrary
    • DataObject
  • FAQ
    • Databrain - FAQ
  • Add-ons
    • Events
    • Blackboard
    • Logic
      • Interface
      • Create Graph
      • Execute graph
      • Control flow execution in groups
      • Custom Nodes
        • Asynchronous execution
        • Node Attributes
      • Scene Components
      • Graph Events
      • Finite State Machine
        • Create custom Actions
        • Examples
        • State Machine Nodes
    • Stats
      • Achievements
      • Modifiers
      • Values
      • Progressions
      • Components
      • Nodes
    • Progress
      • Progress Settings
      • Progress Graph
      • Progress Resources
      • Runtime UI Setup
      • API
        • ProgressController
    • Techtree (LEGACY)
      • Techtree Manager
      • Techtree
      • TechtreeResource
      • Techtree UIBuilder
        • Custom Techtree Node Button
        • Tooltip
      • API
    • Localization
      • Localization Manager
      • Localization
      • Examples
      • Components
      • Import
      • API
    • Inventory
      • Getting started
      • Demo
      • Data setup
        • Inventories
        • Slot IDs
        • Items
          • Blueprints
          • Item rarities
        • Money
        • Loot tables
        • Events
      • Runtime UI
        • Setup
    • Dialogue
      • Getting Started
        • Demo
      • Dialogue runtime setup
      • Actors
        • Emotions
      • Localization
      • Audio
      • Animation
      • Variables
      • Custom theme
      • Import
      • Nodes
      • API
        • DialogueController
        • IDialogueUIControl
  • Changelog
    • Databrain - Changelog
      • 1.4.0
      • 1.3.2
      • 1.3.1
      • 1.3.0
      • 1.2.0
      • 1.1.0
      • 1.0.10
      • 1.0.9
      • 1.0.8
      • 1.0.7
      • <= 1.0.6
Powered by GitBook
On this page
  • Overridable methods
  • Node Attributes
  1. Add-ons
  2. Logic

Custom Nodes

Creating a custom node for Logic is as easy as creating a new C# file.

  1. Simply right click in the project view and select: Create / Databrain / Logic / New Node

  2. Name the node

  3. Done

You can of course also just create a new class file and derive from NodeData

using Databrain.Logic.Attributes;

namespace Databrain.Logic
{
    [NodeTitle("My Node")]
    [NodeCategory("Custom")]
    [NodeOutputs(new string[] {"Out"})]
    [NodeDescription("This is a node description")]
    public class MyNode : NodeData
    {
        public override void ExecuteNode()
        {
            // Execute code there
        
            // Execute next node connected to output index 0
            ExecuteNextNode(0);
        }
    }
}

Overridable methods

ExecuteNode

Gets called upon node execution. Usually this is where you want to add your code.

InitNode

Gets called upon graph initialization at runtime

CustomGUI

Override this method to return a custom UI for your node.

EditorInitialize

Gets called on node editor start-up.

SelectNode

Gets called when node gets selected.

DeselectNode

Gets called when node gets deselected.

Node Attributes

All node properties such as title, color, icon or outputs are defined with class attributes. Please read following documentation for a list of all available node attributes.

PreviousControl flow execution in groupsNextAsynchronous execution

Last updated 1 year ago

Node Attributes