예제 #1
0
 void CheckInputNeeded()
 {
     if (inputValue != 0 && !canjusteOneTone && isTimerActive)
     {
         if (inputWanted == inputValue)
         {
             Instance.SucessNote();
         }
         else
         {
             Instance.FailNote();
         }
         canStartTimer = false;
         inputValue    = 0;
         Active(false);
     }
 }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        if (_inputSaisi != 0 && !_justeOneNote)
        {
            //_justeOneNote = true;
            Debug.Log(name);
            Debug.Log(_inputSaisi);
            //StartCoroutine(WaitBeforeAnotherInput());
            if (inputWanted == _inputSaisi)
            {
                Debug.Log("true");
                guitardHeroGM.SucessNote();
            }
            else
            {
                Debug.Log("false");
                guitardHeroGM.FailNote();
            }
            _timerStart = false;
            _inputSaisi = 0;
            gameObject.SetActive(false);
        }

        if (!_timerStart)
        {
            _timerStart = true;
            StartTimer();
        }
        else
        {
            if (Time.time > _endTime)
            {
                Debug.Log("false");
                guitardHeroGM.FailNote();
                _inputSaisi = 0;
                _timerStart = false;
                gameObject.SetActive(false);
            }
        }

        if (Input.GetKeyDown(KeyCode.Joystick1Button0))
        {
            _inputSaisi = 1;
        }
        if (Input.GetKeyDown(KeyCode.Joystick1Button1))
        {
            _inputSaisi = 2;
        }
        if (Input.GetKeyDown(KeyCode.Joystick1Button2))
        {
            _inputSaisi = 3;
        }
        if (Input.GetKeyDown(KeyCode.Joystick1Button3))
        {
            _inputSaisi = 4;
        }
        if (Input.GetKeyDown(KeyCode.Joystick1Button5))
        {
            _inputSaisi = 5;
        }
    }