C# Main Menu and Javascript Game... Help

I have coded main menu with C# long ago and i have my finished game with JavaScript. Now i got some couple of Boolean i need to keep from C# to be transferred into JavaScript… how am i able to do that?

this is what i tried so far…

public var current_P1 : boolean = false;
public var current_P2 : boolean = false;
public var current_P3 : boolean = false;
public var current_P4 : boolean = false;

public var currentSound : boolean = true;
public var currentMusic : boolean = true;

function Update()
	var other : myMenu;
	other = gameObject.GetComponent("myMenu");
	current_P1 = other.player_1;
	current_P2 = other.player_2;
	current_P3 = other.player_3;
	current_P4 = other.player_4;
	currentMusic = other.music;
	currentSound = other.sound;

function Awake()

It is possible to use both languages, but you need to place them in specific folders within your project, then 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. Read this link, especially Point 3 :


=> point 3 … This allows you to let different scripting languages interoperate. For example, if you want to create a Javascript that uses a C# script: place the C# script in the “Standard Assets” folder and the Javascript outside of the “Standard Assets” folder. The Javascript can now reference the C# script directly.

However, it would be more prudent of you to convert the scripts and use just one language, eg choose C# or uJS for your project. Then you will never have the problem of one language not being able to see the other. Also if you convert the scripts, you will actually learn how to read both uJS and C# !

Here’s some links I found useful in converting between C# and uJS :


after what been said i thought like this; if C# can not communicate with JS then i should use unity to communicate from C# to JS…

so basically my boolean where toggle buttons and when been clicked it calls a game object (i created one for each boolean) and changes the name to true or false.
and then on the other script it checks the name with an if statement and set the boolean.
here is an example of what i made…

if(music == true)
			forMusic = musicOn;
			boolMusic.name = "musicTrue";
			forMusic = musicOff;
			boolMusic.name = "musicFalse";

then in my other script i did this.

public var boolMusic : GameObject;

if (boolMusic.name == "musicTrue")
		currentMusic = true;
		currentMusic = false;