コード例 #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;
    }
コード例 #2
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);
        }
    }