private void OnPlayTriggerExit(object sender, SimpleTriggerEventArgs e) { Triggerable triggerable = e.other.transform.GetComponentInActor <Triggerable>(); if (triggerable != null) { collidingTriggers.Remove(triggerable); StopTriggering(triggerable, lastTriggerEventArgs); } }
private void StartTriggering(Triggerable triggerable, TriggerEventArgs args) { if (triggeredObjects.Add(triggerable)) { if (triggeredObjects.Count == 1) { StartHapticFeedback(); } triggerable.TriggerStart(this, args); } }
private void StopTriggering(Triggerable triggerable, TriggerEventArgs args) { if (triggeredObjects.Remove(triggerable)) { if (triggeredObjects.Count == 0) { StopHapticFeedback(); } triggerable.TriggerEnd(this, args); } }
private void OnPlayTriggerEnter(object sender, SimpleTriggerEventArgs e) { Triggerable triggerable = e.other.transform.GetComponentInActor <Triggerable>(); if (triggerable != null) { collidingTriggers.Add(triggerable); if (Controller.IsTriggerPressed()) { lastTriggerEventArgs.Velocity = Controller.GetNoteVelocity(); StartTriggering(triggerable, lastTriggerEventArgs); } } }