Exemplo n.º 1
0
 /// <summary>
 /// Returns the robot to a default starting spawnpoint
 /// </summary>
 public void BeginRevertSpawnpoint()
 {
     robotStartPosition = new Vector3(0f, 1f, 0f);
     state.BeginRobotReset();
     state.EndRobotReset();
     state.BeginRobotReset();
 }
        /// <summary>
        /// Reset robot dropdown callback. Note: Dropdowns register with "On...Clicked"
        /// naming conventions.
        /// </summary>
        /// <param name="i"></param>
        public void OnResetRobotDropdownValueChanged(int i)
        {
            switch (i)
            {
            case 1:
                State.BeginRobotReset();
                State.EndRobotReset();
                resetDropdown.GetComponent <Dropdown>().value = 0;
                break;

            case 2:
                GameObject.Destroy(GameObject.Find("Dropdown List"));
                EndOtherProcesses();
                resetDropdown.GetComponent <Dropdown>().value = 0;
                State.BeginRobotReset();
                break;

            case 3:
                Auxiliary.FindObject(canvas, "ResetRobotDropdown").SetActive(false);
                Auxiliary.FindObject(canvas, "LoadingPanel").SetActive(true);
                SceneManager.LoadScene("Scene");
                resetDropdown.GetComponent <Dropdown>().value = 0;
                break;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Reset robot dropdown callback. Note: Dropdowns register with "On...Clicked"
        /// naming conventions.
        /// </summary>
        /// <param name="i"></param>
        public void OnResetRobotDropdownValueChanged(int i)
        {
            AnalyticsManager.GlobalInstance.LogEventAsync(AnalyticsLedger.EventCatagory.Reset,
                                                          AnalyticsLedger.EventAction.Clicked,
                                                          "Reset - Dropdown",
                                                          AnalyticsLedger.getMilliseconds().ToString());

            switch (i)
            {
            case 1:
                State.BeginRobotReset();
                State.EndRobotReset();
                resetDropdown.GetComponent <Dropdown>().value = 0;

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

            case 2:
                GameObject.Destroy(GameObject.Find("Dropdown List"));
                EndOtherProcesses();
                resetDropdown.GetComponent <Dropdown>().value = 0;
                State.BeginRobotReset();

                AnalyticsManager.GlobalInstance.LogEventAsync(AnalyticsLedger.EventCatagory.Reset,
                                                              AnalyticsLedger.EventAction.Clicked,
                                                              "Reset - Robot Spawnpoint",
                                                              AnalyticsLedger.getMilliseconds().ToString());
                break;

            case 3:
                Auxiliary.FindObject(canvas, "ResetRobotDropdown").SetActive(false);
                Auxiliary.FindObject(canvas, "LoadingPanel").SetActive(true);
                SceneManager.LoadScene("Scene");
                resetDropdown.GetComponent <Dropdown>().value = 0;

                AnalyticsManager.GlobalInstance.LogEventAsync(AnalyticsLedger.EventCatagory.Reset,
                                                              AnalyticsLedger.EventAction.Clicked,
                                                              "Reset - Field",
                                                              AnalyticsLedger.getMilliseconds().ToString());
                AnalyticsManager.GlobalInstance.LogTimingAsync(AnalyticsLedger.TimingCatagory.MainSimulator,
                                                               AnalyticsLedger.TimingVarible.Playing,
                                                               AnalyticsLedger.TimingLabel.ResetField);
                break;
            }
        }
Exemplo n.º 4
0
    /// <summary>
    /// Toggles between quick reset and reset spawnpoint
    /// </summary>
    /// <param name="i"></param>
    public void ChooseResetMode(int i)
    {
        switch (i)
        {
        case 1:
            main.BeginRobotReset();
            main.EndRobotReset();
            resetDropdown.GetComponent <Dropdown>().value = 0;
            break;

        case 2:
            EndOtherProcesses();
            main.BeginRobotReset();
            resetDropdown.GetComponent <Dropdown>().value = 0;
            break;
        }
    }