Hi UnikronSoftware,
I have implemented sprite code as you told. It worked fine for me..But now i want to add more then one sprites with same collection. when i tried to add more then one sprite as shown below in code its just shows me jar_2. It creates both sprite in Background object. I can see in inspector view jar_1 and jar_2 are assigned to sprite and sprite_2 respectively but sorting order for both is 7 and in game view and scene view i can just see jar_2. I think jar_2 is overriding jar_1. Please help to get expected results...Thanx in advance...
//Implemented Code
GameObject flavoursprite;
void Start () {
flavoursprite = GameObject.Find("Background");
tk2dSprite sprite = flavoursprite.AddComponent<tk2dSprite>();
sprite.Collection = Resources.Load("Pouring/DialogCollection", typeof(tk2dSpriteCollectionData)) as tk2dSpriteCollectionData;
sprite.spriteId = sprite.GetSpriteIdByName("jar_1");
sprite.SortingOrder=6;
tk2dSprite sprite_2 = flavoursprite.AddComponent<tk2dSprite>();
sprite_2.Collection = Resources.Load("Pouring/DialogCollection", typeof(tk2dSpriteCollectionData)) as tk2dSpriteCollectionData;
sprite_2.spriteId = sprite.GetSpriteIdByName("jar_2");
sprite_2.SortingOrder=7;
}