Studio GuideWorld SDK Guide
Log In

Turn off automatic compilation of Typescript assets

Go to the Unity > Preference menu and disable the Auto Refresh item in the General tab.

Now, the automatic script compilation is disabled, and Unity won't compile scripts automatically when you save changes.


❗️

Caution

  • Auto Refresh enables the automatic update of all assets in the Unity project, not limited to Typescript assets. Therefore, it is recommended to utilize Auto Refresh.

📘

Unity Preferences

https://docs.unity3d.com/2020.3/Documentation/Manual/Preferences.html


Manually Compiling Typescript

When the automatic compilation feature is disabled, you need to manually compile the changed Typescript.

  • Select the Typescript you want to compile in the Project panel and press the Force Rebuild button in the Inspector panel.
  • You can see that the selected Typescript is compiled automatically.

Manually compiling all Typescript assets

You can initiate a compilation of all Typescript assets in your project via the Rebuild All.

Selecting ZEPETO > Script > Rebuild All will trigger a recompilation of all Typescript assets within the project.


👍

Tips

Rebuild All(for not compiled) menu compiles only Typescript assets that were not previously compiled.


How to check a line of code when a script error occurs

Sometimes, it's challenging to pinpoint the exact location of code that causes errors when you write Typescript and run it at runtime.

Select the Typescript causing the error in the Project panel and click the Open Compiled Script button in the Inspector panel.


You'll see the Typescript compiled into Javascript in the script editor.

You can find the Javascript lines marked as errors in the Console log.