docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class WaitForDomainReload

    WaitForDomainReload is an IEditModeTestYieldInstruction that you can yield in Edit Mode tests. It delays the execution of scripts until after an incoming domain reload. If the domain reload results in a script compilation failure, then it throws an exception.

    Inheritance
    object
    WaitForDomainReload
    Implements
    IEditModeTestYieldInstruction
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.TestTools
    Assembly: UnityEditor.TestRunner.dll
    Syntax
    public class WaitForDomainReload : IEditModeTestYieldInstruction

    Constructors

    WaitForDomainReload()

    Create a new instance of the WaitForDomainReload yield instruction.

    [UnitySetUp]
    public IEnumerator SetUp()
    {
        File.Copy("Resources/MyDll.dll", @"Assets/MyDll.dll", true); // Trigger a domain reload.
        AssetDatabase.Refresh();
        yield return new WaitForDomainReload();
    }
    Declaration
    public WaitForDomainReload()

    Properties

    ExpectDomainReload

    Returns true if the instruction expects a domain reload to occur.

    Declaration
    public bool ExpectDomainReload { get; }
    Property Value
    Type Description
    bool

    ExpectedPlaymodeState

    Returns true if the instruction expects the Unity Editor to be in Play Mode.

    Declaration
    public bool ExpectedPlaymodeState { get; }
    Property Value
    Type Description
    bool

    Methods

    Perform()

    Perform the multi step action of waiting for a domain reload.

    Declaration
    public IEnumerator Perform()
    Returns
    Type Description
    IEnumerator

    An IEnumerator with steps.

    Exceptions
    Type Condition
    Exception

    Throws an exception if script compilation failed or if the expected domain reload did not occur.

    Implements

    IEditModeTestYieldInstruction
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)