Access script from a namespace
Hello I just came across a situation: I'd like to have access to a class i wrote, which I didn't included in any namespace, from the script ThirdPersonUserControl (from standard assets), which is in the namespace UnityStandardAssets.Characters.ThirdPerson.
The problem is the class name is unknown, as if i was missing a "using". So I was wondering if there is a default namespace for the scripts created in unity, or if there is another problem in what i did, that i'm not aware of? I didn't find topics answering it. Thanks!
Answer by UnityCoach · Jan 15, 2017 at 03:50 PM
There is no default namespace for the classes you define. If you didn't put your class in a namespace, it should be available from any other class.
Are you modifying the script ThirdPersonUserControl and want it to handle your custom class?
Actually i was trying to access a static variable of my other script, from thirdpersonusercontrol. $$anonymous$$y other script is not in any namespace though.
You would only need to access it like :
$$anonymous$$yCustomClass.theStaticProperty
yes, the problem being that $$anonymous$$yCustomClass is unknown, although I use it in my own other scripts without any trouble.