AceLand Unity Packages
  • Home
  • Getting Started
    • Installation
    • Project Settings
    • Architecture Graph
    • Development Level
  • Tutorial
    • Create Your Package
    • Create Project Settings
  • Packages
    • Library
      • Change Log
      • Editor Tools
      • Mono
        • Follow Object
        • Singleton
      • Attributes
        • Conditional Show
        • Inspector Button
        • ReadOnly Field
      • Build Leveling
      • CVS
      • DataTools
      • Disposable Object
      • Extensions
      • Json
      • Kalman Filter
      • Optional
      • Project Setting
      • Serialization Surrogate
      • Utils
    • Event Driven
      • Change Log
      • Event Bus
      • Signal
    • Input
      • Change Log
    • Memento Service
      • Change Log
    • Node Framework
      • Change Log
      • Mono Node
    • Node For Mono (dev)
    • Player Loop Hack
      • Change Log
    • Pool
      • Change Log
    • Security (dev)
    • States
      • Change Log
    • Task Utils
      • Change Log
    • WebRequest
      • Change Log
Powered by GitBook
On this page
  • In One Line
  • Overview
  • Package Info
  • Key Features
  • Graph
  • Why Use It
  • Creating Nodes
  • Managing Relationships
  • Navigating the Hierarchy
  • Node Access
  • Important Notes
  1. Packages

Node Framework

Node base programming for Unity

In One Line

Node Forest: Because trees shouldn't limit your imagination!

Overview

The Node Framework is a powerful, type-safe system for creating and managing hierarchical relationships in your Unity projects. It provides an intuitive way to build parent-child relationships between objects while maintaining strong typing and safe runtime operations.

Package Info

display name

AceLand Node Framework

package name

latest version

1.0.19

namespace

git repository

dependencies

Key Features

  • Type-Safe Hierarchy: Build and manage parent-child relationships with compile-time type checking

  • Fluent Builder Pattern: Easy-to-read node construction using builder syntax

  • Automatic Memory Management: Built-in disposal system for clean resource management

  • Rich Navigation APIs: Extensive methods for traversing and manipulating node hierarchies

  • Async Support: Built-in async operations for safe node access

  • Flexible Node Identification: Automatic GUID generation with optional custom IDs


Graph


Why Use It

Traditional node systems often constrain you to a single-root tree structure. Our Node Framework breaks free from these limitations, offering a "Node Forest" approach that perfectly aligns with Unity's GameObject-Component architecture.

Global Accessibility

The framework automatically registers all nodes upon creation, enabling powerful node access:

  • Access any node globally using ID and type

  • Navigate nodes through relationships within the same tree

  • No manual registration or reference management needed

Key Benefits:

  • Flexible Structure: Build nodes without root constraints

  • Freedom to Design: Create individual node trees or complex node networks

  • Unity-Friendly: Seamlessly integrates with GameObject hierarchy

  • Auto-Registration: Nodes self-register on creation for immediate availability

  • Extensible Design: Easy to extend and customize for your specific needs


Creating Nodes

// Define your node type
public class MyNode : Node<MyNode> { }

// Create a node using the builder pattern
INode<MyNode> yourNode = Node<MyNode>.Builder()
    .WithId("customId")  // Optional: Provide custom ID
    .Build();

Managing Relationships

// Create parent and child nodes
INode<MyNode> parent = Node<MyNode>.Builder().Build();
INode<MyNode> child = Node<MyNode>.Builder()
    .WithParent(parent)  // Set parent during construction
    .Build();

// Or manage relationships after creation
yourNode.SetParent(parent);
yourNode.AddChild(child);

Navigating the Hierarchy

// Access relationships
INode parentNode = yourNode.Parent();
INode rootNode = yourNode.Root();
IEnumerable<INode> children = yourNode.Children();

// Type-safe navigation
MyNode typedParent = yourNode.Parent<MyNode>();
IEnumerable<MyNode> typedChildren = yourNode.Children<MyNode>();

// Find specific children
MyNode firstChild = yourNode.Child<MyNode>();
MyNode namedChild = yourNode.Child<MyNode>("specificId");
IEnumerable<MyNode> allChildren = yourNode.ChildrenInAllLevel<MyNode>();

Node Access

// Safely wait for node availability
MyNode node = await Node<MyNode>.GetAsync();
MyNode specificNode = await Node<MyNode>.GetAsync("specificId");

// Get an available node instant
MyNode node = Node<MyNode>.Get();
MyNode specificNode = Node<MyNode>.Get("specificId");

Important Notes

  • Nodes are automatically registered in a type-based registry

  • Each node has a unique ID (auto-generated if not specified)

  • Nodes implement IDisposable for proper cleanup

  • Async operations have configurable timeouts

Last updated 3 months ago

While you have the freedom to structure nodes as needed, we recommend maintaining logical tree structures for better organization and maintainability. For GameObject-specific implementation, see the "" page.

com.aceland.nodeframework
AceLand.NodeFramework
AceLand.NodeFramework.Mono
com.aceland.library: 1.0.11
com.aceland.taskutils: 1.0.5
Mono Node Framework
https://github.com/parsue/com.aceland.nodeframework.git