Blend js and c# files?

Is it possible to have both js and c# files in the same project and have them communicate with each other (ie manipulating each others variables, calling each others functions, etc)?

I don’t see why not, considering they’re doing the same thing, but they’re just in different languages… I mean I could be wrong as I’ve never done it myself, but they’re just functions. Just they’re in different languages.

Well, yes and no.
This is poor practice, and it’s limited to one-way communication.

In other words, this is not actually viable.

Actually you can use SendMessage for both ways if you need to, and many times you don’t even need two-way communication anyway. I sometimes have C# “library/helper” scripts (usually because of needing to be able to explicitly use ref and out parameters) and everything else is JS. For general usage though it’s indeed easier if you stick to one language.

Anyway, Unity - Scripting API:

–Eric

Thanks guys!

I’m midway into a js-based project but am more comfortable with c#. I guess I’ll wait until the next project to make the switch, though, but it’s good to know the alternative is there.