Unity编辑器小窗口进度条

[MenuItem("Tools/进度条测试")]
public static void Run()
{
    int index=0;
    int total=200;
    EditorApplication.update = delegate()
    {
        bool isCancle = EditorUtility.DisplayCancleableProgressBar("执行中...","描述文字...",(float)index/total);
        ++index;
        if(isCancle || index >= total)
        {
            EditorUtility.ClearProgressBar();
            EditorApplication.update = null;
        }
    }
}

 

你可能感兴趣的:(unity3D,Unity3D)