16
Support / Re: set sprite
« on: September 12, 2013, 10:17:06 am »
Hi,
I wrote this little test script (although it's in c#), which works on one of my sprite collections.
So if you drag your sprite collection data object to mySpriteData and change the GetSpriteIdByName to "ball", does that work for you?
Also, are you using platform collections?
I wrote this little test script (although it's in c#), which works on one of my sprite collections.
Code: [Select]
using UnityEngine;
using System.Collections;
public class SpriteLoad : MonoBehaviour {
public tk2dSpriteCollectionData mySpriteData;
void Start ()
{
int spriteID = mySpriteData.GetSpriteIdByName("eye");
GameObject go = new GameObject();
tk2dSprite.AddComponent(go, mySpriteData, spriteID);
}
}
So if you drag your sprite collection data object to mySpriteData and change the GetSpriteIdByName to "ball", does that work for you?
Also, are you using platform collections?