Public gameobject _ background; Public uiatlas Atlas; private dictionary <int, uisprite> _ allcardsprite; For (INT I = 0; I <10; ++ I) {gameobject _ parent = nguitools. addchild (_ Background); _ parent. name = "cards"; _ parent. transform. localposition = new vector3 (I * 10,200.0 F, 0.0f); uisprite _ sprite = nguitools. addwidget <uisprite> (_ parent); _ Sprite. atlas = Atlas; _ Sprite. depth = I; _ Sprite. name = I. tostring (); _ Sprite. spritename = I. tostring (); _ allcardsprite. add (I, _ sprite); _ Sprite. makepixelperfect ();} foreach (keyvaluepair <int, uisprite> pair in _ allcardsprite) {tweenposition _ Position = pair. value. gameobject. getcomponent <tweenposition> (); If (_ Position = NULL) {_ Position = pair. value. gameobject. addcomponent <tweenposition> ();} _ position. duration = 0.2f; _ position. delay = pair. key * 0.2f; _ position. from = new vector3 (0.0f, 0.0f, 0.0f); _ position. to = new vector3 (0.0f,-200366f, 0.0f); _ position. playforward ();}
// Dynamically load the Avatar:
Gameobject _ Look = resources. Load ("heropanel", typeof (gameobject) as gameobject;
Gameobject go = nguitools. addchild (_ background, _ Look );
Go. Transform. Position = new vector3 (0.0f, 0.0f, 0.0f); // relative Center Coordinate Origin