Preparing Your Code - Overview
In order to convert the source code of a Unity project, Unity Playworks Plugin uses C# to JavaScript transpiling. The output of this process is then run on the Unity Playworks Plugin game engine in the final build.
It may be the case the initial export doesn't work due to compilation errors or that it produces undesirably large output. This section's goal is to provide insights on how to work around most common issues in a quick an easy way without disrupting general Unity workflow.
Unity Playworks Plugin supplied a number of tools and features that help you navigate your code and ensure it can be compiled with Luna, in the Code and Develop section of the Plugin UI.
Getting started
First of all, it is helpful to go over the below checklist and make sure Unity Playworks Plugin is properly set up for the project:
- Make sure to follow initial setup steps of Luna
- Choose appropriate export type via Plugin UI
- Verify Unity Playworks Plugin installation by exporting a simple scene
Compilation issues
When the project export process is started but the code compilation fails, the following topics describe how to address common issues:
- Using the Project Diagnostics feature to analyse your project and view any build issues
- Opening a Visual Studio solution to get an overview of compilation errors
- Excluding scripts from compilation process
- Excluding blocks of code from compilation process
- Using Automatic Stubbing to remove third party libraries