- Home /
Question by
user-3061 (yahoo) · Dec 21, 2010 at 07:57 AM ·
c#javascriptscore
Adding scores/numbers?
Hi, im a beginner at unity scripting. I have a script in javascript with a line
static var MyScoreCounter : int = 10;
then i have another script in Csharp script with a "Die" function. How do i add score to the first javascript when the Die function is called in the csharp script? Thanks!
Comment
Best Answer
Answer by Mike 3 · Dec 21, 2010 at 08:00 AM
Assuming the javascript file is in an earlier compilation pass folder (if not, put it in a folder called Plugins in the project hierachy, make it if you need to), just use
YourJavascriptFileName.MyScoreCounter += 1;
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
how do i attach GUITEXT to a prefab 1 Answer
Multiple Cars not working 1 Answer
After I initially add score it keeps adding. 2 Answers
Problem Javascript to C# 3 Answers