2D Toolkit Forum
2D Toolkit => Support => Topic started by: samix on February 10, 2016, 04:21:44 am
-
Hey Team,
I'm trying to keep sprite, created dynamically from loaded texture, between scene.
1. If I use tk2dSprite.CreateFromTexture to create the gameObject, and set it to DontDestroyOnLoad. My object is in the next scene, but the Variable Sprite in Tk2DSprite is empty.
2. I also try to keep the texture, it works, but the game slowdown when I use tk2dSprite.CreateFromTexture again.
Please let me know if you have an idea.
Thanks!
Sam
-
Hi there,
You need to set the sprite gameObject to DontDestroyOnLoad, and also the sprite.collection.gameObject to Don'tDestroyOnLoad. That should solve the issue you're having. If you look in the editor you'll see tk2d creates a gameobejct for the spritecollection.