Accessing javascript component from c# ?

I have some third party addon, written in javascript - it is a component, which I added to a game object and all I want to access component functions from c#. I have searched the web and found suggestions to copy javascript in standard assets folder. It is unacceptable way, because I am not going copy tens of javascript garbage files in standard assets, which will be a big pain in ass as my project grows. Is there any easy way to call damned javascript shit from c#?

The answer you found regarding Standard Assets is the way. The reason for this is because if you have C# code that depends on Javascript, the Javascript must be compiled before the C# that uses it. The C# and the JS use different compilers, so you can’t compile them simultaneously, which you would need to happen if they were in the same ‘scope’ (technically, project).

Personally, I port certain javascript components to C# when I want them to be part of my main assets. If I want to use an entire JS library, or a third-party script or component that I don’t have a reason to change, I just suck it up and put it where it has to go to work. You can generally keep all the files in their own sub-folder to keep things neat.

Do note that if you need your C# code to access JS code that accesses C# code, you’re going to run into problems. I sense you’re headed that way.