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.
- 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.
When the automatic compilation feature is disabled, you need to manually compile the changed Typescript asset.
- Select the Typescript asset 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 asset is compiled automatically.
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.
Rebuild All(for not compiled) menu compiles only Typescript assets that were not previously compiled.
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 asset causing the error in the Project panel and click the Open Compiled Script button in the Inspector panel.