public void Crash() { audioPlayer.StopAll(); audioPlayer.Play(crashSound); //silence all sources and play if (particles != null) { var go = Instantiate(particles.gameObject, transform.position, transform.rotation) as GameObject; particles = go.GetComponent <ParticleEffect>(); particles.PlayOnce(); planeMesh.SetActive(false); } sticker.DisconnectFromItem(); collider.enabled = false; }
public void OnObjectiveComplete(LevelObjective lvlObj) { if (lvlObj == levelObjective) { if (particles != null) { particles.PlayOnce(); } if (objectToSpawn != null) { GameObject go = Instantiate(objectToSpawn, transform.position, transform.rotation) as GameObject; } if (!shutUp) { audioPlayer.Play(completionSound); } } }