1
Support / set sprite
« on: September 08, 2013, 03:22:55 pm »
I just started Using Unity and toolkit 2d.
I ve figured out some basics about how to work with sprites, but I havent figured out how to attach them newly to the scene with code.
the code should look somethign like this
now the problem with this is I don't know how to properly access the sprite collection (mysprites) I have set up.
how would I refer to the sprite collection properly?
I ve figured out some basics about how to work with sprites, but I havent figured out how to attach them newly to the scene with code.
the code should look somethign like this
Code: [Select]
void create(){
var target = new GameObject("sprite1");
var sprite = trg.AddComponent<tk2dSprite>();
sprite.setSprite(mysprites,"ball");
}
now the problem with this is I don't know how to properly access the sprite collection (mysprites) I have set up.
how would I refer to the sprite collection properly?