Hi, is it possible for an Editor script which shares the same namespace as its target Component to access an internal variable in that Component? doesn't seem to work. Code (csharp): namespace MyNameSpace { public class Test { internal float hello; } } namespace MyNameSpace { [CustomEditor (typeof(Test))] public class TestEditor : Editor { void OnEnable() { Test test = target as Test; float hello = test.hello; //cannot find variable "hello" } } }
Same Namespace, but different Assembly. I doubt it will work. You can always get that field by reflection. Nothing is hidden to reflection.
Yes, you right! I'm not sure about Unity evironment, but in common .NET attribure [TypeForwardedFrom] could be usefull in this case - http://msdn.microsoft.com/en-us/lib...ces.typeforwardedfromattribute(v=vs.110).aspx ;-)