Generate class diagram from code

Hello!
For some time now i’ve been looking for a good way of visually representing my C# classes dependencies and relationships to eachother but not really finding any tool that does the trick for me.

I have tried with Visual Studio but the best it seems to be able to do is class diagram based on inheritance, and since most of my classes just inherit MonoBehaviour, this doesn’t give much information.

So basically what im looking for is a way of generating, from existing code, a Class Diagram that reflects the relationship between my classes. For example:

Class A has a reference to and utilizes methods in Class B, so changing Class B could potentially alter the behaviour of Class A, visualizing this would help greatly in larger projects and especially if introducing new people to the project.

2 Likes

I’ve looked for similar things with no luck before myself. Doxygen is supposed to have some kind of diagrams, but I’ve never been able to coax it to make anything useful.

1 Like

I’ve also tried Doxygen, but it only generates inheritance diagrams for me, even when using Graphviz which should have the diagrams im looking for.

http://forum.unity3d.com/threads/184142-100-FREE-Released-Code-Architecture-Editor-Extension
Seems its not supported anymore but maybe its a starting point.

NClass is open source. You might be able to modify it to do this.

1 Like

I’ve looked into NCLass before but from my understanding that is more for making class diagrams ahead of time rather than generating them from existing code.

As for the tool exiguous linked, I’ll check it out

NClass is the only free one I know of (other than Code Architecture that exiguous linked, and Visual Studio for indies). It has a plugin that can generate UML from .NET assemblies. There are commercial solutions, though, like Altnova and VP.

I followed this tutorial for Doxygen and I got it working! And this might help as well.

1 Like

I want this too, if someone makes this plugin, I will buy it

2 Likes