void Update() { if (noteOn) { MaterialPulse pulse = GetComponent <MaterialPulse>(); if (pulse) { pulse.Pulse(1.0f); } } }
void OnCollisionEnter2D(Collision2D collision) { int note = GetNote(); float strength = GetCollisionStrength(collision); if (synth) { synth.NoteOn(note, strength, noteLength); } MaterialPulse pulse = GetComponent <MaterialPulse>(); if (pulse) { pulse.Pulse(strength); } }