Пример #1
0
        public void Setup()
        {
            MARSSession.TestMode           = true;
            QuerySimulationModule.TestMode = true;
            m_TestSimulationUser           = ScriptableObject.CreateInstance <TestSimulationUser>();
            MARSSession.EnsureSessionInActiveScene();

            var moduleLoader = ModuleLoaderCore.instance;

            moduleLoader.GetModule <SimulationSceneModule>().RegisterSimulationUser(m_TestSimulationUser);
            moduleLoader.GetModule <SceneWatchdogModule>().ScenePoll();

            EditorWindow.GetWindow <SimulationView>(); // Tests will fail if a Simulation isn't open.

            m_EnvironmentManager            = moduleLoader.GetModule <MARSEnvironmentManager>();
            m_CachedEnvironmentModeSettings = m_EnvironmentManager.CustomModeSettings;
            m_CachedEnvironmentMode         = SimulationSettings.instance.EnvironmentMode;

            m_TestModeSettings.Clear();
            var testModeA = ScriptableObject.CreateInstance <TestSimulationEnvironmentModeSettings>();

            testModeA.TestDefaultSimulationMode = SimulationModeSelection.TemporalMode;
            testModeA.TestIsFramingEnabled      = false;
            testModeA.TestEnvironmentModeName   = "TestSimulationEnvironmentModeSettings_testModeA";
            m_TestModeSettings.Add(testModeA.EnvironmentModeName, testModeA);

            var testModeB = ScriptableObject.CreateInstance <TestSimulationEnvironmentModeSettings>();

            testModeB.TestDefaultSimulationMode = SimulationModeSelection.SingleFrameMode;
            testModeA.TestIsFramingEnabled      = true;
            testModeB.TestEnvironmentModeName   = "TestSimulationEnvironmentModeSettings_testModeB";
            m_TestModeSettings.Add(testModeB.EnvironmentModeName, testModeB);

            ResetScene();
        }
Пример #2
0
 void SetEnvironmentModeSettings(SimulationEnvironmentModeSettings settings)
 {
     m_EnvironmentManager.CustomModeSettings = settings;
     m_EnvironmentManager.UpdateSimulatedEnvironmentCandidates();
 }