Exemple #1
0
    void InputHandling()
    {
        if (sequencesToDo[currentSequenceIndex].dI.Count != 0)
        {
            List <KeyCode> forbiddenKeys = new List <KeyCode>();
            foreach (DataInput dI in sequencesToDo[currentSequenceIndex].dI)
            {
                if (Input.GetKeyDown(dI.kc) && !forbiddenKeys.Contains(dI.kc))
                {
                    dI.tFX.getFinish();
                    StartCoroutine(deleteThisOneFromCurrentSequence(dI));
                    forbiddenKeys.Add(dI.kc);
                    Holder.getInstance().Play(successClic);
                    Holder.instance.setText(--nb);

                    if (!inputPressed)
                    {
                        hero.startEnergitize();
                        inputPressed = true;
                    }
                }
            }

            foreach (char c in Input.inputString)
            {
                if (!forbiddenKeys.Contains((KeyCode)c) && (KeyCode)c != KeyCode.LeftShift && (KeyCode)c != KeyCode.RightShift)
                {
                    wrongChar++;
                }
            }
        }
        else
        {
            //print("nextSequence : "+ currentSequenceIndex + "for : " + this.gameObject.name);
            nextSequence();
        }
    }