public void SetPlayerAspect(XrRemoteApp.Reader remote)
        {
#if UNITY_EDITOR
            // When the client keeps running and the server restarts, remote.hasDevice() is false
            XRRemoteUtils.SetGameViewAspectRatio(remote);
#endif
        }
        public Vector2 GameViewSize()
        {
#if UNITY_EDITOR
            return(XRRemoteUtils.GameViewSize());
#else
            return(new Vector2(0.0f, 0.0f));
#endif
        }
        public void CheckADB()
        {
#if UNITY_EDITOR
            if (!timeout() && !XRRemoteUtils.SetupADB() && !remote_.IsConnected())
            {
                remote_.Start(1);
            }
#endif
        }
        private void InternalStart()
        {
            startTime_    = DateTime.MinValue; // on first Update it will assign to current time.
            orientation_  = UnityEditor.PlayerSettings.defaultInterfaceOrientation;
            computerName_ = XRRemoteUtils.getHostname();

            if (!XRRemoteUtils.SetupADB())
            {
                remote_.Start(1);
                thread_ = new System.Threading.Thread(ThreadRun);
                thread_.Start();
                thread_.Name = "CHILD";
            }
        }
 private void ThreadRun()
 {
     threadRunning_ = true;
     while (threadRunning_)
     {
         if (tick_)
         {
             if (!remote_.IsConnected())
             {
                 XRRemoteUtils.SetupADB();
             }
             remote_.Update();
             tick_ = false;
         }
         else
         {
             System.Threading.Thread.Sleep(100);
         }
     }
 }
 private void Disconnect()
 {
     threadRunning_ = false;
     XRRemoteUtils.TeardownADB();
     remote_.Disconnect();
 }