Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to display large graph in an EditorWindow

Discussion in 'Immediate Mode GUI (IMGUI)' started by lvictorino, Nov 10, 2015.

  1. lvictorino

    lvictorino

    Joined:
    Jul 9, 2012
    Posts:
    31
    Hi there,
    I'm working on a small Editor plugin that handles very large navigation graphs (composed of more than ten thousands of nodes).

    I need the Editor Window to be able to zoom-in / zoom-out and change nodes properties for various needs.
    I naively thought that a combination of GUILayout and Handles.DrawLine calls would be enough but it appears that, in the ends, both have limitations and are very slow and not adapted to my needs (even on my super-fast computer).

    I wonder what other choices I have. I imagine that you guys will propose to generate meshes instead of drawing lines using Handles, but I just can't see how to display the mesh without being in the scene view and not messing with my actual game scene. What would you do, and how ?

    Here is the kind of navigation graph I'm dealing with :



    Thanks for your help.
     
  2. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,303
    Have you tried GL.Lines?

    Not sure if it's more performant, never had to deal with that many lines!
     
  3. lvictorino

    lvictorino

    Joined:
    Jul 9, 2012
    Posts:
    31
    I finally went with the mesh generation: I generate a line for every street.
    Also, I use a dedicated Unity Scene with custom editor scripts in order to interact with it.

    mapmesh.gif