public void OneTimeTearDown() { m_World.TearDown(); m_SubSceneTest.TearDown(); m_TempAssets.TearDown(); PlayerLoop.SetPlayerLoop(m_PrevPlayerLoop); }
public void OneTimeTearDown() { // Clean up all test assets m_Assets.TearDown(); m_DefaultWorld.TearDown(); m_SubSceneTest.TearDown(); EditorSettings.enterPlayModeOptions = m_EnterPlayModeOptions; EditorSettings.enterPlayModeOptionsEnabled = m_UseEnterPlayerModeOptions; SubSceneInspectorUtility.LiveLinkEnabledInEditMode = m_WasLiveLinkEnabled; }
public void OneTimeTearDown() { // Clean up all test assets m_Assets.TearDown(); m_DefaultWorld.TearDown(); EditorSceneManager.NewScene(NewSceneSetup.EmptyScene); SceneWithBuildConfigurationGUIDs.ClearBuildSettingsCache(); SubSceneInspectorUtility.LiveLinkEnabledInEditMode = m_WasLiveLinkEnabled; EditorSettings.enterPlayModeOptions = m_EnterPlayModeOptions; EditorSettings.enterPlayModeOptionsEnabled = m_UseEnterPlayerModeOptions; }
public static void SetUpOnce() { s_Assets.SetUp(); var assetGuids = new List <GUID>(); try { { string path = s_Assets.GetNextPath(".asset"); AssetDatabase.CreateAsset(s_TempTexture = new Texture2D(64, 64), path); s_TempTextureGuid = new GUID(AssetDatabase.AssetPathToGUID(path)); assetGuids.Add(s_TempTextureGuid); } { string path = s_Assets.GetNextPath(".mat"); AssetDatabase.CreateAsset(s_TempMaterial = new Material(Shader.Find("Standard")), path); s_TempMaterialGuid = new GUID(AssetDatabase.AssetPathToGUID(path)); assetGuids.Add(s_TempMaterialGuid); s_TempMaterial.mainTexture = s_TempTexture; } var tempScenePath = s_Assets.GetNextPath(".unity"); s_TempScene = SubSceneTestsHelper.CreateScene(tempScenePath); s_SubSceneWithSections = SubSceneTestsHelper.CreateSubSceneInSceneFromObjects("SubScene", false, s_TempScene, () => { var go1 = new GameObject(); go1.AddComponent <SceneSectionComponent>().SectionIndex = 0; var go2 = new GameObject(); go2.AddComponent <SceneSectionComponent>().SectionIndex = 2; go2.AddComponent <TestComponentAuthoring>().Material = s_TempMaterial; return(new List <GameObject> { go1, go2 }); }); { var path = s_Assets.GetNextPath("LiveLinkBuildConfig.buildconfiguration"); BuildConfiguration.CreateAsset(path, config => { config.SetComponent(new SceneList { SceneInfos = new List <SceneList.SceneInfo> { new SceneList.SceneInfo { Scene = GlobalObjectId.GetGlobalObjectIdSlow(AssetDatabase.LoadAssetAtPath <SceneAsset>(tempScenePath)) } } }); }); s_LiveLinkBuildConfigGuid = new GUID(AssetDatabase.AssetPathToGUID(path)); } } catch { s_Assets.TearDown(); throw; } // This call ensures that the asset worker is already running and no test times out because we're still // waiting for the asset worker. Effectively this doesn't change the runtime that much since we will have // to wait for the import to finish in most of the tests anyway. GetLiveLinkArtifactHash(s_TempMaterialGuid, ImportMode.Synchronous); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); s_TempAssetGuids = assetGuids.ToArray(); }
public void OneTimeTearDown() { m_World.TearDown(); m_SubSceneTest.TearDown(); m_TempAssets.TearDown(); }