Requests that the Unity Editor recompile any scripts that changed.
When you call this method, the Unity Editor checks whether any scripts, or settings that affect script compilation, have changed, and recompiles the scripts that need it. If the compilation succeeds, the Editor reloads all assemblies. To recompile all scripts even if nothing changed, use the overload that takes RequestScriptCompilationOptions.
| Parameter | Description |
|---|---|
| options | Whether to clear the build cache before compilation. Pass RequestScriptCompilationOptions.CleanBuildCache to recompile all scripts, even if nothing changed. |
Requests that the Unity Editor recompile scripts, with the option to clear the build cache and recompile everything.
When you call this method, the Unity Editor checks whether any scripts, or settings that affect script compilation, have changed, and recompiles the scripts that need it. If the compilation succeeds, the Editor reloads all assemblies.
You might want to recompile all scripts in the following situations: