static int GetBattery(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); NativeManager obj = (NativeManager)ToLua.CheckObject(L, 1, typeof(NativeManager)); float o = obj.GetBattery(); LuaDLL.lua_pushnumber(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }