I have been working for creating OTSpriteAtlasCocos2D in Runtime.
Does somebody know how to do???
If I create OTSpriteAtlasCocos2D in runtime and add to spriteContainer on OTSprite, it works in my Unity but not works in android or web-player.
If I create OTSpriteAtlasCocos2D by using Hierarchy view,it works.
public OTSpriteAtlasCocos2D otatlastmpl;
OTSpriteAtlasCocos2D otc1;
OTSprite sp;
void Start () {
sp = Utils.getSprite();
this.otc1 = Instantiate(this.otatlastmpl) as OTSpriteAtlasCocos2D;
string name = "menu2_top";
this.otc1.name = name;
this.ta = Resources.Load("xml_" + name) as TextAsset;
this.tu = Resources.Load(name) as Texture;
this.otc1.atlasDataFile = this.ta;
this.otc1.texture = this.tu;
sp.position = new Vector2(-80,180);
sp.name = "fromcode";
sp.spriteContainer = this.otc1;
sp.frameName = "header_sukin01";
sp.depth = 800;
}