Class EnterPlayMode
Implements IEditModeTestYieldInstruction. Creates a yield instruction to enter Play Mode.
Implements
Inherited Members
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. |