public virtual void DownBeat() { if (!m_playOnDownBeat) { return; } if (m_useRandom && Random.Range(0.0f, 1.0f) > m_randomChance) { return; } if (m_pattern.Count > 0 && !ShallWePlay()) { return; } AudioClipMaker.PlayClipAtPoint(m_metronome.m_audioSource, m_clip, this.transform.position, .5f); if (m_vfx) { m_vfx.Emit(1000); } //m_vfx.SetInt(m_downbeat, 3000); //StartCoroutine(ResetBurst()); LightFlash(1f, Color.white); }
public virtual void Beat() { //If we are using randomness, do stuff here if (m_useRandom && Random.Range(0.0f, 1.0f) > m_randomChance) { return; } //If we have a beat pattern, do stuff here (makes sense to NOT use randomness if we are using patterns, but YMMV if (m_pattern.Count > 0 && !ShallWePlay()) { return; } AudioClipMaker.PlayClipAtPoint(m_metronome.m_audioSource, m_clip, this.transform.position, .5f); if (m_vfx) { m_vfx.Emit(100); } //m_vfx.SetInt(m_downbeat, 300); //StartCoroutine(ResetBurst()); LightFlash(.5f, new Color(.1f, .1f, 1f)); }
public void PlayTheClip(Color c, AudioSource audioSrc, float volume) { if (!m_isConnected) { return; } if (m_note._clip == null) { Debug.LogError(this.transform.parent.name + " did not pass an audio clip to " + this.name); return; } AudioClipMaker.PlayClipAtPoint(audioSrc, m_note._clip, this.transform.position, volume); m_noteRenderer.material.SetColor(m_colorToChange, c); }