pkdawson / imgui-godot

Dear ImGui plugin for Godot 4
MIT License
494 stars 28 forks source link

State: explicitly use internal state #82

Closed Garteal closed 3 months ago

Garteal commented 3 months ago

Explicitly uses the ImGuiGodot.Internal State instead. Fixes name clashing if a project already has a State.

pkdawson commented 3 months ago

There shouldn't be a conflict unless there's a class called State in the global namespace. C# code should always be namespaced to avoid exactly this kind of problem.

Since C# 10 you can just stick namespace MyGameName; or whatever at the top of your .cs files. Godot will find your classes in any namespace.

Garteal commented 3 months ago

And that's exactly the setup I have right now. Of course it's better to namespace the whole thing, but IMO it should not be explicitly required. And IMO an external library/addon/whatever shouldn't cause this kind of name clash.