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;
		}
	}
}
最后修改:2011年6月25日 Saturday 18:47

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。