Beispiel #1
0
    private async void LateUpdate()
    {
        UpdateValues();

        if (time > (float)(1 / reqPerSeconds))
        {
            time = 0;

            // Update Available Objects
            try
            {
                if (WebSocketsBehaviour.GetWsConnectionState() != "Open" || !isSceneReadyToChange ||
                    currentLocation == null)
                {
                    return;
                }

                isSceneReadyToChange = false;
                await ReceiveServerGeoObjects();

                isSceneReadyToChange = true;
            }
            catch (Exception e)
            {
                Debug.LogError(e);
            }
        }

        time += Time.deltaTime;
    }
Beispiel #2
0
    private async Task Start()
    {
        geoObjectsInScene.Add(new Dictionary <string, GameObject>()); // GeoTexts
        geoObjectsInScene.Add(new Dictionary <string, GameObject>()); // GeoModels
        geoObjectsInScene.Add(new Dictionary <string, GameObject>()); // GeoAudios

        DetermineApplicationPlatform();
        AssetBundle.UnloadAllAssetBundles(true);

        _arSessionOrigin = GameObject.FindWithTag("ARSessionOrigin");
        _mainCamera      = Camera.main;

        GPSEncoder.Init();

        await RunGpsTracking();

        webSockets = GetComponent <WebSocketsBehaviour>();
    }
    private async Task Start()
    {
        DetermineApplicationPlatform();
        //
        downloadedAudio = new List <String>();

        _arSessionOrigin = GameObject.FindWithTag("ARSessionOrigin");
        _mainCamera      = Camera.main;

        GPSEncoder.Init();

        //_arSessionOrigin.transform.rotation = Quaternion.Euler(0, -GetCompassTrueHeading(), 0);
        await RunGpsTracking();

        webSockets = GetComponent <WebSocketsBehaviour>();
        // offsetFromTrue = GetCompassTrueHeading();
        // ToNorth.transform.rotation = Quaternion.Euler(0, GetCompassTrueHeading(), 0);
        // Debug.Log($"offsetFromTrue = {offsetFromTrue}");
        // _arSessionOrigin.transform.rotation = Quaternion.Euler(0, GetCompassTrueHeading(), 0);
    }
    private async void LateUpdate()
    {
        try
        {
            if (WebSocketsBehaviour.GetWsConnectionState() != "Open" || !isSceneReadyToChange ||
                currentLocation == null)
            {
                return;
            }

            isSceneReadyToChange = false;
            await TestPlacingObjects();

            isSceneReadyToChange = true;
        }
        catch (Exception e)
        {
            Debug.LogError(e);
        }
    }