Home
  • Manual
  • Node Index
  • API
  • Changelog
Search Results for

    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
        • • Generating prefabs
        • • Tile/prefab/tilemap set weights
        • • Syncing named color sets
        • • Groups
        • • Notes & comments
        • • Sub graphs
        • • Tilemap Sets
        • • Optimization tips
        • • Static seed (daily challenges)
        • • Running a graph asynchronously or multi-threaded
        • • Object pooling
        • • Tips for rule tiles
        • • Saving and loading maps
      • Tutorials for coders
        • • Running graphs from scripts
        • • Output parameters
        • • Custom nodes
        • • Custom node views
        • • Adding a constant node type
        • • Custom styling for the graph editor
        • • Dependencies for custom nodes
    • Sample Project
    • Troubleshooting
    • Support

    Custom styling for the graph editor

    You can customize the look of the graph editor by creating your own stylesheets. This allows you to change the appearance of the nodes, groups, and connections in the graph editor.

    A common use-case for this is if you introduce a custom node that has a port for a specific type of data, that isn't covered by the default styles, you might want to change the color of the port to make it stand out.

    In order to create a custom stylesheet for Map Graph, simply create a new USS file in a Resources folder anywhere inside the assets folder and call it MapGraph. Any USS file called MapGraph will be automatically included in the graph editor.

    For example, in order to set the color of a port for a type called CustomType, you can add the following to your MapGraph.uss file:

    .port.CustomType {
        --port-color: #8A93EB;  
    }
    

    You can replace the color value with any color you'd like.

    Another example is that you can make your ports look square instead of round, like this:

    .port.CustomType > #connector,
    .port.CustomType > #connector > #cap {
        border-radius: 0;
    }
    

    These are just two simple examples though, you can make any kind of change that's supported by Unity. For more information on styling possibilities, you can check out the Unity docs here.

    In This Article
    Back to top Generated by DocFX