Пример #1
0
    // Start is called before the first frame update
    void Start()
    {
        // Initialization of all UI Texts
        texts = new List <Text>()
        {
            text1, text2, text3, text4, text5, text6, text7, text8, text9, text10, text11, text12, text13, text14, text15, text16
        };
        operations = new List <Operation>();
        // Inserting all tasks in array
        operations.Add(new Operation("1. Dismantle the ball valves"));
        operations.Add(new Operation("2. Remove the backlid"));
        operations.Add(new Operation("3. Remove the screws"));
        operations.Add(new Operation("4. Remove the dosing head"));
        operations.Add(new Operation("5. Move the diaphragm forward"));
        operations.Add(new Operation("6. Remove the diaphragm"));
        operations.Add(new Operation("7. Remove the drainer"));
        operations.Add(new Operation("8. Remove the worn out o-ring"));
        operations.Add(new Operation("9. Assemble the new o-ring"));
        operations.Add(new Operation("10. Attach the drainer"));
        operations.Add(new Operation("11. Attach the diaphragm"));
        operations.Add(new Operation("12. Move the diaphragm backwards"));
        operations.Add(new Operation("13. Mount the dosing head"));
        operations.Add(new Operation("14. Place and tighten the screws"));
        operations.Add(new Operation("15. Attach the backlid"));
        operations.Add(new Operation("16. Assemble the ball valves"));

        for (int i = 0; i < 16; i++)
        {
            texts[i].text = operations[i].getName();
        }
        manager = FindObjectOfType <SceneLevelManager>();
        setCurrentTask(manager.GetComponent <SceneLevelManager>().getCurrentSceneNumber());
        focusOnTaskInStepList(manager.GetComponent <SceneLevelManager>().getCurrentSceneNumber());
    }
    // Update is called once per frame
    void Update()
    {
        print("Screwaction is on object: " + name);
        float distLeft  = Vector3.Distance(leftHand.transform.position, transform.position);
        float distRight = Vector3.Distance(rightHand.transform.position, transform.position);

        //print("Print: "+distRight);
        if ((leftHand.isGrabbing == true && distLeft <= distanceToHand) || (rightHand.isGrabbing == true && distRight <= distanceToHand))
        {
            performAction = true;
            // Green color glow
        }
        if (endPos.GetComponent <SimpleAnimation>().done)
        {
            // Stop glow
            performAction = false;
            //PersistenceManager.Instance.valveAmount += 1;
            if (this.tag == "ShiftItem")
            {
                manager.GetComponent <SceneLevelManager>().LoadScene(manager.GetComponent <SceneLevelManager>().getCurrentSceneNumber() + 1);
                // manager.LoadScene(manager.getCurrentSceneNumber()+1);
            }
        }
        if (performAction == true)
        {
            endPos.GetComponent <SimpleAnimation>().Animate();
        }
    }
    // Update is called once per frame
    void Update()
    {
        print("Bad script on: " + name);
        float distLeft  = Vector3.Distance(leftHand.transform.position, transform.position);
        float distRight = Vector3.Distance(rightHand.transform.position, otherButton.transform.position);

        if ((leftHand.isGrabbing == true && distLeft <= distanceToHand) && (rightHand.isGrabbing == true && distRight <= distanceToHand))
        {
            // The buttons are pressed simultaneously -> give feedback to user

            manager.GetComponent <SceneLevelManager>().LoadScene(manager.GetComponent <SceneLevelManager>().getCurrentSceneNumber() + 1);
        }
    }
