Beispiel #1
0
        public void SetupXRManagerTest()
        {
            m_Manager = ScriptableObject.CreateInstance <XRManagerSettings>();
            m_Manager.automaticLoading = false;

            m_Loaders = new List <XRLoader>();

            for (int i = 0; i < m_LoaderCount; i++)
            {
                DummyLoader dl = ScriptableObject.CreateInstance(typeof(DummyLoader)) as DummyLoader;
                dl.id         = i;
                dl.shouldFail = (i != m_LoaderIndexToWin);
                m_Loaders.Add(dl);
                m_Manager.loaders.Add(dl);
            }
        }
Beispiel #2
0
        protected void SetupBase()
        {
            m_Manager = ScriptableObject.CreateInstance <XRManagerSettings>();
            manager.automaticLoading = false;

            m_Loaders = new List <XRLoader>();

            for (int i = 0; i < loaderCount; i++)
            {
                DummyLoader dl = ScriptableObject.CreateInstance(typeof(DummyLoader)) as DummyLoader;
                dl.id         = i;
                dl.shouldFail = true;
                loaders.Add(dl);
                m_Manager.currentLoaders.Add(dl);
                m_Manager.registeredLoaders.Add(dl);
            }
        }
Beispiel #3
0
        public void SetupPlayerSettings()
        {
            GraphicsDeviceType[] deviceTypes = PlayerSettings.GetGraphicsAPIs(BuildTarget.StandaloneOSX);
            var oldGfxType = m_PlayerSettingsDeviceType;

            // If the type we want to check isn't the supported graphics type, then substitute it out
            // so we can still pass the tests. Semantics are the same regardless of actual devices.
            if (SystemInfo.graphicsDeviceType != m_PlayerSettingsDeviceType)
            {
                m_PlayerSettingsDeviceType = SystemInfo.graphicsDeviceType;

                for (int i = 0; i < m_LoadersSupporteDeviceTypes.Length; i++)
                {
                    if (oldGfxType == m_LoadersSupporteDeviceTypes[i])
                    {
                        m_LoadersSupporteDeviceTypes[i] = m_PlayerSettingsDeviceType;
                    }
                }
            }

#if UNITY_EDITOR_WIN
            PlayerSettings.SetGraphicsAPIs(BuildTarget.StandaloneWindows64, new[] { m_PlayerSettingsDeviceType });
#elif UNITY_EDITOR_OSX
            PlayerSettings.SetGraphicsAPIs(BuildTarget.StandaloneOSX, new[] { m_PlayerSettingsDeviceType });
#endif

            m_Manager = ScriptableObject.CreateInstance <XRManagerSettings>();
            m_Manager.automaticLoading = false;

            m_Loaders = new List <XRLoader>();

            for (int i = 0; i < m_LoadersSupporteDeviceTypes.Length; i++)
            {
                DummyLoader dl = ScriptableObject.CreateInstance(typeof(DummyLoader)) as DummyLoader;
                dl.id = i;
                dl.supportedDeviceType = m_LoadersSupporteDeviceTypes[i];
                dl.shouldFail          = (i != m_LoaderIndexToWin);
                m_Loaders.Add(dl);
                m_Manager.loaders.Add(dl);
            }
        }
Beispiel #4
0
 protected bool Equals(DummyLoader other)
 {
     return(base.Equals(other) && shouldFail == other.shouldFail && id == other.id);
 }