docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class EnterPlayMode

    Implements IEditModeTestYieldInstruction. Creates a yield instruction to enter Play Mode.

    Inheritance
    object
    EnterPlayMode
    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 EnterPlayMode : IEditModeTestYieldInstruction

    Constructors

    EnterPlayMode(bool)

    When creating an Editor test that uses the UnityTest attribute, use this to trigger the Editor to enter Play Mode. Throws an exception if the Editor is already in Play Mode or if there is a script compilation error.

    Declaration
    public EnterPlayMode(bool expectDomainReload = true)
    Parameters
    Type Name Description
    bool expectDomainReload

    A flag indication whether to expect a domain reload.

    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()

    Performs the multi-step instructions of entering PlayMode.

    Declaration
    public IEnumerator Perform()
    Returns
    Type Description
    IEnumerator

    An IEnumerator with the async steps.

    Exceptions
    Type Condition
    Exception

    An exception is thrown if the editor is already in PlayMode or if script compilation failed.

    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)