- Home /
Question by
mremus · May 07, 2013 at 07:15 PM ·
c#javascriptngui
Change value of javascript variable with NGUI button
I have a NGUI button that I would like to have change the value of a javascript variable when clicked. My javascript variable is named BeginMission and set to "false" in a javascript called Mission_Control.js I have attached a C# script called BeginMissionBtn.cs to the NGUI button. Since I am new to scripting I am confused as to what my code in BeginMissionBtn.cs should be to change the value of BeginMssion to "true" once the button is clicked. I know I should use the OnClick function, but I don't understand how to address/access the javarscript variable's value. Could someone help out with this please.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613101756im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Calling Javascript Method fron C# NGUI 1 Answer