// Use this for initialization void Start() { foreach (string filename in System.IO.Directory.GetFiles(Path, SearchPattern)) { ImageItem newItem = Instantiate(Item) as ImageItem; newItem.Init(filename); menu.Add(newItem.transform); } }
void Start() { foreach (SampleLoaderEntry entry in entries) { SampleLoaderItem newItem = Instantiate(itemPrefab) as SampleLoaderItem; newItem.Init(entry); menu.Add(newItem.transform); newItem.transform.localRotation = Quaternion.identity; } }
// Use this for initialization void Start() { if (!menu) { return; } for (int i = 0; i < count; i++) { Transform newObj = Instantiate(menuItem) as Transform; TextMesh tm = newObj.GetComponentInChildren <TextMesh>(); if (tm) { tm.text = "Testing " + i; } menu.Add(newObj); } }