Here is an error “BCE0004: Ambiguous reference ‘SaveOption’: SaveOption, SaveOption.”
I defined an enum SaveOption in a script SaveOption.js
How to use it in another class?
enum SaveOption
{
SaveToFile,
SaveToServer
};
Another class Scene.js
class Scene
{
//New scene
static function New(data:Hashtable)
{
print("new scene");
}
//Open scene
static function Open(data:Hashtable)
{
print("open room");
}
//Save scene
static function SaveAs(str:String,type:SaveOption)
{
switch(type)
{
case SaveOption.SaveToFile:
break;
case SaveOption.SaveToServer:
break;
}
}
}