Enum support - sonygod/luaxe-nlua GitHub Wiki

current version support base Enum

function testEnum(tt:MyAnimationBlendMode) {
			switch(tt) {
				case MyAnimationBlendMode.Additive:
				trace("ok!!!!!!!!,support !additive");
				default:
				trace("default");
			}
		}

enum file

enum MyAnimationBlendMode {
  Blend;
  Additive;
}

and lua

function testcase_VectorTest_VectorTest:testEnum(tt)
		if ( tt[1] == 1) then
			Debug.Log("ok!!!!!!!!,support !additive")
		else
			Debug.Log("default")
		end
	end
	
	
testcase_VectorTest_VectorTest.__props__ = {};


testcase_VectorTest_MyAnimationBlendMode = {__super__ = Enum}

testcase_VectorTest_MyAnimationBlendMode.new = function(tag,index,params) return setmetatable({
	[0] = params[0],
	[1] = index,
	tag = tag,
	index = index,
	params = params
},Enum) end

testcase_VectorTest_MyAnimationBlendMode.Additive = setmetatable({[0]="Additive", [1]=1},Enum);
testcase_VectorTest_MyAnimationBlendMode.Blend = setmetatable({[0]="Blend", [1]=0},Enum);


end