public void Input(int input)
        {
            if (!comboStarted)
            {
                BeginCombo();
            }

            currentInput.Add(input);

            for (int i = validCombos.Count - 1; i >= 0; i--)
            {
                ComboSequence sequence = validCombos[i];

                if (currentInputIndex >= sequence.items.Length)
                {
                    validCombos.RemoveAt(i);
                    continue;
                }

                ComboSequenceItem sequenceItem = sequence.items[currentInputIndex];

                if (sequenceItem.inputIndex == input && sequenceItem.TimingIsValid(inputCounter))
                {
                    if (currentInputIndex == sequence.items.Length - 1)
                    {
                        lastSuccessfulCombo = validCombos.Pop(i);
                        comboSystem.messenger.SendOnComboSuccess(sequence);
                    }
                }
                else if (currentInputIndex > 0)
                {
                    validCombos.RemoveAt(i);
                    comboSystem.messenger.SendOnComboFail(sequence);
                }
                else
                {
                    validCombos.RemoveAt(i);
                }
            }

            inputCounter       = 0;
            currentInputIndex += 1;

            if (validCombos.Count == 0)
            {
                EndCombo();
            }
        }
        public void Update()
        {
            if (!comboStarted)
            {
                return;
            }

            inputCounter += Time.deltaTime;

            for (int i = validCombos.Count - 1; i >= 0; i--)
            {
                ComboSequence sequence = validCombos[i];

                if (currentInputIndex >= sequence.items.Length)
                {
                    validCombos.RemoveAt(i);
                    continue;
                }

                ComboSequenceItem sequenceItem = sequence.items[currentInputIndex];

                if (sequenceItem.timeConstraints && inputCounter > sequenceItem.maxDelay)
                {
                    validCombos.RemoveAt(i);
                    comboSystem.messenger.SendOnComboFail(sequence);
                }
            }

            if (validCombos.Count == 0)
            {
                EndCombo();
            }
            else
            {
                comboSystem.messenger.SendOnComboStay();
            }
        }
 public void SetComboTimeConstraints(ComboSequenceItem item, bool enable, float minDelay, float maxDelay)
 {
     item.timeConstraints = enable;
     item.minDelay        = minDelay;
     item.maxDelay        = maxDelay;
 }
        public void SetComboTimeConstraints(string comboName, int inputIndex, bool enable)
        {
            ComboSequenceItem item = GetCombo(comboName).items[inputIndex];

            SetComboTimeConstraints(item, enable, item.minDelay, item.maxDelay);
        }