void Update()
    {
        if (FrameStats != null)
        {
            FrameStats.color = this.error ? Color.red : Color.white;

            FrameStats.text = string.Empty;
            if (!string.IsNullOrEmpty(logMessage))
            {
                FrameStats.text += logMessage + "\n";
            }

            if (RemoteManagerUnity.IsConnected)
            {
                arrServiceStats.Update(RemoteManagerUnity.CurrentSession);

                FrameStats.text += arrServiceStats.GetStatsString();
            }
            else if (RemoteManagerUnity.CurrentSession != null)
            {
                FrameStats.text += $"Session id: '{RemoteManagerUnity.CurrentSession.SessionUuid}' \n";
                FrameStats.text += $"Session status: {arrServiceReference.LastProperties.Status}";

                if (arrServiceReference.LastProperties.Status == RenderingSessionStatus.Starting)
                {
                    FrameStats.text += new string('.', (int)(Time.time % 4.0f));
                    FrameStats.text += "\n(this may take a few minutes)";
                }

                FrameStats.text += $"\nConnection status: {RemoteManagerUnity.CurrentSession.ConnectionStatus}";
            }
        }
    }
    void Update()
    {
        if (!RemoteManagerUnity.IsConnected)
        {
            FrameStats.text = "FrameStats is waiting for connection...";
            return;
        }

        arrServiceStats.Update(RemoteManagerUnity.CurrentSession);

        if (FrameStats != null)
        {
            FrameStats.text = arrServiceStats.GetStatsString();
        }
    }