Link to home
Start Free TrialLog in
Avatar of user4578
user4578

asked on

Unity3d: Change value of the variable in C# script from UnityScript JS

Hi,

The entire game was programmed in Unity3d with UnityScript(JS), however one C# script was included (GameCenter integration).

At the moment Game Center Script (C#) is attached to the First Scene Object (not destroyable object, not sure if it needs to be not destroyable, please advise).

In another scene, where GameOver is happening, when GameOver is triggered, the attached UnityScript(JS) has to be able to change Variable in the C# script (from false to true).

(Once the Variable in C# changes to true, score is being submitted to Game Center with the help of C# script.)

Changing variables from one UnityScript in another is not a problem, but how to change variable in C# from the UnityScript?

In Unityscript it would be something like that:
GameCenterJS.gameOver = true;

But it doesn't work as
GameCenterCS.gameOver = true;

What is the proper way to do it?

Thank you for your advice
ASKER CERTIFIED SOLUTION
Avatar of Hans Langer
Hans Langer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial