Class EditorWaitForSeconds | Package Manager UI website
docs.unity3d.com
    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
    System.Object
    EditorWaitForSeconds
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    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
    System.Single time

    The amount of time to wait in seconds.

    Properties

    WaitTime

    The time to wait in seconds.

    Declaration
    public double WaitTime { get; }
    Property Value
    Type Description
    System.Double
    In This Article
    • Constructors
      • EditorWaitForSeconds(Single)
    • Properties
      • WaitTime
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023