Is there a way to import or include a file into a different file using javascript?
It would be easiest for me to do what I am trying to accomplish by using this method.
Is there a way to import or include a file into a different file using javascript?
It would be easiest for me to do what I am trying to accomplish by using this method.
No, as far as i know there is no support for any of those pre-processor functions except #if #else #endif and even those only with predefined constants.
you access other scripts in your project by using GameObject.Find or GameObject.FindWithTag to get the object the script you’re trying to access is attached to, then use GetComponent() on the returned object reference to get a usable reference to the script.
aside from that, there’s no real concept of #include in Unityscript like there is in C/C++. whatever you’re trying to do, there’s probably a better way to do it here.
i’d highly recommend you go through the scripting docs to get a good idea of how to program in Unity, as it may be a bit different from what you’re used to.
What do you mean with "include"? You can simply access classes of other files by name.
– anon46022118