Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        privateNoteList.Add(notes.checkNoteInput());
        notes.cleanLastPlayedNotes(privateNoteList);

        int correctInput = goThroughOptions(new int[][] { forwards, backwards, right, left });

        if (correctInput >= 0)
        {
            switch (correctInput)
            {
            case 0:
                //go forward
                break;

            case 1:
                //go back
                break;

            case 2:
                //go right
                break;

            case 3:
                //go left
                break;
            }
        }
    }
    // Update is called once per frame
    void Update()
    {
        if (coroutineAllowed)
        {
            StartCoroutine(GoByTheRoute(routeToGo));
        }

        //Vector3 p0 = routes[0].GetChild(0).position;
        //Vector3 p1 = routes[0].GetChild(1).position;
        //Vector3 p2 = routes[0].GetChild(2).position;
        //Vector3 p3 = routes[0].GetChild(3).position;

        //objectPosition = Mathf.Pow(1 - tParam, 3) * p0 + 3 * Mathf.Pow(1 - tParam, 2) * tParam * p1 + 3 * (1 - tParam) * Mathf.Pow(tParam, 2) * p2 + Mathf.Pow(tParam, 3) * p3;
        //transform.position = objectPosition;

        if (notes.checkNoteInput() > -1)
        {
            privateNoteList.Add(notes.checkNoteInput());
        }

        notes.cleanLastPlayedNotes(privateNoteList);
        ///Debug.Log(privateNoteList[0]);

        int correctInput = goThroughOptions(new int[][] { right, left });

        Debug.Log(correctInput);


        switch (correctInput)
        {
        case -1:

            break;

        case 0:
            if (mounted == true)
            {
                moveSpeed = Time.deltaTime;
            }
            //go right
            break;

        case 1:
            if (mounted == true)
            {
                moveSpeed = -Time.deltaTime;
            }
            //go left
            break;

            //case 2:
            //    //go right
            //    break;

            //case 3:
            //    //go left
            //    break;
        }

        sideToSide += moveSpeed;
        sideToSide  = Mathf.Clamp(sideToSide, -2f, 2f);
    }