- Home /
Does Unity support extension methods?
I'd like to use an extension method on a c# generic list for managing a node system but before I start does anybody know if Unity Supports them?
Answer by Bunny83 · Jul 24, 2011 at 08:30 PM
The answer is yes. Unity uses plain C# with mono. As far as i know the only thing you can't use is unsafe code but when you have Unity pro you can use native code plugins as well.
Answer by Blankzz · Jul 24, 2011 at 06:05 PM
Maybe I should have searched first. I've looked at a few threads and its seems the answer is YES :)
Answer by sneftel · Jul 24, 2011 at 08:52 PM
One caveat you should be aware of, even though it probably won't cause you any problems: Unity strips namespaces from assemblies that it loads. Everything goes into the default namespace and is thus globally using
'd. So your extension methods will be visible from every script in your project.
I don't think it will cause me any problems with what I'm planning but sounds like it could cause a lot of problems with na$$anonymous$$g conflicts. Am I right in thinking that namespaces will be possible in a future release?
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Turning pieces of code into a method 1 Answer
Prime31 Gamecenter Crash when triggering method 1 Answer
Flip over an object (smooth transition) 3 Answers