Class EditorWaitForSeconds
Suspends the EditorCoroutine execution for the given amount of seconds, using unscaled time. The coroutine execution continues after the specified time has elapsed.
using System.Collections;
using UnityEngine;
using Unity.EditorCoroutines.Editor;
using UnityEditor;
public class MyEditorWindow : EditorWindow
{
IEnumerator PrintEachSecond()
{
var waitForOneSecond = new EditorWaitForSeconds(1.0f);
while (true)
{
yield return waitForOneSecond;
Debug.Log("Printing each second");
}
}
}
Namespace: Unity.EditorCoroutines.Editor
Syntax
public class EditorWaitForSeconds
Constructors
EditorWaitForSeconds(Single)
Creates a instruction object for yielding inside a generator function.
Declaration
public EditorWaitForSeconds(float time)
Parameters
Type | Name | Description |
---|---|---|
Single | time | The amount of time to wait in seconds. |
Properties
WaitTime
The time to wait in seconds.
Declaration
public float WaitTime { get; }
Property Value
Type | Description |
---|---|
Single |