- Home /
Send a variable from javascript to a C# Application
Before i start writing a service in C# to listen for input, i would like to know if its even possible since there's not allot on the internet about it.
I have a unity game where if you press the action key, a JavaScript runs, which should send a variable to a c# application to start a voice recording application. Then if it released, it should send one again to stop the the recording.
Is this possible? Or Better yet, is this even practical?
It's possible, but mixing script types is not recommended.
it is possible to use both languages, but the way they compile means that they only work one way i.e. C# gets compiled before JS, JS can see C# but C# cannot see JS :
http://docs.unity3d.com/Documentation/ScriptReference/index.Script_compilation_28Advanced29.html => point 3
http://answers.unity3d.com/questions/208383/referencing-a-c-component-script-from-js-script.html
http://answers.unity3d.com/questions/243112/calling-c-classes-from-js.html
Here's some links I found useful in converting between C# and JS :
http://answers.unity3d.com/questions/12911/what-are-the-syntax-differences-in-c-and-javascrip.html
ohh oky i get, Thank you. ill go though those links and examples and update my answer on what i did, and if i got it to work
Your answer
Follow this Question
Related Questions
What should i learn for unity C# or UnityScript? 4 Answers
How to measure ad impressions in In-Game Ads? 0 Answers
Flying AI Planes 0 Answers
Randomly Generated Objects 1 Answer
How would I go about carrying out another object's animation IN C#! 1 Answer