Пример #1
0
    void Update()
    {
        apiCheckCountdown -= Time.deltaTime;
        if (apiCheckCountdown <= 0)
        {
            apiCheckCountdown = EndPointRefreshInSeconds;
            if (PrevPoint != null)
            {
                double distance = PrevPoint.CalcDistance(latitude, longitude);
                if (distance < radius / 2 && distance < MininmumDistance) // if no significant movement, ha, no need to call again the End Point and consume internet data
                {
                    Debug.Log("Skip calling EndPoint! No serious movement from last call!");
                    return;
                }
            }

            StartCoroutine(GetPOI());
        }
    }