Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

CompilationPipeline.RequestScriptCompilation

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static void RequestScriptCompilation();

Description

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.


Declaration

public static void RequestScriptCompilation(RequestScriptCompilationOptions options);

Parameters

Parameter Description
options Whether to clear the build cache before compilation. Pass RequestScriptCompilationOptions.CleanBuildCache to recompile all scripts, even if nothing changed.

Description

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:

  • 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.