JS Enumerated Variables

I know how to make a nice enumerated list of options in a C# script by declaring an enumeration as a public variable with the list of options eg

public enum Mode {
		Trigger   = 0, // Just broadcast the action on to the target
		Replace   = 1, // replace target with source
		Activate  = 2, // Activate the target GameObject
		Enable    = 3, // Enable a component
		Animate   = 4, // Start animation on target
		Deactivate= 5 // Decativate target GameObject
	}

But does anyone know how to get the same thing in JS script? C# just doesn’t behave as nicely with raycasting I’ve found.

Just leave out “public”.

–Eric

That doesn’t seem to be working. eg

enum Mode {
	Video = 0,
	Audio = 1
}

doesnt work

It does work, actually. :slight_smile:

–Eric