예제 #1
0
    public void RequestCoordinates()
    {
        bool requestSuccess = GPSManager.ReceivePlayerLocation();

        if (!requestSuccess || GPSManager.location == null)
        {
            return;
        }

        if (GPSManager.location[0] == 0 || GPSManager.location[1] == 0 || !GPSManager.IsActive())
        {
            AlertsAPI.instance.makeAlert("GPS desligado!\nAtive o serviço de localização do celular na barra superior do dispositivo.", "Entendi");
            return;
        }

        AlertsAPI.instance.makeToast("Localização obtida", 1);
        string playerLocation = GPSManager.location[0] + " | " + GPSManager.location[1];

        MissionManager.missionResponse.coordinates = playerLocation;
    }