void Start()
    {
        _connectionTester = ConnectionTester
                            .GetInstance(gameObject)
                            .ipToTest("www.google.com");

        ButtonTestInternet.onClick.AddListener(() =>
        {
            ShowFeedback("Starting test");
            _connectionTester.TestInternet(hasInternet =>
            {
                ShowFeedback($"Has internet connection: {hasInternet}");
            });
        });
    }
示例#2
0
    public void ProcessInfo()
    {
        var myText = inpCaseNumber.text;

        if (string.IsNullOrEmpty(myText))
        {
            Debug.LogWarning("Input alanı boş geçilemez.");
            ShowFeedback("Input alanı boş geçilemez.");
        }
        else
        {
            var newCase = UiManager.Instance.CreateCase(myText, "ONENT");

            ISearchService searchService = new SearchService(new Repository <SearchLog>(UiManager.Instance.DataContext));

            _connectionTester = ConnectionTester
                                .GetInstance(gameObject)
                                .ipToTest("www.google.com");


            ShowFeedback("Starting test");
            // Internet connection checked basically
            //if (Application.internetReachability == NetworkReachability.NotReachable)
            //{
            //    newCase.Text = "Internet Connection is not available";
            //}
            _connectionTester.TestInternet(hasInternet =>
            {
                if (hasInternet)
                {
                    searchService.InsertSearchLog(newCase);

                    locationPanel.gameObject.SetActive(true);
                }
                ShowFeedback($"Has internet connection: {hasInternet}");
            });
        }

        void ShowFeedback(string text)
        {
            FeedbackText.text = text;
        }
    }