Global Namespaces #1294
Replies: 2 comments 2 replies
-
Very neat stuff. I may very well be alone in this but there always has to be that one guy ー I've personally never really understood the appeal of having it just be |
Beta Was this translation helpful? Give feedback.
-
Could we get the same treatment for |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
A feature of net6 that we pushed yesterday is global namespaces.
We're taking advantage of this. By default every addon will include this statically in their global namespace.
(this is akin to adding
global using static Sandbox.Internal.Game.GlobalNamespace;
in one of your addon's .cs files)This means that
DebugOverlay
andGlobal
aren't static classes anymore - which means they can be extended with your own functions. But usage stays exactly the same.We'll probably move more things like this over in time. I'm considering whether to move IsServer, IsClient etc to this class too - so that checking then is just
if ( IsServer )
instead ofif ( Host.IsServer )
etc.. let me know what you think of that possibility.Beta Was this translation helpful? Give feedback.
All reactions