public void OnPick() { if (_is_playing) { foreach (HitObject HO in HitObjects) { if (HO._offset + HO._size > _Time_Since_Start && HO._offset < _Time_Since_Start) { if (HO._is_hittable) { //Hit HO.OnHit(); ++_hit; return; } else { return; } } } ++_player_miss; ++_miss; Fretboard f = GetComponentInParent <Fretboard>(); if (f) { f.OnMiss(); } } }
public void OnMiss() { AudioSource.PlayClipAtPoint(HitSound, transform.position, 0.25f); Fretboard f = GetComponentInParent <Fretboard>(); if (f) { f.OnMiss(); } }