void Update()
    {
        var euler = _table_input.GetEuler();

        for (int id = 0; id < _division; id++)
        {
            int min = (_interval * id) - _range;
            if ((_interval * id) - _range < euler && euler < (_interval * id) + _range)
            {
                _current_id = id;
            }
            else
            // 対策
            if (euler > 360 - _range)
            {
                _current_id = 0;
            }
        }
    }
Esempio n. 2
0
    // Update is called once per frame
    void Update()
    {
        if (isDebug)
        {
            _debugDegree_text.text = (_tableInput.GetEuler()).ToString();
            _nowPos_text.text      = "Now: " + (_sectionDetectore.GetCurrentId() + 1).ToString();
        }

        if (isUpdate)
        {
            nowTime -= Time.deltaTime;
            // Debug.Log(nowTime);
            if (nowTime <= 0.0f)
            {
                Debug.Log("時間切れ!");
                nowTime = 0.0f;
                _displayManager.SetCountDown(nowTime);
                isUpdate = false;
                _soundManager.PlaySEWrong();
                StartCoroutine("sleep", 1);
                SceneManager.LoadScene("Result");
            }
            else
            {
                _displayManager.SetCountDown(nowTime);
            }

            switch (nowType)
            {
            case 0:
                UpdateAfterPush();
                break;

            case 1:
                UpdateBeforePush();
                break;
            }
        }
    }