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
- Build fails when building a project containing an 18+ dimension array with IL2CPP
- [Android][Sentis] Human poses are not detected when using the BlazePose model
- Sprite Editor Outline Tool Overlay is not displayed when no Sprite is selected
- “No method with RuntimeInitializeOnLoadMethod attribute” warning from ReadmeEditor.cs is thrown after installing Project Auditor Rules
- Projection matrix is altered when using RasterCommandBuffer.ClearRenderTarget on DX12 and Metal
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.”