コード例 #1
0
        private void OnEnable()
        {
            _connection = WebServerConnection.Instance;
            Commands.RegisterCommand("connect", OnConnect);

            if (String.IsNullOrEmpty(WebServerAddress.Current))
            {
                Debug.LogWarning("Unable to establish webserver connection: No server specified!");
            }
            else
            {
                Debug.Log($"Connecting to {WebServerAddress.Current}");
            }
        }
コード例 #2
0
        protected virtual void OnEnable()
        {
            _connection                 = WebServerConnection.Instance;
            _connection.OnConnected    += InitRemote;
            _connection.OnDisconnected += TerminateRemote;

            if (_connection.Status == ConnectionStatus.Connected)
            {
                InitRemote();
            }

            if (Template == null)
            {
                Debug.LogError("No template set");
                enabled = false;
            }
        }
コード例 #3
0
        private void OnEnable()
        {
            _connection = WebServerConnection.Instance;
            ServerIpTextRenderer.text = String.IsNullOrEmpty(WebServerAddress.Current) ? "No Server specified" : WebServerAddress.Current;
            SubnetTextRenderer.text   = GetSubnet();

            _connection.OnConnected    += OnServerConnected;
            _connection.OnDisconnected += OnServerDisconnected;

            if (_connection.Status == ConnectionStatus.Connected || _connection.Status == ConnectionStatus.Connecting)
            {
                OnServerConnected();
            }
            else
            {
                OnServerDisconnected();
            }
        }