Exemple #1
0
        private void OnPlayTriggerExit(object sender, SimpleTriggerEventArgs e)
        {
            Triggerable triggerable = e.other.transform.GetComponentInActor <Triggerable>();

            if (triggerable != null)
            {
                collidingTriggers.Remove(triggerable);
                StopTriggering(triggerable, lastTriggerEventArgs);
            }
        }
Exemple #2
0
        private void StartTriggering(Triggerable triggerable, TriggerEventArgs args)
        {
            if (triggeredObjects.Add(triggerable))
            {
                if (triggeredObjects.Count == 1)
                {
                    StartHapticFeedback();
                }

                triggerable.TriggerStart(this, args);
            }
        }
Exemple #3
0
        private void StopTriggering(Triggerable triggerable, TriggerEventArgs args)
        {
            if (triggeredObjects.Remove(triggerable))
            {
                if (triggeredObjects.Count == 0)
                {
                    StopHapticFeedback();
                }

                triggerable.TriggerEnd(this, args);
            }
        }
Exemple #4
0
        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);
                }
            }
        }