StartCoroutineが使えなくても大丈夫。
using UnityEngine;
using System.Collections;
using UnityEditor;
public class TestEditor : EditorWindow {
[MenuItem("Test/Go")]
static void Go() {
GetWindow<TestEditor> ();
}
void OnGUI() {
EditorGUILayout.LabelField ("Test");
if (GUILayout.Button ("Push")) {
Debug.Log ("Pushed");
IEnumerator t = Test ();
while (t.MoveNext ()) {
Debug.Log ("Current: " + t.Current);
}
}
}
public IEnumerator Test() {
Debug.Log ("Test 0");
yield return "Test 1";
Debug.Log ("Test 2");
yield return "Test 3";
Debug.Log ("Test 4");
}
}