I am organizing my unity project into namespaces, and want to hide the classes that are used only inside the namespaces. I define the namespace MyProject.Accounts and place an internal class there:
namespace ProjectName.Accounts
{
internal struct PictureData
{
internal int notSeenMember;
}
}
Then i add the using ProjectName.Accounts
to a file in ProjectName.LoginScreen
namespace, and i am able to see the class through the Intellisence, and instanciate it, but not to use the notSeenMember
member:
The MS says that :
Internal types or members are accessible only within files in the same assembly
.
Is being able to instanciate internal classes from other namespaces an expected behavior?
EDIT: you can also access the internal members