private void StopMusicPlaySpecialEffect(SpecialsController.Special id) { _spawnnerScript = Resources.Load <spawnner>("Spawnner Woodpeaker").GetComponent <spawnner>(); _spawnnerScript.enabled = false; SpecialQuantity = 0; var audios = GetComponents <AudioSource>(); switch (id) { case SpecialsController.Special.Enel: _lightning.Play(); Watcher.Score += 500 * GameObject.FindGameObjectsWithTag("Woodpeakear").Length; audios[0].clip = EnelTalking; audios[1].clip = Thunder; break; case SpecialsController.Special.Frozen: _snow.Play(); audios[0].clip = LetItGo; audios[1].clip = Snow; break; case SpecialsController.Special.David: _shacos.Play(); audios[0].clip = Malandro; break; default: throw new ArgumentOutOfRangeException(nameof(id), id, null); } audios[2].Pause(); audios[0].Play(); audios[1].Play(); }
private void StopMusicPlayNacibSoundEffect() { _spawnnerScript = Resources.Load <spawnner>("Spawnner Woodpeaker").GetComponent <spawnner>(); _spawnnerScript.enabled = false; SpecialQuantity = SpecialMax; var audios = GetComponents <AudioSource>(); audios[0].clip = AngelSound; audios[0].Play(); audios[2].Pause(); }
private void GetInitialReferences() { _rb = GetComponent <Rigidbody2D>(); _cam = Camera.main; _bladeCollider = GetComponent <CircleCollider2D>(); SpecialQuantity = 0; _lightning = GameObject.Find("lightning").GetComponent <ParticleSystem>(); _snow = GameObject.Find("snow").GetComponent <ParticleSystem>(); _shacos = GameObject.Find("shacos").GetComponent <ParticleSystem>(); _watcher = GameObject.Find("Watcher").GetComponent <Watcher>(); _spawnnerScript = GameObject.Find("Spawnner Woodpeaker").GetComponent <spawnner>(); _specialEffects = _watcher.GetComponent <SpecialEffectsController>(); _canCut = true; //_audioSource = GetComponent<AudioSource>(); }