Exemple #1
0
    public void UpdateUI()
    {
        Toggle extTrackingToggle = FindUISelectableWithText <Toggle>("Extended");

        if (extTrackingToggle && mTrackableSettings)
        {
            extTrackingToggle.isOn = mTrackableSettings.IsExtendedTrackingEnabled();
        }

        Toggle flashToggle = FindUISelectableWithText <Toggle>("Flash");

        if (flashToggle && mCamSettings)
        {
            flashToggle.isOn = mCamSettings.IsFlashTorchEnabled();
        }

        Toggle autofocusToggle = FindUISelectableWithText <Toggle>("Autofocus");

        if (autofocusToggle && mCamSettings)
        {
            autofocusToggle.isOn = mCamSettings.IsAutofocusEnabled();
        }

        Toggle frontCamToggle = FindUISelectableWithText <Toggle>("Front");

        if (frontCamToggle && mCamSettings)
        {
            frontCamToggle.isOn = mCamSettings.IsFrontCameraActive();
        }

        Toggle rearCamToggle = FindUISelectableWithText <Toggle>("Rear");

        if (rearCamToggle && mCamSettings)
        {
            rearCamToggle.isOn = !mCamSettings.IsFrontCameraActive();
        }

        Toggle stonesAndChipsToggle = FindUISelectableWithText <Toggle>("Stones");
        Toggle tarmacToggle         = FindUISelectableWithText <Toggle>("Tarmac");

        if (mTrackableSettings)
        {
            if (stonesAndChipsToggle && stonesAndChipsToggle.gameObject.activeInHierarchy)
            {
                stonesAndChipsToggle.isOn = mTrackableSettings.GetActiveDatasetName().Contains("Stones");
            }

            if (tarmacToggle && mTrackableSettings && tarmacToggle.gameObject.activeInHierarchy)
            {
                tarmacToggle.isOn = mTrackableSettings.GetActiveDatasetName().Contains("Tarmac");
            }
        }
    }
    public void ToggleFrontCamera()
    {
        if (mCamSettings)
        {
            mCamSettings.SelectCamera(mCamSettings.IsFrontCameraActive() ? CameraDevice.CameraDirection.CAMERA_BACK : CameraDevice.CameraDirection.CAMERA_FRONT);

            // Toggle flash if it is on while switching to front camera
            Toggle flashToggle = FindUISelectableWithText <Toggle>("Flash");
            if (mCamSettings.IsFrontCameraActive() && flashToggle && flashToggle.isOn)
            {
                ToggleTorch();
            }
        }
    }
Exemple #3
0
    public void ToggleFrontCamera(bool enabled)
    {
        if (m_CameraSettings)
        {
            m_CameraSettings.SelectCamera(m_CameraSettings.IsFrontCameraActive() ?
                                          CameraDevice.CameraDirection.CAMERA_BACK :
                                          CameraDevice.CameraDirection.CAMERA_FRONT);

            // Toggle flash if it is on while switching to front camera
            if (m_CameraSettings.IsFrontCameraActive() && m_FlashToggle && m_FlashToggle.isOn)
            {
                ToggleTorch(false);
            }
        }
    }