public void enable () {
for (int i = 0; i < UIObjects.Length; i++) {
if (UIObjects [i].EventObject != null) {
Tutorial.SwitchOnOff Interface = (Tutorial.SwitchOnOff)UIObjects [i].EventObject.GetComponent<Tutorial.SwitchOnOff> ();
Interface.enable ();
Interface.transparent(UIObjects[i].transparent);
if (UIObjects [i].flag == false) {
Interface.disable ();
} else {
Interface.enable ();
}
Interface.transparent(UIObjects[i].transparent);
}
}
if (enabled == false) {
for (int i = 0; i < EventObjects.Length; i++) {
for (int j = 0; j < EventObjects[i].spawn_params.Count; j++) {
GameObject clone;
clone = GameObject.Instantiate (EventObjects [i].EventObject, EventObjects [i].spawn_params [j].spawnLocation, Quaternion.identity) as GameObject;
clone.name = clone.name.Replace ("(Clone)", " ");
clone.name = "Tutorial_" + clone.name;
if(EventObjects[i].spawn_params[j].spawnScale.x != 0.0f) {
if(EventObjects[i].spawn_params[j].spawnScale.y != 0.0f) {
clone.transform.localScale = EventObjects[i].spawn_params[j].spawnScale;
}
}
GameObject.Find ("EventSystem").GetComponent<ObjectCollection> ().Add (clone);
}
}
}
enabled = true;
}