EditorApplication.isCompiling 是否正编译

static var isCompiling : bool

Description描述

Is editor currently compiling scripts? (Read Only)

当前编辑器是否在编译脚本(只读)?

EditorApplication.isCompiling 是否正编译

Editor Window that tells you if Unity is compiling scripts.
如果Unity正编译脚本,编辑器窗口告诉你。

// Dont let the user enter in play mode if the editor is compiling the assemblies
//当用户在编译程序时禁止用户进入播放状态

class FinishCompiling extends EditorWindow {

	@MenuItem("Example/Dont Let Play until finish compiling")
	static function Init() {
		var window : FinishCompiling =
		EditorWindow.GetWindowWithRect(FinishCompiling, Rect(0,0,165,40));
		window.Show();
	}
	function OnGUI () {
		EditorGUILayout.LabelField("Compiling:", EditorApplication.isCompiling?"YES" : "No");
	}
	function Update() {
		if(EditorApplication.isCompiling) {
			EditorApplication.isPlaying = false;
		}
	}
}
Page last updated: 2011-6-25