void Start() { showHideParts = gameObject.AddComponent <ShowHideParts>(); // find all transparent tagged items -- turn off colliders and set to transparent GameObject[] transparents = GameObject.FindGameObjectsWithTag("Transparent"); foreach (GameObject go in transparents) { ToggleColliders(go); showHideParts.MakeTransparent(go); } // store all circle of willis renderers cow_so = circleOfWillis.GetComponentsInChildren <SelectableObject>(); // Transducer paths pathChoices = GameObject.FindGameObjectsWithTag("Path"); pathChoicesStrings = new string[pathChoices.Length]; int i = 0; foreach (GameObject go in pathChoices) { pathChoicesStrings[i] = go.name; i++; } Array.Sort(pathChoicesStrings); Array.Resize(ref pathChoicesStrings, pathChoicesStrings.Length + 1); pathChoicesStrings[pathChoicesStrings.Length - 1] = "None"; }
private Text description; // reference to a gui text object attached to g.o if available private void Awake() { ShowHideParts = gameObject.AddComponent <ShowHideParts>(); if (GetComponent <Renderer>()) { int i = 0; origMaterials = GetComponent <Renderer>().materials; foreach (Material m in GetComponent <Renderer>().materials) // store object's original materials { origMaterials[i] = new Material(m); i++; } } }