Trouble with globals.

I read the docs on globals, but I can’t seem to get them to work.

I have

WeaponSelect.js
enum WeaponType { SemiAuto, FullAuto };
static var SelectedWeapon = WeaponType.SemiAuto;

function Update () {
}

In another js file I try

	switch(WeaponSelect.SelectedWeapon)
	{
		case WeaponType.SemiAuto:
			ShootSemiAuto();
			break;
		case WeaponType.FullAuto:
			ShootFullAuto();
			break;
		default: break;
	}

But I get the errors “Unknown identifier WeaponSelect/WeaponType”.

I guess the script file isn’t being found? Anyone have any idea what the issue could be?

The code works fine for me. You prolly saved the WeaponSelect script in a folder which is compiled after the second script.

I tried making a folder called A and put the WeaponSelect script in there. Then I made a folder called B and put everything else in there. Still no dice :frowning:

How can I configure the order the folders get compiled in?

Edit: Ok I put the WeaponSelect script in standard assets, since I found out that’s one of the 1st folders compiled, and it worked.