private void Select(int i) { s_Selected = demoModels.items[i]; foreach (var otherEffect in demoModels.items) { if ((otherEffect != s_Selected) && (otherEffect.mode == Mode.Activate)) { otherEffect.transform.gameObject.SetActive(false); } } if (s_Selected.mode == Mode.Activate) { s_Selected.transform.gameObject.SetActive(true); } if (clearOnChange) { while (m_CurrentModelList.Count > 0) { Destroy(m_CurrentModelList[0].gameObject); m_CurrentModelList.RemoveAt(0); } } instructionText.text = s_Selected.instructionText; titleText.text = s_Selected.transform.name; }
private void LoadModels() { demoModels.items = new DemoModelSystem[s_GUIDs.Length]; GameObject models = GameObject.FindWithTag("Models"); for (int i = 0; i < demoModels.items.Length; i++) { DemoModelSystem container = new DemoModelSystem(); container.transform = models.transform.Find(s_GUIDs[i]); // strict match - no space at the end! container.transform.name = (i + 1).ToString() + (s_URLs[i] != null ? "*" : ""); demoModels.items[i] = container; } }