Search Issue Tracker
Won't Fix
Won't Fix in 2023.2.X
Votes
0
Found in
2021.3.27f1
2022.3.1f1
2023.1.0b20
2023.2.0a18
Issue ID
UUM-37568
Regression
No
ScriptableObject doesn’t receive the “OnDisable” callback when it’s loaded from AssetBundle during playmode exit
How to reproduce:
1. Open the user’s attached “AssetBundleTestProject.zip” project
2. Enter Play Mode
3. Exit Play Mode and observe the Console window
Expected result: “MyScriptableObjectAsset - OnDisable” is called
Actual result: “MyScriptableObjectAsset - OnDisable” is not called
Reproducible with: 2021.3.27f1, 2022.3.1f1, 2023.1.0b20, 2023.2.0a18
Reproduced on: macOS 13.2.1 (Intel)
Note: not reproducible with “OnEnable”
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Assets are created in the Package folders when creating assets via custom buttons in the Inspector window or other windows
- “Select” windows are named differently on Windows and macOS
- [Windows] No minimum “Select” window size
- Enabling “Editor Extension Authoring” in UI Builder doesn’t dirty the document and saving with shortcut doesn’t persist the state
- WebRequest.Create() function fails with "URI prefix is not recognized" errors when the project is built for Linux Standalone or Windows Dedicated Server
Resolution Note:
Risks with fixing that for existing LTS is not acceptable (would break user code). Risk with fixing that for 2023 LTS is that we are quite late in the process, and there is a very high Halo effect coming with this: that would probably require a team focus that we can’t afford.
Captured as a task in backlog for future version of Editor (no backports), we can’t guarantee that we’ll be done by then, but we’ll try.
What can be done for now at least is documentation fix https://docs.unity3d.com/ScriptReference/ScriptableObject.OnDestroy.html
by replacing statement from:
“This function is called when the scriptable object will be destroyed.”
to “The callback is only called if Object.Destroy() or Object.DestroyImmediate() is called directly.”
Resolution Note (2023.2.X):
Risks with fixing that for existing LTS is not acceptable (would break user code). Risk with fixing that for 2023 LTS is that we are quite late in the process, and there is a very high Halo effect coming with this: that would probably require a team focus that we can’t afford.
Captured as a task in backlog for future version of Editor (no backports), we can’t guarantee that we’ll be done by then, but we’ll try.
What can be done for now at least is documentation fix https://docs.unity3d.com/ScriptReference/ScriptableObject.OnDestroy.html
by replacing statement from:
“This function is called when the scriptable object will be destroyed.”
to “The callback is only called if Object.Destroy() or Object.DestroyImmediate() is called directly.”