Skip to content

Instantly share code, notes, and snippets.

@sugi-cho
Created June 24, 2014 13:22
Show Gist options
  • Save sugi-cho/50de02f60351ee63ac26 to your computer and use it in GitHub Desktop.
Save sugi-cho/50de02f60351ee63ac26 to your computer and use it in GitHub Desktop.
create background editor process
using UnityEngine;
using UnityEditor;
using System.Collections;
public class TestWindow : EditorWindow
{
[MenuItem("Window/Test")]
public static void Init ()
{
EditorWindow.GetWindow (typeof(TestWindow));
}
void OnGUI ()
{
if (GUILayout.Button ("Go")) {
EditorApplication.update += TestProcess;
}
}
int count = 0;
void TestProcess ()
{
Debug.Log (count++);
if (count > 100) {
count = 0;
EditorApplication.update -= TestProcess;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment