SW 중심대학 OSS GIT 서버 박건태, 이승준, 고기완, 이준호 새로운 배포
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
1.1 KiB

4 years ago
  1. # RecompileScripts
  2. `RecompileScripts` is an [IEditModeTestYieldInstruction](./reference-custom-yield-instructions.md) that you can yield in Edit Mode tests. It lets you trigger a recompilation of scripts in the Unity Editor.
  3. ## Constructors
  4. | Syntax | Description |
  5. | ------------------------------------------------------------ | ------------------------------------------------------------ |
  6. | `RecompileScripts(bool expectScriptCompilation = true, bool expectScriptCompilationSuccess = true)` | Creates a new instance of the `RecompileScripts` yield instruction. The parameter `expectScriptCompilation` indicates if you expect a script compilation to start (defaults to true). If a script compilation does not start and `expectScriptCompilation` is `true`, then it throws an exception. |
  7. ## Example
  8. ``` C@
  9. [UnitySetUp]
  10. public IEnumerator SetUp()
  11. {
  12. using (var file = File.CreateText("Assets/temp/myScript.cs"))
  13. {
  14. file.Write("public class ATempClass { }");
  15. }
  16. AssetDatabase.Refresh();
  17. yield return new RecompileScripts();
  18. }
  19. ```