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}"); } }
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; } }
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(); } }