Is there a good way to detect that Unity is about to reload assets before the reload happens? In essence, to be notified when Unity is moving all of the Mono state into C++ and then back?
It is pretty easy to detect it has happened after the fact;
[ExecuteInEditMode]
class UnitySerializationDetector {
[NonSerialized]
private object obj;
void Awake() {
obj = new object();
}
void Update() {
if (obj == null) {
Debug.Log("Assets reloaded");
obj = new object();
}
}
}
but is there a way to do it before the serialization happens?
Thanks