public void ActivateRitualCharm(CharmTypes charmtype){ for (int i = 0; i < charmPlaceholders.Count; i++) { foreach (Transform child in charmPlaceholders[i].transform) { if (child.gameObject.name == charmtype.ToString()) { // Destroy Destroy(child.gameObject); //instantiate a particle //GameObject.Instantiate (); } } } }
public void addCharm(CharmTypes charmType){ if (charmsToSearch.Where (c => c.charmType == charmType).Any ()) { gui.ActivateRitualCharm (charmType); charmsFound++; } else { wrongCharms++; } if (charmsFound >= charmsToSearch.Count) { //this.tt("showMessage") gui.showMessage("Ritual Completed"); // invoke the ending winParticle.SetActive(true); // kill the others List<GamepadInControl> cars = FindObjectsOfType<GamepadInControl>().ToList(); foreach(GamepadInControl car in cars){ if (car != this.gamepad) { car.GetComponent<SuperCarController> ().body.ExplodeRadius (); } } } if (wrongCharms >= charmsToSearch.Count) { body.ExplodeRadius (); // invoke the ending //Destroy(this.gameObject); } }