Skip to main content

14 — Settings

Field contract for Project Settings → ZLua. Asset: ProjectSettings/ZLua.asset. Menu ZLua/Settings... opens the same page. Usage: Settings (guide).


1. Storage​

ItemRule
TypeZLua.Settings (ScriptableSingleton)
PathProjectSettings/ZLua.asset
Missing fieldsFields not yet serialized in the asset use C# field initializers (bool is false, references are null)
When it takes effectEditor writes immediately. Il2Cpp bindings that depend on XML are baked at ZLua/Generate/All; re-Generate after changing XML paths or the Unity optimizations switch

2. Fields​

FieldTypeDefaultMeaning
enablebooltrueWhether ZLua is enabled. Whether the current build target is enabled: Settings.EnableForCurrentBuildTarget
luaVersionIdstringlua-5.5.0PUC-Rio: lua-X.Y.Z; LuaJIT: luajit-M.N; Luau (luau branch): luau-M.N (e.g. luau-0.743). Empty string means lua-5.5.0. Details: 11-MULTI-VERSION.md
marshalAsXmlPathsstring[]emptyMarshalAs XML files or directories (relative to the project root or absolute). Root element ZLuaMarshalAs. See marshal/02-MARSHAL-AS.md
luaAliasXmlPathsstring[]emptyLuaAlias XML files or directories. Root element ZLuaAlias. See 04-METHOD-OVERLOAD.md §5.4
luaExtensionXmlPathsstring[]emptyLuaExtension XML files or directories. Root element ZLuaExtensions. See 13-EXTENSION-METHODS.md
enableUnityOptimizationsbooltrueMaster switch for Unity optimizations. When off, the package’s Unity optimization XML is not loaded. Current contents: 15-UNITY-OPTIMIZATIONS.md. Later Unity optimizations hang on this same switch, not per-API switches
enableDebuggerboolfalseEditor Mono only: inject EmmyLua emmy_core after Initialize. See build/04-EMMYLUA-DEBUGGER.md
debuggerPortint9966EmmyLua tcpListen port
debuggerWaitIDEboolfalseWhen true, dbg.waitIDE() blocks the Unity main thread until the IDE attaches

The three XML path lists are only for non–hot-update assemblies. Hot-update assemblies use the matching Attribute and are not written into these XML files.


3. Load order​

Editor Mono and Il2Cpp Generate read the path lists above. When enableUnityOptimizations == true, package files are inserted before the user lists (see §15). The same (assembly, type, method, signature) appearing twice in Alias or MarshalAs → load fails.