IEditModeTestYieldInstruction.cs 1.2 KB

12345678910111213141516171819202122232425262728
  1. using System.Collections;
  2. namespace UnityEngine.TestTools
  3. {
  4. /// <summary>
  5. /// In an Edit Mode test, you can use `IEditModeTestYieldInstruction` interface to implement your own instruction. There are also a couple of commonly used implementations available:
  6. /// - [EnterPlayMore](https://docs.unity3d.com/Packages/com.unity.test-framework@1.1/api/UnityEngine.TestTools.EnterPlayMode.html)
  7. /// - <see cref = "ExitPlayMode"/>
  8. /// - <see cref = "RecompileScripts"/>
  9. /// - <see cref = "WaitForDomainReload"/>
  10. /// </summary>
  11. public interface IEditModeTestYieldInstruction
  12. {
  13. /// <summary>
  14. /// Whether or not the instruction expects a domain reload to occur.
  15. /// </summary>
  16. bool ExpectDomainReload { get; }
  17. /// <summary>
  18. /// Whether or not the instruction expects the Unity Editor to be in **Play Mode**.
  19. /// </summary>
  20. bool ExpectedPlaymodeState { get; }
  21. /// <summary>
  22. /// Used to define multi-frame operations performed when instantiating a yield instruction.
  23. /// </summary>
  24. /// <returns>Enumerable collection of operations to perform.</returns>
  25. IEnumerator Perform();
  26. }
  27. }