update json

This commit is contained in:
2023-01-29 17:19:48 +08:00
parent d646659fcf
commit 37f58dcd84
16 changed files with 11 additions and 7 deletions

View File

@@ -0,0 +1,37 @@
using UnityEditor;
using System.Collections;
public class ATEditorCoroutines
{
readonly IEnumerator mRoutine;
public static ATEditorCoroutines StartEditorCoroutine( IEnumerator routine)
{
ATEditorCoroutines coroutine = new ATEditorCoroutines(routine);
coroutine.start();
return coroutine;
}
ATEditorCoroutines(IEnumerator routine)
{
mRoutine = routine;
}
void start()
{
EditorApplication.update += update;
}
void update()
{
if(!mRoutine.MoveNext())
{
StopEditorCoroutine();
}
}
public void StopEditorCoroutine()
{
EditorApplication.update -= update;
}
}