Hello Guest

Author Topic: How can use Assetbundle?  (Read 8023 times)

dyunarion

  • Newbie
  • *
  • Posts: 8
    • View Profile
How can use Assetbundle?
« on: June 17, 2013, 11:53:38 am »
hi
i want to use assetbundle of 2dtoolkit.
how can i do?

i already put the "tk2dSpriteCollectionData" component to the assetbundle, and load.

 BuildPipeline.BuildAssetBundle(Selection.activeObject, Selection.objects, path,
            BuildAssetBundleOptions.CompleteAssets | BuildAssetBundleOptions.CollectDependencies);

but, i don't know how to use this object in assetbundle.

whenever i use a sprite, it worked well.
but, when i try to open the tk2dSprite component,  unity to give me a message.
"Unable to find sprite collection. this is a serious problem."
and the process box too. (Rebuilding Index/ Scanning project folder)

help me plz. T_T

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How can use Assetbundle?
« Reply #1 on: June 17, 2013, 11:58:43 am »
what version of 2D Toolkit are you using?

dyunarion

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: How can use Assetbundle?
« Reply #2 on: June 17, 2013, 12:00:05 pm »
using 2D Toolkit Version 2 final

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How can use Assetbundle?
« Reply #3 on: June 17, 2013, 12:00:33 pm »
I'll investigate.

dyunarion

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: How can use Assetbundle?
« Reply #4 on: June 17, 2013, 12:07:12 pm »
ok. i'll wait, thx  :D

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How can use Assetbundle?
« Reply #5 on: June 17, 2013, 12:29:21 pm »
tk2dSpriteGUIUtility.cs
Change line 309 from
Code: [Select]
if (currentValue == null || currentValue.dataGuid == TransientGUID)to
Code: [Select]
if (currentValue == null || AssetDatabase.GetAssetPath(currentValue) == "")
That should fix the issue.

dyunarion

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: How can use Assetbundle?
« Reply #6 on: June 17, 2013, 12:54:21 pm »
thanks.

now it works very well.
but i still wonder why Anim Lib (tk2dSpriteAnimator) is different from original name in assetbundles.

current Anim Lib name is another thing. (another tk2dSpriteAnimation's name)

do i ignore it?  :'(

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How can use Assetbundle?
« Reply #7 on: June 17, 2013, 01:09:18 pm »
What is the name? It simply gets the name from the asset itself, but there could be some wierdness going on due to it being in a bundle. Should be safe to ignore, I think.

dyunarion

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: How can use Assetbundle?
« Reply #8 on: June 17, 2013, 04:42:29 pm »
thank for reply.

I mean, the name is tk2dSpriteCollectionData's SpriteCollection name in assetbundle.

for example...

I put the tk2dSpriteCollectionData to the assetbundle.
this tk2dSpriteCollctionData's SpriteCollection name is 'enemy_01'.

and I load the assetbundle, play sprite.
I think, this sprite's collection name is 'enemy_01'.
but this collection name is another name!

did I do something wrong...?

I'm bad at english. but please understand me.  :)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How can use Assetbundle?
« Reply #9 on: June 17, 2013, 04:44:30 pm »
You mean it is showing as "-" ? That is expected...

dyunarion

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: How can use Assetbundle?
« Reply #10 on: June 17, 2013, 05:09:29 pm »
no. not "-".
I know that.

i mean, another collection name.

for example
I made SpriteCollection 'a' before.
and I load assetbundle, this Collection's name is 'b'.

when I play sprite, i think the sprite's collection name is 'b'!
but showing 'a' or another name (another collection names)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How can use Assetbundle?
« Reply #11 on: June 17, 2013, 05:12:29 pm »
I don't think I know how this is happening. Can you send me an example to support at unikronsoftware dot com?

dyunarion

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: How can use Assetbundle?
« Reply #12 on: June 17, 2013, 05:25:16 pm »
ok.
I will send you an example tomorrow.  :)


dyunarion

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: How can use Assetbundle?
« Reply #13 on: June 18, 2013, 07:20:28 am »
I just sent the mail (support@unikronsoftware.com)
Please check ans reply.  :)