Example #1
0
 public void EnterTutorialLocomotion()
 {
     tutorialState = "Locomotion";
     currentState  = tutorialState;
     ResetRobotObject();
     robotManager.DeactivateSensorsOfType("IR");
     robotManager.DeactivateSensorsOfType("LDR");
     robotManager.DeactivateSensorsOfType("MIC");
     GameObject.Find("Audio Source").GetComponent <AudioSource>().enabled = false;
     //RobotController.reset = true;
     //robotController.enabled = true;
     locomotionCanvas.enabled = true;
     SwitchTutorialButtons();
 }
Example #2
0
    public void EnterTask()
    {
        Vector3 envLightPos;

        Debug.Log("EnterTask()");

        if (currentTask == "Task1")        //Or do this by tags?
        {
            ResetRobotObject();
            robotManager.DeactivateSensorsOfType("IR");
            robotManager.DeactivateSensorsOfType("LDR");
            robotManager.DeactivateSensorsOfType("MIC");
            robotManager.DeactivateSensorsOfType("RGB");
            Debug.Log("Deactivated all Sensor Types");

            Debug.Log("Activating LDR, and LDR only...!");
            robotManager.ActivateSensorsOfType("LDR");
            envLightObject = GameObject.Instantiate(envLightPrefab, environment.transform);
            envLightPos    = envLightObject.transform.position;
            envLightPos.x  = 0.0f;
            envLightObject.transform.position = envLightPos;
        }
        else if (currentTask == "Task2")
        {
            ResetRobotObject();
            robotManager.DeactivateSensorsOfType("IR");
            robotManager.DeactivateSensorsOfType("LDR");
            robotManager.DeactivateSensorsOfType("MIC");
            robotManager.DeactivateSensorsOfType("RGB");
            Debug.Log("Deactivated all Sensor Types");

            robotManager.ActivateSensorsOfType("MIC");
            robotManager.ActivateSensorsOfType("IR");
        }
        else if (currentTask == "Task3")
        {
            ResetRobotObject();
            robotManager.DeactivateSensorsOfType("IR");
            robotManager.DeactivateSensorsOfType("LDR");
            robotManager.DeactivateSensorsOfType("MIC");
            robotManager.DeactivateSensorsOfType("RGB");
            Debug.Log("Deactivated all Sensor Types");

            //robotManager.ActivateSensorsOfType("IR");
            TaskThreeWalls();
            robotManager.ActivateSensorsOfType("RGB");
        }
        else if (currentTask == "Task4")
        {
            if (robotObject == null)
            {
                robotObject = GameObject.Find("Robot");
                //If there isn't a robot yet, reset.
                if (robotObject == null)
                {
                    ResetRobotObject();
                }
                robotObject.transform.SetPositionAndRotation(Vector3.zero, Quaternion.identity);
            }
            SetupCameraPOV();
            robotManager.ActivateSensorsOfType("LDR");
            robotManager.ActivateSensorsOfType("IR");
            robotManager.ActivateSensorsOfType("MIC");
            robotManager.ActivateSensorsOfType("RGB");
        }
        taskCanvas.enabled = false;
    }