Animations are not cleaning up on scene change under certain conditions.

0 votes
asked Oct 4, 2016 in Issue by anthonyioflux (610 points)
edited Oct 4, 2016 by anthonyioflux
MissingReferenceException: The object of type 'AnimatedShadow' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
MaterialUI.AnimatedShadow+<SetShadow>c__AnonStoreyBA.<>m__12B () (at Assets/MaterialUI/Scripts/Common/Shadows/AnimatedShadow.cs:84)
MaterialUI.ActionExtension.InvokeIfNotNull (System.Action action) (at Assets/MaterialUI/Scripts/MaterialUtils/Extensions.cs:156)
MaterialUI.AutoTween.EndTween (Boolean callback) (at Assets/MaterialUI/Scripts/Animation/AutoTween.cs:177)
MaterialUI.AutoTween.UpdateTween () (at Assets/MaterialUI/Scripts/Animation/AutoTween.cs:164)
MaterialUI.TweenManager.Update () (at Assets/MaterialUI/Scripts/Managers/TweenManager.cs:163)
Some objects were not cleaned up when closing the scene. (Did you spawn new GameObjects from OnDestroy?)

This is happening when the user clicks very fast through UI and the scene is changed after interacting with a button. In our example we have two buttons and a tab view. If you click the one button it moves to the last tab view and swaps with another button that exits the scene on click. If the user clicks the skip button and then the exit button right after, then the TweenManager tries to work with destroyed objects and throws a tween exception or that objects were instantiated in OnDestroy.

commented Oct 17, 2016 by admin (31,720 points)
Hi anthonyioflux,

I've been able to replicate this issue, and will work on fixing it when I can :)

~ Declan.
commented Oct 17, 2016 by anthonyioflux (610 points)
Hi Declan,

It is not a blocking issue though, just something I picked up in the error logs.

Keep up the good work, you have a great product.
commented Oct 24, 2016 by anonymous
I have the same problem when I hide my custom dialog.

1 Answer

0 votes
answered Jan 22 by Alberto Benavides
Is there any solution to this now?
Welcome to MaterialUI support! Ask us anything :)
...