Added disclaimer / comment regarding the solution

This commit is contained in:
Adam Ramberg 2023-08-04 23:16:05 +02:00
parent adbd7db6c2
commit fa9e1c8ea1
3 changed files with 12 additions and 0 deletions

View File

@ -76,6 +76,10 @@ namespace UnityAtoms
private void OnDisable() private void OnDisable()
{ {
// NOTE: This will not be called when deleting the Atom from the editor.
// Therefore, there might still be null instances, but even though not ideal,
// it should not cause any problems.
// More info: https://issuetracker.unity3d.com/issues/ondisable-and-ondestroy-methods-are-not-called-when-a-scriptableobject-is-deleted-manually-in-project-window
_instances.Remove(this); _instances.Remove(this);
// Clear all delegates when exiting play mode // Clear all delegates when exiting play mode
UnregisterAll(); UnregisterAll();

View File

@ -70,6 +70,10 @@ namespace UnityAtoms
private void OnDisable() private void OnDisable()
{ {
// NOTE: This will not be called when deleting the Atom from the editor.
// Therefore, there might still be null instances, but even though not ideal,
// it should not cause any problems.
// More info: https://issuetracker.unity3d.com/issues/ondisable-and-ondestroy-methods-are-not-called-when-a-scriptableobject-is-deleted-manually-in-project-window
_instances.Remove(this); _instances.Remove(this);
} }

View File

@ -156,6 +156,10 @@ namespace UnityAtoms
private void OnDisable() private void OnDisable()
{ {
// NOTE: This will not be called when deleting the Atom from the editor.
// Therefore, there might still be null instances, but even though not ideal,
// it should not cause any problems.
// More info: https://issuetracker.unity3d.com/issues/ondisable-and-ondestroy-methods-are-not-called-when-a-scriptableobject-is-deleted-manually-in-project-window
_instances.Remove(this); _instances.Remove(this);
} }