/// <summary>
        /// A routine that starts the host, it requires a couple of frames to properly start the components
        /// </summary>
        private IEnumerator StartHostRoutine()
        {
            SpectatorViewNetworkDiscovery.ManualStart();
            yield return(null);

            NewDeviceDiscovery.ManualStart();
        }
 /// <summary>
 /// Stops broadcasting, it needs to wait a frame for it to be properly stopped
 /// </summary>
 private IEnumerator StopBroadcastRoutine()
 {
     if (NewDeviceDiscovery == null)
     {
         NewDeviceDiscovery = FindObjectOfType <NewDeviceDiscovery>();
     }
     NewDeviceDiscovery.StopBroadcast();
     yield return(null);
 }
        /// <summary>
        /// Starts the system in server or client mode depending on isHost
        /// </summary>
        public void ManualStart()
        {
            // Auto find components if necessary
            if (MarkerGeneration3D == null)
            {
                MarkerGeneration3D = FindObjectOfType <MarkerGeneration3D>();
            }

            if (MarkerDetectionHololens == null)
            {
                MarkerDetectionHololens = FindObjectOfType <MarkerDetectionHololens>();
            }

            if (NewDeviceDiscovery == null)
            {
                NewDeviceDiscovery = FindObjectOfType <NewDeviceDiscovery>();
            }

            // If it isn't supposed to start listening/broadcasting exit the method
            if (!AutoStart)
            {
                return;
            }

            Initialize();
            if (!isHost)
            {
                StartAsClient();
            }
            else
            {
                StartAsServer();
                if (MarkerDetectionHololens != null)
                {
                    MarkerDetectionHololens.OnMarkerDetected += OnMarkerDetected;
                }
            }
        }