Example #1
0
        protected virtual async void InitializeXRLoader(object sender, EventArgs e)
        {
            OnPackageEnabled -= InitializeXRLoader;
            bool wasLoaderEnabled = await XRLoaderHelper.TryToEnableLoader(XRLoaderName);

            if (wasLoaderEnabled == false)
            {
                Debug.LogWarning($"{XRLoaderName} could not be loaded. Enable it manually here:\nEdit > Project Settings... > XR Plug-in Management.");
            }
        }
Example #2
0
        private void InitializeXRLoader(object sender, EventArgs e)
        {
            XRLoaderHelper.XRSDK sdk = (XRLoaderHelper.XRSDK)EditorPrefs.GetInt(nameof(XRLoaderHelper.XRSDK));

            switch (sdk)
            {
            case XRLoaderHelper.XRSDK.OpenVR:
                break;

            case XRLoaderHelper.XRSDK.Oculus:
                XRLoaderHelper.LoadOculus();
                break;

            case XRLoaderHelper.XRSDK.WindowsMR:
                XRLoaderHelper.LoadWindowsMR();
                break;
            }

            EditorPrefs.DeleteKey(nameof(XRLoaderHelper.XRSDK));
            OnPackageEnabled -= InitializeXRLoader;
        }