A tool for generating UML diagrams from C# code, designed to work seamlessly with Godot and .NET projects. UMLGenerator simplifies visualizing complex class hierarchies, and relationships through automated diagram creation.
UMLGenerator produces PlantUML .puml
files from your codebase, enabling easy visualization of:
- Class inheritance trees
- Component relationships
- Method call dependencies
The generated diagrams are placed alongside source files with the *.g.puml
extension, ready for rendering with PlantUML, VSCode extension, or the Jetbrains plugin.
- Automatic diagram generation from tscn and C# code
- Integration with Godot.NET projects
- Real-time visualization via IDE plugins
- Install the UMLGenerator package from nuget
- (Optional) Add
<AdditionalFiles Include="**/*.tscn"/>
to the csproj so that all .tscn files within the project directory are found (may want to exclude addons) - Add
[ClassDiagram(UseVSCodePaths = true)]
attribute to classes.- If you use Jetbrains Rider, either remove UseVSCodePaths, or set it to false
using Chickensoft.UMLGenerator
public interface IGame
{
void StartGame();
void LoadGame();
void SaveGame();
}
[ClassDiagram(UseVSCodePaths = true)]
public class Game : Node, IGame
{
public IGameRepo GameRepo { get; set; } = null!;
public IGameLogic GameLogic { get; set; } = null!;
// ... (implementation details)
}
- Build your project
- Open the generated
.g.puml
files
This would generate a PlantUML file showing:
- Class relationships
- Interface implementations
- Method signatures
Generated .puml
files can be visualized using PlantUML. For example:
classDiagram
Game --> GameRepo
Game --> GameLogic
class Game {
void StartGame()
void LoadGame()
void SaveGame()
}
class GameRepo {
}
class GameLogic {
}