using UnityEditor;
using UnityEngine;

namespace RebootKit.Editor.Utils {
    public static class DomainReloader {
        [MenuItem(REditorConsts.k_EditorMenu + "Reload Domain", priority = 1000)]
        public static void ReloadDomain() {
            if (EditorApplication.isCompiling) {
                Debug.LogError("Cannot reload domain while compiling.");
                EditorUtility.DisplayDialog("Reload Domain", "Cannot reload domain while compiling.", "OK");
                return;
            }

            EditorUtility.RequestScriptReload();
        }
    }
}