//setup editor pages void populatePages() { foreach (Object o in PartData.chassis) { GameObject go = (GameObject)o; GameObject panel = Instantiate(templateMenuObj) as GameObject; panel.transform.SetParent(chassisPanel.transform); panel.name = go.name; panel.SetActive(true); panel.transform.localScale = new Vector3(1, 1, 1); Image i = panel.GetComponent <Image> (); Texture2D tex = PartData.findThumbnail(panel.name); i.sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(.5f, .5f)); } foreach (Object o in PartData.wheels) { GameObject go = (GameObject)o; GameObject panel = Instantiate(templateMenuObj) as GameObject; panel.transform.SetParent(WheelsPanel.transform); panel.name = go.name; panel.SetActive(true); panel.transform.localScale = new Vector3(1, 1, 1); Image i = panel.GetComponent <Image> (); Texture2D tex = PartData.findThumbnail(panel.name); i.sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(.5f, .5f)); } foreach (Object o in PartData.arms) { GameObject go = (GameObject)o; GameObject panel = Instantiate(templateMenuObj) as GameObject; panel.transform.SetParent(ArmsPanel.transform); panel.name = go.name; panel.SetActive(true); panel.transform.localScale = new Vector3(1, 1, 1); Image i = panel.GetComponent <Image> (); Texture2D tex = PartData.findThumbnail(panel.name); i.sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(.5f, .5f)); } foreach (Object o in PartData.sensors) { GameObject go = (GameObject)o; GameObject panel = Instantiate(templateMenuObj) as GameObject; panel.transform.SetParent(SensorsPanel.transform); panel.name = go.name; panel.SetActive(true); panel.transform.localScale = new Vector3(1, 1, 1); Image i = panel.GetComponent <Image> (); Texture2D tex = PartData.findThumbnail(panel.name); i.sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(.5f, .5f)); } }