c# - Using namespace in Unity hides functionality -
using unity 5.4 beta hololens, setting class within namespace disables unityengine functionality.
if declare class, works fine. if wrap inside namespace, classes don't see each other, within same namespace or using addition.
making class monobehaviour, can drag , drop onto game object, if wrap class inside namespace, unity complains not mb or has issue cannot dragged.
does have similar issue? asking before reporting bugs since 5.4 still beta.
classes
don't see each other because not importing them or accessing them through namespace
. access in namespace, must import
namespace
or call namespace
followed class
name. check below both examples.
class namespace:
namespace myanamespace { public class { } }
in order see class a
, have import using
keyword.
using myanamespace; public class b : monobehaviour { a; // use initialization void start() { = new a(); } }
another method access them directly through namespace
.
public class b : monobehaviour { myanamespace.a a; // use initialization void start() { = new myanamespace.a(); } }
if not solve problem, have post code. that's not bug.
Comments
Post a Comment