Lets say I have a script on my main camera that I use to store important classes:
public class ImportantStuff : MonoBehavior {
public class foo {}
public class bar {}
}
I want to use this in another script on a different object like this:
using ImportantStuff;
public class otherThing : MonoBehavior {
foo.randomMethod();
bar.randomMethod();
}
Instead, I’m being forced to do this:
public class otherThing : MonoBehavior {
ImportantStuff.foo.randomMethod();
ImportantStuff.bar.randomMethod();
}
Does anyone know if this is possible? Writing out the class name each time I need to use it seems too inefficient to be the correct way of referencing other classes, especially when ImportantStuff will have to be used a huge number of times over all my other scripts. Even if this is not possible, is there any way of shortening the statement so I can do something like what python does (psuedo code because I forget python syntax):
const is = using(ImportantStuff);
public class otherThing : MonoBehavior {
is.foo.method();
is.bar.method();
}
Thanks for any help!