First off, I am fairly new to NGUI. So, I am trying to spawn some sprites from prefabs..
Here is that block of code:
int rand = Random.Range(1, numItemsToSpawn) - 1; // Offset for zero-based array.
string s = arrObjects[rand];
GameObject temp = (GameObject) Resources.Load(s);
GameObject newObj = NGUITools.AddChild(isoCamMain.gameObject, temp) as GameObject;
The isoCamMain is my UI Camera instance. Is this the right object to spawn an object in to? If I try spawning it on an empty game object then the sprite is super huge. Ideally, I would like to have the instance spawn attached to my spawner object (empty gameobject).
Also, I want to position the spawned sprite off the top of the screen and have the sprite "fall" slowly down screen (ala Tetris) but I am having an issue with the positioning of the spawn sprite. Any help would be great.