Skip to content

Commit 71d3935

Browse files
committed
feat: Add assemblies lock/unlock
1 parent fe8959e commit 71d3935

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

Assets/Mx/Editor/Commands/MxCEditor.cs

+28-3
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public static void EditorPrefGetKey()
116116
Dictionary<string, string> prefss = Prefs.Prefs.GetPrefsString(type);
117117

118118
CompletingRead("Get EditorPref key: ", prefss, (key, _) =>
119-
{
119+
{
120120
key.CopyToClipboard();
121121
UnityEngine.Debug.Log("Copied EditorPref key: " + key);
122122
});
@@ -130,7 +130,7 @@ public static void PlayerPrefGetKey()
130130
Dictionary<string, string> prefss = Prefs.Prefs.GetPrefsString(type);
131131

132132
CompletingRead("Get PlayerPref key: ", prefss, (key, _) =>
133-
{
133+
{
134134
key.CopyToClipboard();
135135
UnityEngine.Debug.Log("Copied PlayerPref key: " + key);
136136
});
@@ -192,7 +192,7 @@ public static void EditorPrefSetKey()
192192
}
193193

194194
CreatePref(type, key);
195-
},
195+
},
196196
requiredMatch: false);
197197
}
198198

@@ -262,5 +262,30 @@ public static void PlayerPrefDeleteAll()
262262
if (yes == "Yes") Prefs.Prefs.DeleteAll(type);
263263
});
264264
}
265+
266+
[Interactive(
267+
icon: "AssemblyLock",
268+
summary: "Prevents loading of assemblies when it is inconvenient.")]
269+
public static void LockReloadAssemblies()
270+
{
271+
EditorApplication.LockReloadAssemblies();
272+
}
273+
274+
[Interactive(
275+
icon: "Assembly Icon",
276+
summary: "Must be called after LockReloadAssemblies, to reenable loading of assemblies.")]
277+
public static void UnlockReloadAssemblies()
278+
{
279+
EditorApplication.UnlockReloadAssemblies();
280+
EditorUtility.RequestScriptReload();
281+
}
282+
283+
[Interactive(
284+
icon: "cs Script Icon",
285+
summary: "The Unity Editor reloads script assemblies asynchronously on the next frame.")]
286+
public static void RequestScriptReload()
287+
{
288+
EditorUtility.RequestScriptReload();
289+
}
265290
}
266291
}

0 commit comments

Comments
 (0)