Hello, I am interested in packing 1x/2x tk2dSpriteCollections into AssetBundles. I started reading some of the other threads on the topic, but am not entirely clear on what actually needs to be in the AssetBundle.
Here's my best guess - please correct me where I am wrong:
1. In a new project, create a tk2dSpriteCollection that uses "1x" platform setting. Create a different tk2dSpriteCollection that uses "2x" platform setting. Add all the appropriate sprites and commit the collection. Is it okay to use PNG settings here?
2. Add the tk2dSpriteCollectionData component to the AssetBundle using the following code:
tk2dSpriteCollectionData data;
BuildPipeline.BuildAssetBundle(data, new Object[] { data }, path, BuildAssetBundleOptions.CompleteAssets | BuildAssetBundleOptions.CollectDependencies);
3. Download the Asset Bundle and perform the following code for to set a sprite.
AssetBundle ab = <reference to an assetbundle>;
sprite = GetComponent<tk2dSprite>();
sprite.collection = ab.Load ("human", typeof(tk2dSpriteCollectionData)) as tk2dSpriteCollectionData;
sprite.SetSprite("mySpriteName");