Ejemplo n.º 1
0
        public void ChangeRobot()
        {
            GameObject panel     = GameObject.Find("RobotListPanel");
            string     directory = PlayerPrefs.GetString("RobotDirectory") + Path.DirectorySeparatorChar + panel.GetComponent <ChangeRobotScrollable>().selectedEntry;

            if (Directory.Exists(directory))
            {
                panel.SetActive(false);
                changeRobotPanel.SetActive(false);
                InputControl.EnableSimControls();
                PlayerPrefs.SetString("simSelectedReplay", string.Empty);
                PlayerPrefs.SetString("simSelectedRobot", directory);
                PlayerPrefs.SetString("simSelectedRobotName", panel.GetComponent <ChangeRobotScrollable>().selectedEntry);
                PlayerPrefs.SetInt("hasManipulator", 0); //0 is false, 1 is true
                PlayerPrefs.Save();

                AnalyticsManager.GlobalInstance.LogEventAsync(AnalyticsLedger.EventCatagory.ChangeRobot,
                                                              AnalyticsLedger.EventAction.Clicked,
                                                              "Robot - Exported",
                                                              AnalyticsLedger.getMilliseconds().ToString());

                robotCameraManager.DetachCamerasFromRobot(State.ActiveRobot);
                sensorManager.RemoveSensorsFromRobot(State.ActiveRobot);

                State.ChangeRobot(directory, false);
                RobotTypeManager.IsMixAndMatch = false;
            }
            else
            {
                UserMessageManager.Dispatch("Robot directory not found!", WARNING_TIME);
            }
        }
Ejemplo n.º 2
0
 public void Update()
 {
     if (menuPanel.activeSelf)
     {
         InputControl.DisableSimControls();
     }
     if (lastActive && !menuPanel.activeSelf)
     {
         InputControl.EnableSimControls();
     }
     lastActive = menuPanel.activeSelf;
 }
Ejemplo n.º 3
0
 public void ToggleMaMPanel()
 {
     if (mixAndMatchPanel.activeSelf)
     {
         mixAndMatchPanel.SetActive(false);
         InputControl.EnableSimControls();
     }
     else
     {
         simUI.EndOtherProcesses();
         mixAndMatchPanel.SetActive(true);
         InputControl.DisableSimControls();
     }
 }
Ejemplo n.º 4
0
 public void ToggleChangeRobotPanel()
 {
     if (changeRobotPanel.activeSelf)
     {
         changeRobotPanel.SetActive(false);
         InputControl.EnableSimControls();
     }
     else
     {
         EndOtherProcesses();
         changeRobotPanel.SetActive(true);
         robotListPanel.SetActive(true);
         InputControl.DisableSimControls();
         Auxiliary.FindObject(changeRobotPanel, "PathLabel").GetComponent <Text>().text = PlayerPrefs.GetString("RobotDirectory");
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Reset to the empty grid
        /// </summary>
        public void LoadEmptyGrid()
        {
            changeFieldPanel.SetActive(false);
            InputControl.EnableSimControls();
            loadingPanel.SetActive(true);

            PlayerPrefs.SetString("simSelectedField", PlayerPrefs.GetString("FieldDirectory") + Path.DirectorySeparatorChar + UnityFieldDefinition.EmptyGridName);
            PlayerPrefs.SetString("simSelectedFieldName", UnityFieldDefinition.EmptyGridName);
            PlayerPrefs.Save();
            FieldDataHandler.LoadFieldMetaData(PlayerPrefs.GetString("simSelectedField"));

            AnalyticsManager.GlobalInstance.LogTimingAsync(AnalyticsLedger.TimingCatagory.MainSimulator,
                                                           AnalyticsLedger.TimingVarible.Playing,
                                                           AnalyticsLedger.TimingLabel.ResetField);

            SceneManager.LoadScene("Scene");

            AnalyticsManager.GlobalInstance.StartTime(AnalyticsLedger.TimingLabel.ChangeField,
                                                      AnalyticsLedger.TimingVarible.Playing); // start timer for current field
        }
Ejemplo n.º 6
0
 /// <summary>
 /// These toggle, change, and add functions are tethered in Unity
 /// </summary>
 public void ToggleChangeFieldPanel()
 {
     if (changeFieldPanel.activeSelf)
     {
         changeFieldPanel.SetActive(false);
         InputControl.EnableSimControls();
     }
     else
     {
         EndOtherProcesses();
         changeFieldPanel.SetActive(true);
         if (GameObject.Find("Field").transform.childCount > 1)
         {
             loadEmptyFieldButton.SetActive(true);
         }
         else
         {
             loadEmptyFieldButton.SetActive(false);
         }
         InputControl.DisableSimControls();
         Auxiliary.FindObject(changeFieldPanel, "PathLabel").GetComponent <Text>().text = PlayerPrefs.GetString("FieldDirectory");
     }
 }
Ejemplo n.º 7
0
        public void ChangeField()
        {
            GameObject panel     = GameObject.Find("FieldListPanel");
            string     directory = PlayerPrefs.GetString("FieldDirectory") + Path.DirectorySeparatorChar + panel.GetComponent <ChangeFieldScrollable>().selectedEntry;

            if (Directory.Exists(directory))
            {
                panel.SetActive(false);
                changeFieldPanel.SetActive(false);
                InputControl.EnableSimControls();
                loadingPanel.SetActive(true);
                PlayerPrefs.SetString("simSelectedReplay", string.Empty);
                PlayerPrefs.SetString("simSelectedField", directory);
                PlayerPrefs.SetString("simSelectedFieldName", panel.GetComponent <ChangeFieldScrollable>().selectedEntry);
                PlayerPrefs.Save();

                AnalyticsManager.GlobalInstance.LogTimingAsync(AnalyticsLedger.TimingCatagory.MainSimulator,
                                                               AnalyticsLedger.TimingVarible.Playing,
                                                               AnalyticsLedger.TimingLabel.ResetField);
                AnalyticsManager.GlobalInstance.LogEventAsync(AnalyticsLedger.EventCatagory.ChangeField,
                                                              AnalyticsLedger.EventAction.Changed,
                                                              panel.GetComponent <ChangeFieldScrollable>().selectedEntry.ToString(),
                                                              AnalyticsLedger.getMilliseconds().ToString());

                //FieldDataHandler.LoadFieldMetaData(directory);
                //DPMDataHandler.Load();
                //Controls.Load();
                SceneManager.LoadScene("Scene");

                AnalyticsManager.GlobalInstance.StartTime(AnalyticsLedger.TimingLabel.ChangeField,
                                                          AnalyticsLedger.TimingVarible.Playing); // start timer for current field
            }
            else
            {
                UserMessageManager.Dispatch("Field directory not found!", WARNING_TIME);
            }
        }