Unity project configuration xLua environment
Get xLua
First go to GitHub to get the latest version. GitHub Portal
method of obtaining
- If Git is installed on the computer, just
Clone with HTTPS
download: select1 -> 3
(not recommended: slow download speed). - Git is installed on the computer, and the ssh public key is configured on GitHub, just
Clone with SSH
download: select1 -> 2 -> 3
(suggestion: this way you can get the latest xLua, which also has a case, and the download speed is not bad). - If your computer doesn't have Git, or GitHub doesn't have an ssh public key, or you don't want to bother, then you can directly download the ZIP file: choose
4
.
Import into Unity
-
Open Unity and create a new project.
-
Open the downloaded resource, copy
Plugins
the folder andXLua
folder in the resource file toAssets
the folder in the Unity project directory;Tools
copy the folder in the resource file to the Unity project directory, which is at the same level as Assets .
– If you don’t want those cases anymore, just delete the folder XLua
under it .Examples
-
Open Unity again, after the editor is compiled, the editor may report an error, ignore it, and then customize the macro: open to
File > Build Settings > Player Settings > Other Settings
findScripts Define Symbols
the item, enter it in the input boxHOTFIX_ENABLE
and press Enter to close the settings. For details, see: Hot Patch Operation Guide -
Find the option in the toolbar , and there will be three options
XLua
after opening:Generate Code
,Clear Generate Code
, . – : compile code – : clear compiled code – : inject codeHotfix Inject In Editor
Generate Code
Clear Generate Code
Hotfix Inject In Editor
At this point, click in sequence
Clear Generate Code -> Generate Code -> Hotfix Inject In Editor
. When the or waits for the log in
Unity , the configuration is complete.Console
hotfix inject finish!
inject finish!
-
When packaging and publishing,
XLua
there areExamples
folders that need to be deleted first, and then click the , , three optionsXLua
under .Clear Generate Code
Generate Code
Hotfix Inject In Editor
Ending: The previous record has not been published, and the one-time configuration is completed. There is no problem encountered in the middle. If you encounter any problems, you can leave a message and learn and discuss together.