If you want an editor solution, have a look at the UnityEditor.Callbacks
namespace. DidReloadScripts
and PostProcessBuild/Scene
look interesting. (*1)
EDIT: I think I found something more interesting. EditorUtility.AssemblyReloadEvents
it’s internal so you have to use reflection. (*2) Unfortunately there’s no delegates, but methods. And analyzing them (finding out who uses/consumes them) didn’t lead me anywhere. I’ll see if I can inject something into them.

EDIT: I have indeed managed to inject custom code inside these assembly reload methods using the idea I mentioned here.
Here’s an example of OnBeforeAssemblyReload
:
1- Somewhere in your code, create a twin OnBeforeAssemblyReload
with your injected code, and whatever code that is actually called (in this case, Security.ClearVerifiedAssemblies
), so:
public static void OnBeforeAssemblyReload()
{
typeof(Security).GetMethod("ClearVerifiedAssemblies", BindingFlags.NonPublic | BindingFlags.Static)
.Invoke(null, null);
Debug.Log("Injected OnBeforeAssemblyReload!");
}
2- Follow the injection steps in the previous link, and redirect the method call Security.ClearVerifiedAssemblies
to your OnBeforeAssemblyReload
so now it executes your injected code, and calls the same method it used to call (ClearVerifiedAssemblies
)
3- Save the patched dll, and paste over your Unity/Editor/Managed folder.
4- Enjoy! 
Of course, instead of the debug log, you could invoke a delegate from which you could subscribe to, use your imagination…
Edit: You might get some type/file not found errors. Just use peverify.exe on your patched assembly.
Now here’s what you can do about OnAfterAssemblyReload
:
0- Create an injection method:
public static Action onAfterAssemblyReload;
public static void OnAfterAssemblyReload()
{
Debug.Log("Injected OnAfterAssemblyReload");
if (onAfterAssemblyReload != null)
onAfterAssemblyReload();
}
1- Navigate to the method using your reflector
2- Add a new call opcode to call your new method, right before the first call to GetAllProjectBrowsers
.
3- Save, and you’re done (don’t forget to verify your assembly using peverify)
Obviously, we could have done the same with OnBeforeAssemblyReload
, would have been cleaner, but just to show a variety of methods here… I’m still getting the hang of reflexil.
DISCLAIMER: Do this shit on you own responsibility, I’m not responsible for the laws/stuff/etc that might be broken due to this hack. I do this for pure educational reasons.