/// <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; } }
/// <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; } }
/// <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; } }