Hello Guest

Author Topic: tk2dSprites becomes Pink when load Scene from Asset Bundle  (Read 6142 times)

divineforge

  • Newbie
  • *
  • Posts: 2
    • View Profile
tk2dSprites becomes Pink when load Scene from Asset Bundle
« on: December 01, 2015, 12:28:40 pm »
I'm using Unity 5.2.3f1
2dtoolkit version 2.5.4

When I run a scene in the Editor, everything display correctly. If I load a scene from AssetBundle that contains GameObject that are tk2dsprites, all of them becomes pink color, the tk2dsprite collection show as "-" .

I created a simple scene to investigate this issue. Two attachments were included,
First one display a gear icon correctly if running the scene in Editor, or build into the main app, without using asset bundle.
the Second one display the gear icon in pink, if this scene is loaded from an Asset Bundle.

I have verified the asset bundle codes should be correct, as all other things loaded properly, it's just issue with tk2d related game object.
Hope to get some ideas. Regards..


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dSprites becomes Pink when load Scene from Asset Bundle
« Reply #1 on: December 06, 2015, 12:17:03 pm »
Are you using platform collections on these collections? If so those will not work with asset bundles. Otherwise please post a repro case in the private support forum and I'll take a look.

divineforge

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: tk2dSprites becomes Pink when load Scene from Asset Bundle
« Reply #2 on: December 06, 2015, 02:22:05 pm »
Eventually this post explained the situation.
http://www.mingruijiang.com/Shaders-from-asset-bundles-appear-pink-in-editor

and I double check both my experiments, and realize the following: Compiled Shader only works on the target platform.
1. If I'm loading an asset bundle using Editor on MacOSX, (if the Asset Bundle is built for MacOSX), ===> all good.
2. If I'm loading an asset bundle using Editor on MacOSX, (if the Asset Bundle is built for iOS ) ===> all Pink. (Reapply Shaders will work.)
      if the Asset Bundle built for iOS, loaded on the iOS device, it will be all good. (display correctly.)

** I'm not too sure about the "Platform Collection" option.. Usually My project setting is target iOS platform, and building it on a MacOSX machine.. and I just create sprite collection normally without changing any setting.

I guessed I will just bear with it.. , safe to say can be ignored and understood it's a nature of the Unity thing..