- Home /
C# private/public
In Unity3D, using C#, what's the default member variable if none is specified?
Answer by Hibame · Oct 14, 2010 at 08:50 AM
C# should have private by default on member variables if no access level is defined
Answer by mert · Oct 14, 2010 at 01:20 PM
I believe it's a 'protected internal' accessor as in generic C#, although not sure if Unity changed that.
Here's a def about Protected Internal from MSDN:
"The type or member can be accessed by any code in the assembly in which it is declared, or from within a derived class in another assembly. Access from another assembly must take place within a class declaration that derives from the class in which the protected internal element is declared, and it must take place through an instance of the derived class type."
It's private in both versions, protected internal is used for the default class accessibility
Your answer
Follow this Question
Related Questions
nexpected symbol 'public' in class, struct, or interface member declaration. 1 Answer
C# - public variable not exposed to the Project Panel? (n00b to c#) 1 Answer
Variable value persists when public but is lost between frames when private 1 Answer
Activate public bool from other script 1 Answer
Has anyone had success with Facebook's graph API in Unity's Flash export? 1 Answer