void printNewInstruction()
    {
        string newInstruct = infoBrg.getNextInstruction();


        if (newInstruct != instruct)
        {
            if (newInstruct != null)
            {
                Debug.Log("Waypoint direction: " + newInstruct);                                // <----DEBUGGING
            }
            if (newInstruct == "Forward")
            {
                EasyTTSUtil.SpeechAdd("Walk " + newInstruct);
                correctDirection = "Forward";
            }
            else if (newInstruct == "Behind")
            {
                EasyTTSUtil.SpeechAdd(" Turn left.");
                correctDirection = "Left";
            }
            else if (newInstruct != null)
            {
                EasyTTSUtil.SpeechAdd("Turn " + newInstruct);
                correctDirection = newInstruct;
            }

            instruct = newInstruct;
        }
    }
Ejemplo n.º 2
0
    void windowsInputFunction()
    {
        string direction = "";

        // Get from Input
        if (Input.GetKey(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.W))
        {
            isMoving  = true;
            direction = "Forward";
            //if (autoWalk)
            //autoWalkInEditor ();
            if (infoBrg.getNextInstruction() == direction)
            {
                moveForward();
            }
        }
        if (Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetKeyDown(KeyCode.A))
        {
            //isMoving = true;
            direction = "Left";
            if (infoBrg.getNextInstruction() == direction)
            {
                rotateAngle(1);
                justTurned = true;
            }
        }
        if (Input.GetKeyDown(KeyCode.RightArrow) || Input.GetKeyDown(KeyCode.D))
        {
            //isMoving = true;
            direction = "Right";
            if (infoBrg.getNextInstruction() == direction)
            {
                rotateAngle(2);
                justTurned = true;
            }
        }
        accessDirection = direction;
        accessLog();

        if (Input.GetKeyUp(KeyCode.UpArrow))
        {
            isMoving = false;
        }
    }