RequestScriptCompilation
Requests that the Unity Editor recompile any scripts that changed.
Read time 1 minuteLast updated 22 days ago
Definition
- Type: Method
- Namespace: UnityEditor.Compilation
- Assembly: UnityEditor.CoreModule
RequestScriptCompilation()
Requests that the Unity Editor recompile any scripts that changed.
public static void RequestScriptCompilation()
Remarks
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.
RequestScriptCompilation(RequestScriptCompilationOptions)
Requests that the Unity Editor recompile scripts, with the option to clear the build cache and recompile everything.
public static void RequestScriptCompilation(RequestScriptCompilationOptions options)
Parameters
Whether to clear the build cache before compilation. Pass RequestScriptCompilationOptions.CleanBuildCache to recompile all scripts, even if nothing changed.
Remarks
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:
- You have a successful compilation, but want to see all compiler warnings again.
- The compilation pipeline takes input from files that Unity can't track. This can happen in rare cases when you use response files.
- You suspect a bug in the compilation pipeline that stops it from picking up changes.