Check whether MjScene exists in components' OnDisable()

This commit is contained in:
Bálint Hodossy
2022-12-14 13:38:36 +00:00
parent 05216f183c
commit aec125fb4e
+1 -1
View File
@@ -99,7 +99,7 @@ public abstract class MjComponent : MonoBehaviour {
}
public void OnDisable() {
if (!_exiting) {
if (!_exiting && MjScene.InstanceExists) {
MjScene.Instance.SceneRecreationAtLateUpdateRequested = true;
}
}