Example #1
0
    public void TagButtonAction()
    {
        TagButton.SetActive(false);
        //SelectedActivityIndex to ActualActivityNumber.
        LUT();

        //disable dropdown menus
        Dropdown1.GetComponent <Button>().interactable = false;
        Dropdown2.GetComponent <Button>().interactable = false;

        //pointing arrow
        ActivityIndicator();

        //activate canvas that shows a list of resources.
        UpdateResourceText();
        ManualSelectionListPanel.SetActive(true);

        Debug.Log("Actual Activity Number: " + ActualActivityNumber);

        //Show hide button will mess with LS activity.
        if (ActualActivityNumber != 8 && ActualActivityNumber != 9 && ActualActivityNumber != 10 && ActualActivityNumber != 11)
        {
            ShowHideButton.SetActive(true);
        }

        //Turn on interactable and box according to activity.
        if (ActualActivityNumber == 1)
        {
            A1Dozer.GetComponent <Interactable>().IsEnabled     = true;
            A1Stockpile.GetComponent <Interactable>().IsEnabled = true;
            A1Dozer.transform.Find("Cube").gameObject.SetActive(true);
            A1Stockpile.transform.Find("Cube").gameObject.SetActive(true);
        }
        if (ActualActivityNumber == 2)
        {
            A2Crane.transform.Find("Cube").gameObject.SetActive(true);
            A2Crane.GetComponent <Interactable>().IsEnabled = true;

            A2SteelBeam.transform.Find("Cube").gameObject.SetActive(true);
            A2SteelBeam.GetComponent <Interactable>().IsEnabled = true;
        }
        if (ActualActivityNumber == 3)
        {
            A3Rebar.transform.Find("Cube").gameObject.SetActive(true);
            A3Rebar.GetComponent <Interactable>().IsEnabled = true;
            A3Truck.transform.Find("Cube").gameObject.SetActive(true);
            A3Truck.GetComponent <Interactable>().IsEnabled = true;
        }
        if (ActualActivityNumber == 4)
        {
            A4Worker1.transform.Find("Cube").gameObject.SetActive(true);
            A4Worker1.GetComponent <Interactable>().IsEnabled = true;
        }
        if (ActualActivityNumber == 5)
        {
            A5DumpTruck.GetComponent <Interactable>().IsEnabled = true;
            A5DumpTruck.transform.Find("Cube").gameObject.SetActive(true);
            A5Loader.GetComponent <Interactable>().IsEnabled = true;
            A5Loader.transform.Find("Cube").gameObject.SetActive(true);
            A5Stockpile.GetComponent <Interactable>().IsEnabled = true;
            A5Stockpile.transform.Find("Cube").gameObject.SetActive(true);
        }
        if (ActualActivityNumber == 6)
        {
            A6log.GetComponent <Interactable>().IsEnabled = true;
            A6log.transform.Find("Cube").gameObject.SetActive(true);
            A6rebar.GetComponent <Interactable>().IsEnabled = true;
            A6rebar.transform.Find("Cube").gameObject.SetActive(true);
            A6wood.GetComponent <Interactable>().IsEnabled = true;
            A6wood.transform.Find("Cube").gameObject.SetActive(true);
        }
        if (ActualActivityNumber == 7)
        {
            A7worker1.GetComponent <Interactable>().IsEnabled = true;
            A7worker1.transform.Find("Cube").gameObject.SetActive(true);
            A7worker2.GetComponent <Interactable>().IsEnabled = true;
            A7worker2.transform.Find("Cube").gameObject.SetActive(true);
            A7worker3.GetComponent <Interactable>().IsEnabled = true;
            A7worker3.transform.Find("Cube").gameObject.SetActive(true);
        }

        //Skip for LS and Drone
        if (ActualActivityNumber == 8)
        {
            RunButton.SetActive(true);
        }
        if (ActualActivityNumber == 9)
        {
            RunButton.SetActive(true);
        }
        if (ActualActivityNumber == 10)
        {
            RunButton.SetActive(true);
        }
        if (ActualActivityNumber == 11)
        {
            RunButton.SetActive(true);
        }
        if (ActualActivityNumber == 12)
        {
            RunButton.SetActive(true);
        }

        //Worker IMU

        /*
         * if (ActualActivityNumber == 13)
         * {
         *  A13Painter.GetComponent<Interactable>().IsEnabled = true;
         *  A13Painter.transform.Find("Cube").gameObject.SetActive(true);
         *  A13Laborer.GetComponent<Interactable>().IsEnabled = true;
         *  A13Laborer.transform.Find("Cube").gameObject.SetActive(true);
         *  A13Carpenter.GetComponent<Interactable>().IsEnabled = true;
         *  A13Carpenter.transform.Find("Cube").gameObject.SetActive(true);
         *  A13Carpenter2.GetComponent<Interactable>().IsEnabled = true;
         *  A13Carpenter2.transform.Find("Cube").gameObject.SetActive(true);
         * }
         */

        //20201208 IMU workers addition
        //GPS RFID for IMU workers
        if (ActualActivityNumber == 13)
        {
            A13Painter.GetComponent <Interactable>().IsEnabled = true;
            A13Painter.transform.Find("Cube").gameObject.SetActive(true);
        }
        if (ActualActivityNumber == 14)
        {
            A13Laborer.GetComponent <Interactable>().IsEnabled = true;
            A13Laborer.transform.Find("Cube").gameObject.SetActive(true);
        }
        if (ActualActivityNumber == 15)
        {
            A13Carpenter.GetComponent <Interactable>().IsEnabled = true;
            A13Carpenter.transform.Find("Cube").gameObject.SetActive(true);
        }

        //20201207 Changed IMU

        //P
        if (SelectedSensorIndex == 04 && ActualActivityNumber == 13)
        {
            ManualSelectionListPanel.SetActive(false);
            IMU_P.SetActive(true);
        }
        //L
        if (SelectedSensorIndex == 04 && ActualActivityNumber == 14)
        {
            ManualSelectionListPanel.SetActive(false);
            IMU_L.SetActive(true);
        }
        //C
        if (SelectedSensorIndex == 04 && ActualActivityNumber == 15)
        {
            ManualSelectionListPanel.SetActive(false);
            IMU_C.SetActive(true);
        }
    }