Home
  • Manual
  • Node Index
  • API
  • Changelog
Show / Hide Table of Contents
  • Tutorials
    • Creating your first map generator
      • 1. Creating your first map graph
      • 2. Running a graph at runtime
      • 3. Adding more nodes
      • 4. Object placement
    • Basic map types
      • • Cave-like maps
      • • Room-based maps
      • • Sample-based maps
      • • Combining map types
    • More Tutorials
      • • Using prefabs instead of tilemaps
      • • Changing tile/prefab/tilemap set probabilities (weighted random)
      • • Linking a named color set to tilesets/prefab sets
      • • Organizing nodes into groups
      • • Adding notes & comments
      • • Running a graph within a graph (Sub graphs)
      • • Tilemap Sets
      • • Optimization tips
      • • Static seed (daily challenges)
      • • Running a graph asynchronously/multi-threaded
      • • Object pooling
      • • Tips for rule tiles
      • • Saving and loading maps
    • Tutorials for coders
      • • Running graphs from scripts
      • • Output parameters
      • • Creating your own nodes
      • • Creating your own node views
      • • Adding a constant node type
  • Sample Project
  • Troubleshooting
  • Support

Running a graph within a graph (Sub graphs)

Running a graph within another graph can be very useful, if you want to use the same sequence of nodes multiple times in the same or multiple different graphs.

To run a graph as a sub graph it needs to be added to the node creation menu. You can do this, by selecting the graph file inside of the project window and enabling the "Show in node menu" option.

Graph inspector

The graph will now show up as a node in the node creation menu, under the path specified in the "Menu Path" field.

Node Creation Menu

Graph nodes are prefixed with a "(G)", to distinguish them from regular nodes.

Map Graph also ships with a number of subgraphs, that can be used for common situations. You can find this in the node creation menu and will also be prefixed with a "(G)".

Avoid circular processing

Make sure you don't have graphs process each other in a circular manner, as described here in the the troubleshooting section.

In This Article
Back to top Generated by DocFX