/// <summary> /// Indicator for VM connection status /// </summary> private System.Collections.IEnumerator UpdateVMConnectionStatus() // TODO move to emulation toolbar { while (true) { if (EmulatorManager.IsVMConnected()) { VMConnectionStatusImage.sprite = EmulatorConnection; if (EmulatorNetworkConnection.Instance.IsConnected()) { VMConnectionStatusMessage.text = "Connected"; } else { VMConnectionStatusMessage.text = "Ready"; RobotDisabled(); } if (!EmulatorManager.IsRunningRobotCodeRunner() && !EmulatorManager.IsTryingToRunRobotCode() && !EmulatorManager.IsRobotCodeRestarting()) { EmulatorManager.RestartRobotCode(); } } else { if (!EmulatorManager.IsVMInstalled()) { VMConnectionStatusImage.sprite = EmulatorNotInstalled; VMConnectionStatusMessage.text = "Not Installed"; } else if (!EmulatorManager.IsVMRunning()) { VMConnectionStatusImage.sprite = StartEmulator; VMConnectionStatusMessage.text = "Start Emulator"; } else { VMConnectionStatusImage.sprite = EmulatorConnection; VMConnectionStatusMessage.text = "Starting"; } RobotDisabled(); } yield return(new WaitForSeconds(1.0f)); // s } }