ScriptableObject OnDisable Event Purpose

From my observation OnDisable Event is called only when I enter Play Mode and right before OnEnable Event. So why are there two events that are called one after another?

4702181--443966--upload_2019-7-1_16-37-13.png

I suspect that OnDisable is called whenever the object is destroyed, as the object is disabled just prior to its destruction. When entering play mode, the editor is likely destroying objects which were in memory during edit mode or a previous play session, and then immediately creating new ones.

2 Likes