hi,
I am getting an error in the following scenario :
I have a typescript with an attribute of type cc.SpriteFrame which I then assign to the sprite frame property of a sprite component of a node.
In onDestroy of the typescript, I release the sprite frame asset.
I reload the same scene that I am currently in.
the scene doesn’t load for the second time(it loads just fine the first time). the second time I get the following error : cannot read property ‘_format’ of null
when I dynamically load the sprite frame using loadres , I don’t get the error.
ok it sounds like the spriteFrame is already set in your member variable when the scene first loads because you dragged a spriteFrame into the member in the gui right?
then when you destroy it and reload the scene, the spriteFrame is no longer set in your member variable because it was set to null (as opposed to the first time around the member is set to the entity you dragged into the spot)