Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Usage diagram (UML)

Discussion in 'Code Editors & IDEs' started by Tayfe, Jul 24, 2022.

  1. Tayfe

    Tayfe

    Joined:
    Nov 21, 2011
    Posts:
    103
    Hey guys,

    Due to very fast developing during the last 2 years our app's code base is a big mess! So now that we have time for cleanup we would love to start by visualizing our current mess using something like a "usage diagram" like UML. Do you know if there are any tools that can display our current C# code as UML diagram including usage?

    I know that there are some programs or extensions that visualize the dependencies of Assembly Definitions or dependencies of classes when using inheritance.
    But our code is a mess and uses almost exclusevly usage (e.g. GameManager.instance.StartGame()). We want to refactor everything so that we can finally use Assembly Definitions as they make sure that our code becomes more modual. But to get to this point we would like to visualize which class uses which other classes to get a better overview and a point to start the cleanup from. So does anybody know about such a program/extensions/whatever that can also display usage?

    Greeting :)
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,583
  3. Tayfe

    Tayfe

    Joined:
    Nov 21, 2011
    Posts:
    103
    We use Rider :) But how can it visualize usages? I haven't found this feature yet
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,583
    I think it's under Tools => Architecture Diagram or something like that.
    It creates a class diagram with dependencies of assemblies. Thinking about it, if the entire codebase is in the same assembly it may not be too useful.
     
  5. Tayfe

    Tayfe

    Joined:
    Nov 21, 2011
    Posts:
    103
    Yes that's exactly our problem so I guess this won't help us yet.
     
  6. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,583
    Check out documentation libraries like doxygen and similar. Doxygen with graphviz enabled can generate a dependency diagram if I remember correctly. You'd still have to navigate to each class though.

    There are also dependency management products out there, NDepend comes to mind.