Hello Guest

Author Topic: Sprite animations(tk2d) appear second time they are instantiated  (Read 4053 times)

moghes

  • Newbie
  • *
  • Posts: 2
    • View Profile
Hello,

I am working on a story/book , where I have sprite animations.
several sprites are saved into prefabs, and each page is a prefab.
To change the pages, I instantiate the prefab(second page) and destroy the previous one.
As I run the game on the ipad, the first time I swipe to change the page, the page changes but the sprites do not show, the second time I come across the same page, the animations(sprites) appear.

I can't even figure out the reason or source of the bug, whether its unity realated or tk2d or IOS related.

I am using Unity pro 3.5.6, with tk2d 1.9.1 and testing on Ipad2 (IOS version 6.0.1).

THanks for any help

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprite animations(tk2d) appear second time they are instantiated
« Reply #1 on: April 25, 2013, 09:32:45 pm »
So it is only broken on iOS? Does it do the same thing on Mac?

Is your prefab disabled by default?
Do you use platform sprite collections?
What is different the second time you view the page? Is it just loading it in the second time?
Any error messages in log?

moghes

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Sprite animations(tk2d) appear second time they are instantiated
« Reply #2 on: April 26, 2013, 12:38:34 am »
Thank you for your support!
I am really stuck in this and can't find any solution.

Our target is the Ipad.
I am working on a windows, copy project to a mac and build for IOS.
I am able to see the sprites from the first time when I run in the editor both on windows and mac.

I have a GUI.Label also displaying on the screen, it displays from the first load but the sprite do not.
I have 7 pages for a demo (Prove of Concept), and the first time I swipe to turn the 7 pages, I only see text (GUI.Label), and the second time I reach page2,3, ... I see sprites + text.

The several Sprites are stored in a prefab, which I instantiate on every page turn and destroy the previous.
I have an array of gameObjects, where I have stored my pages (each page a prefab) and a private GameObject for the current content.
like this:

Destroy(currentPageGraphics);   
currentPageGraphics = Instantiate(pageGraphics[pageNumber-1]  , new Vector3(0,0,1) , Quaternion.identity) as GameObject;

Any help would be great,
I am ready to give any furthur detail if that clarifies the issue more..
Thank You Again

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Sprite animations(tk2d) appear second time they are instantiated
« Reply #3 on: April 26, 2013, 09:21:07 am »
I would very much like to investigate this. Can you send me a test case demonstrating the issue? support at unikronsoftware.com if possible. I don't need the graphics, so you can blank them out if they contain any confidential info.