Beispiel #1
0
        public override void OnGUI(Rect rect)
        {
            GUILayout.BeginArea(rect);
            scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition);
            if (GUILayout.Button("Open Folder"))
            {
                var dir  = new DirectoryInfo(EditorPrefs.GetString(BUNDLE_ROOT_KEY, @".\"));
                var path = EditorUtility.OpenFolderPanel("AssetBundle Folder", dir.Parent.FullName, dir.Name);
                if (!string.IsNullOrEmpty(path))
                {
                    EditorPrefs.SetString(BUNDLE_ROOT_KEY, path);
                    dir = new DirectoryInfo(path);
                    this.progressBar = new ProgressBar();
                    EditorExecutors.RunOnCoroutine(DoTask(dir));
                }
            }
            EditorGUILayout.EndScrollView();
            GUILayout.EndArea();

            if (this.progressBar != null && this.progressBar.Enable)
            {
                if (EditorUtility.DisplayCancelableProgressBar(progressBar.Title, progressBar.Tip, progressBar.Progress))
                {
                    this.cancel = true;
                }
            }
            else
            {
                EditorUtility.ClearProgressBar();
                this.progressBar = null;
            }
        }
        protected virtual void OnCanExecuteChanged(object sender, EventArgs e)
        {
            if (Application.isPlaying)
            {
                UpdateTargetInteractable();
            }
            else
            {
#if UNITY_EDITOR
                EditorExecutors.RunOnCoroutine(CoUpdateTargetInteractable());
#endif
            }
        }
Beispiel #3
0
        void DoNextFrame(Action action)
        {
            if (Application.isPlaying)
            {
                action();
            }
            else
            {
#if UNITY_EDITOR
                EditorExecutors.RunOnCoroutine(NextFrame(action));
#endif
            }
        }