Created
June 24, 2014 13:22
-
-
Save sugi-cho/50de02f60351ee63ac26 to your computer and use it in GitHub Desktop.
create background editor process
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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