2D Toolkit Forum

2D Toolkit => Support => Topic started by: dyunarion on June 17, 2013, 11:53:38 am

Title: How can use Assetbundle?
Post by: dyunarion 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
Title: Re: How can use Assetbundle?
Post by: unikronsoftware on June 17, 2013, 11:58:43 am
what version of 2D Toolkit are you using?
Title: Re: How can use Assetbundle?
Post by: dyunarion on June 17, 2013, 12:00:05 pm
using 2D Toolkit Version 2 final
Title: Re: How can use Assetbundle?
Post by: unikronsoftware on June 17, 2013, 12:00:33 pm
I'll investigate.
Title: Re: How can use Assetbundle?
Post by: dyunarion on June 17, 2013, 12:07:12 pm
ok. i'll wait, thx  :D
Title: Re: How can use Assetbundle?
Post by: unikronsoftware 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.
Title: Re: How can use Assetbundle?
Post by: dyunarion 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?  :'(
Title: Re: How can use Assetbundle?
Post by: unikronsoftware 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.
Title: Re: How can use Assetbundle?
Post by: dyunarion 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.  :)
Title: Re: How can use Assetbundle?
Post by: unikronsoftware on June 17, 2013, 04:44:30 pm
You mean it is showing as "-" ? That is expected...
Title: Re: How can use Assetbundle?
Post by: dyunarion 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)
Title: Re: How can use Assetbundle?
Post by: unikronsoftware 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?
Title: Re: How can use Assetbundle?
Post by: dyunarion on June 17, 2013, 05:25:16 pm
ok.
I will send you an example tomorrow.  :)

Title: Re: How can use Assetbundle?
Post by: dyunarion on June 18, 2013, 07:20:28 am
I just sent the mail (support@unikronsoftware.com)
Please check ans reply.  :)