- Home /
It is posible to add a [RequireComponent (typeof( xxxx ))] but with Global Fog ?
It is posible to add a [RequireComponent (typeof( xxxx ))] but with Global Fog ? I'm trying it, but I can't do find the Global Fog by script... (screenshot) http://puu.sh/rPDoN/05fd5d58b7.jpg I have a test adding the UnityStandardAssets.ImageEffects but doesn't work neither...
Basically my problem was solved making the class GlobalFog public... I don't like this fix so, what is the best way to overcome this issue?
Answer by Naphier · Oct 21, 2016 at 02:58 AM
Not sure why the GlobalFog class would not be public. The only time I've made private classes are when they are classes within a class. I don't like how a lot of the standard assets are weird like this. However, I think what Unity is trying to do is to force you to copy these classes out of the Standard Assets and make your own class. Pretty annoying. Not even sure how it serializes properly being a private class...
So in short, to use the GlobalFog class outside of the same file it is in you'd need to make it public like you've done. Or make your own copy of it.
Answer by BatStudios · Oct 21, 2016 at 07:28 AM
Thanks @Naphier. It's a weird way to do it but I suppose I will create my whole GlobalFog class, thanks for the answer.
It's not a weird way to do it. Unity making that class private is what's weird. ;)