/// <summary> /// JUmps to recording /// </summary> public void SendRecordingCommand() { state = SendJSonStates.IDLE; UnityEngine.Debug.Log("Load recording scene"); //DontDestroyOnLoad(GameObject.Find("Daemodel")); UnityEngine.SceneManagement.SceneManager.LoadScene("Recording"); // ## TODO: }
/// <summary> /// This was called by a done button in planning. Is not used anymore /// </summary> public void BeginSending() { //doneButton.GetComponent<Button>().interactable = false; //doneButton.GetChild(1).GetComponent<Text>().color = new Vector4(1, 1, 1, 0.4f); MainPlanningUI.SavePath(); if (clientUnity.client.isConnected) { state = SendJSonStates.SENDPATHREQUEST; } }
/// <summary> /// Requests the paths on the server before uploading the files /// </summary> void SendPathRequest() { if (clientUnity != null && clientUnity.client != null && clientUnity.client.isConnected) { UnityEngine.Debug.Log("Sending map metadata"); clientUnity.client.SendCommand((byte)Modules.PLAN_LIBRARIAN_MODULE, (byte)PlanLibrarianCommandType.PLAN_LIB_REQUEST_LIBRARY_PATH); //UnityEngine.Debug.Log("Version Get: " + AtreyuManager.majorV + "." + AtreyuManager.minorV + "." + AtreyuManager.patchV); state = SendJSonStates.RECEIVEPATHREQUEST; } }
// Update is called once per frame // In model alignment, first we will consult if the server doesn't have a metadata that we have, and if it doesn't have it, this script state will change to SENDPATHREQUEST and start uploading everything void Update() { switch (state) { case SendJSonStates.IDLE: //throbberImage.gameObject.SetActive(false); //doneButton.GetComponent<Button>().interactable = true; //doneButton.GetChild(1).GetComponent<Text>().color = new Vector4(1, 1, 1, 1); //doneText.text = "Press done\nto proceed"; break; case SendJSonStates.SENDPATHREQUEST: if (retry) { //doneText.text = "Sending map\nto server"; //throbberImage.gameObject.SetActive(true); SendPathRequest(); StartCoroutine(WaitForResponse()); } //throbberImage.Rotate(0, 0, -180 * Time.deltaTime); break; case SendJSonStates.RECEIVEPATHREQUEST: if (pathsSend) { state = SendJSonStates.RECEIVEDATAFILESRESPONSE; } //throbberImage.Rotate(0, 0, -180 * Time.deltaTime); break; case SendJSonStates.RECEIVEDATAFILESRESPONSE: if (allFilesSent) { SendRecordingCommand(); } //throbberImage.Rotate(0, 0, -180 * Time.deltaTime); break; default: break; } }