void OnEnable()
    {
        arCamera.GetComponent <UnityEngine.XR.ARFoundation.ARCameraManager>().focusMode = CameraFocusMode.Fixed;

        maxDistance = accordion.transform.Find("Components").childCount;

        rotationWheel.Init(maxDistance);

        ReadJson();

        accordion.SetContent(this.content);

        PostFX postFx = fxCamera.GetComponent <PostFX>();

        if (Application.isEditor)
        {
            accordion.gameObject.SetActive(true);

            postFx.UpdateAperture(0.1f);
            postFx.UpdateFocalLength(150.0f);
        }
        else
        {
            accordion.gameObject.SetActive(false);

            trackedImageManager.trackedImagesChanged += OnTrackedImagesChanged;

            postFx.UpdateAperture(20.0f);
            postFx.UpdateFocalLength(150.0f);
        }

        toggleButton.SetActive(false);

        debugView.gameObject.SetActive(false);
        debugView.UpdateSmoothTime(smoothTime);
        debugView.UpdateAxes(axes.activeInHierarchy);
        debugView.UpdateXRUpdateType((int)arCamera.GetComponent <TrackedPoseDriver>().updateType);

        fxCamera.GetComponent <PostProcessLayer>().enabled = false;
    }
Beispiel #2
0
    void Init()
    {
        arCamera.GetComponent <UnityEngine.XR.ARFoundation.ARCameraManager>().focusMode = CameraFocusMode.Fixed;

        ReadJson();

        rotationWheel.Init(content.accordion.layers, startLayer);

        accordion.SetContent(this.content);
        accordion.SetStartOffset(startLayer);
        accordion.SetStep(startLayer);

        quiz.SetContent(this.content.accordion);

        PostFX postFx = fxCamera.GetComponent <PostFX>();

        if (Application.isEditor)
        {
            postFx.UpdateAperture(4f);
            postFx.UpdateFocalLength(80.0f);
        }
        else
        {
            postFx.UpdateAperture(1.4f);
            postFx.UpdateFocalLength(65.0f);

            trackedImageManager.trackedImagesChanged += OnTrackedImagesChanged;
        }

        debugView.gameObject.SetActive(false);
        debugView.UpdateSmoothTime(smoothTime);
        debugView.UpdateAxes(axes.activeInHierarchy);
        debugView.UpdateAccordionExponent(accordion.Exponent);
        debugView.UpdateDOF(enabled);
        debugView.UpdateRotationWheelSpeed(0.5f);

        fxCamera.GetComponent <PostProcessLayer>().enabled = true;
    }