Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about usage #4

Open
MostHated opened this issue Nov 11, 2020 · 1 comment
Open

Question about usage #4

MostHated opened this issue Nov 11, 2020 · 1 comment

Comments

@MostHated
Copy link

Hello,
I was wondering if you happen to know if this works in the editor or if it is only for runtime code? Such as, could I used it to perform sequential/timed events within editor scripts?

Thanks,
-MH

@karsion
Copy link
Owner

karsion commented Jan 2, 2021

Editor mode is not supported at the moment. This requirement will be added later. In fact, you can implement it yourself, just put the update in the editor's update driver.
e.g.
#if UNITY_EDITOR
[UnityEditor.InitializeOnLoadMethod]
static void InitializeEditor()
{
UnityEditor.EditorApplication.update += () =>
{
if (!Application.isPlaying)
{
unitedUpdate?.Invoke();

                if (unitedUpdateOnce != null)
                {
                    var call = unitedUpdateOnce;
                    unitedUpdateOnce = null;
                    call();
                }
            }
        };
    }

#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants