docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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");
            }
        }
    }
    Inheritance
    object
    EditorWaitForSeconds
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.EditorCoroutines.Editor
    Assembly: Unity.EditorCoroutines.Editor.dll
    Syntax
    public class EditorWaitForSeconds

    Constructors

    EditorWaitForSeconds(float)

    Creates a instruction object for yielding inside a generator function.

    Declaration
    public EditorWaitForSeconds(float time)
    Parameters
    Type Name Description
    float 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
    float
    In This Article
    Back to top
    Copyright © 2025 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)