void OnConnectionStatusUpdate(object s) { InternetConnectionStatus.Status status = (InternetConnectionStatus.Status)s; button.onClick.RemoveAllListeners(); buttonGraphic.enabled = true; switch (status) { case InternetConnectionStatus.Status.CONNECTED: buttonGraphic.enabled = false; break; case InternetConnectionStatus.Status.LIMITED: buttonGraphic.sprite = limitedConnectionSprite; button.onClick.AddListener(() => { OnTargetClicked(); }); break; case InternetConnectionStatus.Status.NO_CONNECTION: buttonGraphic.sprite = noConnectionSprite; button.onClick.AddListener(() => { OnTargetClicked(); }); break; case InternetConnectionStatus.Status.UNKNOWN: buttonGraphic.sprite = limitedConnectionSprite; button.onClick.AddListener(() => { OnTargetClicked(); }); break; } }
private void OnConnectionStatusUpdated(object s) { InternetConnectionStatus.Status status = (InternetConnectionStatus.Status)s; switch (status) { case InternetConnectionStatus.Status.LIMITED: case InternetConnectionStatus.Status.CONNECTED: internetAvailable = true; break; case InternetConnectionStatus.Status.NO_CONNECTION: case InternetConnectionStatus.Status.UNKNOWN: internetAvailable = false; break; } }