Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update function in XRManager.cs only needs to be run once per scene change. #72

Open
JacobChrist opened this issue Dec 15, 2022 · 0 comments

Comments

@JacobChrist
Copy link
Collaborator

Update function in XRManager.cs only needs to be run once per scene change. Probably tap off the network scene change event.

Currently this is running in Update(), doesn't seem to be bogging down the game but my computer is smoking fast compared to a Quest.

    private void Update()
    {
        // todo: 3 We should only need to do this once when we changes scenes.
        if (sceneCamera == null) sceneCamera = GameObject.Find(sceneCameraName);
        if (xrOrigin == null) xrOrigin = GameObject.Find(xrOriginName);

        switch (controlMode)
        {
            case ControlMode.MouseKeyboard:
                if (findCameras())
                {
                    sceneCamera?.SetActive(true);
                    xrOrigin?.SetActive(false);
                }
                break;
            case ControlMode.XReality:
                if (findCameras())
                {
                    sceneCamera?.SetActive(false);
                    xrOrigin?.SetActive(true);
                }
                break;
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant