- Home /
C# Internal members (when not inside a DLL) in Unity become public: any workaround?
Hello,
I just discovered that, if you're using open-source C# classes in Unity, even if you use namespaces (thus successfully requiring using MyNamespace directives for your classes) all internal members are considered public!
This is a terrible thing: anybody knows a workaround (without compiling to a DLL - I need the code to stay open)?
Answer by Demigiant · Sep 10, 2014 at 10:10 AM
Here's a very late answer, but I discovered this lost question of mine and thought I'd complete it.
This was a silly question: since I was coming from ActionScript I had completely misunderstood how internals work in C#. Simply put, the internal keyword makes things "public" for the whole assembly that defines it. Since Unity compiles all your lose code in a commmon assembly (but for a few exceptions) all internal members among your lose code become accessible.
In short: no workaround other than rolling your own assemblies.
Your answer

Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
An OS design issue: File types associated with their appropriate programs 1 Answer
Problem with Write Access 0 Answers