Пример #4
0
 // Update is called once per frame
 void Update()
 {
     //for (int i = 0; i < 20; i++) {
     //    if (Input.GetKeyDown("joystick 1 button " + i)) {
     //        print("joystick 1 button " + i);
     //    }
     //}
     if ((Input.GetAxis(trackpadLeft) == 1.0f && Input.GetKeyDown(taskLeftController)) || (Input.GetAxis(trackpadRight) == 1.0f && Input.GetKeyDown(taskRightController)))
     {
         // Click at the bottom part of the trackpad
         if (getCurrentTask() <= 15)
         {
             nextTask();
             focusOnTaskInStepList(getCurrentTask());
         }
     }
     if (Input.GetAxis(trackpadLeft) == -1.0f && Input.GetKeyDown(taskLeftController) || (Input.GetAxis(trackpadRight) == -1.0f && Input.GetKeyDown(taskRightController)))
     {
         // Click at the top part of the trackpad
         if (getCurrentTask() >= 2)
         {
             previousTask();
             focusOnTaskInStepList(getCurrentTask());
         }
     }
     if (Input.GetAxis(trackpadRight) > -0.95f && Input.GetAxis(trackpadRight) < 0.95f && (Input.GetKeyDown(taskRightController) || Input.GetKeyDown(taskLeftController)))
     {
         // Click at the center of the trackpad
         manager.GetComponent <SceneLevelManager>().LoadScene(getCurrentTask());
     }
 }
Пример #5
0
 // Start is called before the first frame update
 void Start()
 {
     manager = FindObjectOfType <SceneLevelManager>();
     FindRelevantUITexts();
     texts = new List <Text>()
     {
         text1, text2, text3, text4
     };
     sceneNumber = manager.GetComponent <SceneLevelManager>().getCurrentSceneNumber();
     foreach (Text t in texts)
     {
         t.text = "";
     }
 }
Пример #6
0
    // Update is called once per frame
    void Update()
    {
        switch (sceneNumber)
        {
        case -1:
            text1.text = "Display shows warning \nTime to replace the o-ring";
            text2.text = "Put on the left glove";
            text3.text = "Put on the right glove";
            text4.text = "Put on the safety glasses";
            break;

        case 0:
            text1.text = "Turn the gribs \nto remove the pressure";
            break;

        case 1:
            text1.text = "Remove the top ball valve";
            text2.text = "Remove the bottom ball valve";
            break;

        case 2:
            text1.text = "Remove the backlid";
            break;

        case 3:
            text1.text = "Remove the first screw";
            text2.text = "Remove the second screw";
            text3.text = "Remove the third screw";
            text4.text = "Remove the fourth screw";
            break;

        case 4:
            text1.text = "Remove the dosing head";
            break;

        case 5:
            text1.text = "Open the frontlid";
            text2.text = "Press the two buttons at the same \ntime for 2 seconds";
            break;

        case 6:
            text1.text = "Unscrew and remove the diaphragm";
            break;

        case 7:
            text1.text = "Remove the drainer";
            break;

        case 8:
            text1.text = "Remove the worn out o-ring";
            break;

        case 9:
            text1.text = "Attach the new o-ring";
            break;

        case 10:
            text1.text = "Attach the drainer";
            break;

        case 11:
            text1.text = "Attach the diaphragm and screw it into place";
            break;

        case 12:
            text1.text = "Press the two buttons at the same \ntime for 2 seconds";
            break;

        case 13:
            text1.text = "Attach the dosing head";
            break;

        case 14:
            if (manager.GetComponent <SceneLevelManager>().donePlacingScrews == false)
            {
                text1.text = "Place the first screw";
                text2.text = "Place the second screw";
                text3.text = "Place the third screw";
                text4.text = "Place the fourth screw";
            }
            if (manager.GetComponent <SceneLevelManager>().donePlacingScrews == true)
            {
                text1.text = "Tighten the first screw";
                text2.text = "Tighten the fourth screw";
                text3.text = "Tighten the second screw";
                text4.text = "Tighten the third screw";
            }
            break;

        case 15:
            text1.text = "Attach the backlid";
            break;

        case 16:
            text2.text = "Attach and tighten \nthe top ball valve";
            text1.text = "Attach and tighten \nthe bottom ball valve";
            break;

        default:

            break;
        }
    }