Ejemplo n.º 1
0
        void Cleanup()
        {
            if (m_PrefabContentsRoot != null && m_PrefabContentsRoot.scene != m_PreviewScene)
            {
                UnityEngine.Object.DestroyImmediate(m_PrefabContentsRoot);
            }

            if (m_PreviewScene.IsValid())
            {
                PrefabStageUtility.DestroyPreviewScene(m_PreviewScene); // Automatically deletes all GameObjects in scene
            }
            m_PrefabContentsRoot  = null;
            m_HideFlagUtility     = null;
            m_PrefabAssetPath     = null;
            m_InitialSceneDirtyID = 0;
            m_LastSceneDirtyID    = 0;
            m_IgnoreNextAssetImportedEventForCurrentPrefab = false;
            m_PrefabWasChangedOnDisk = false;
        }
Ejemplo n.º 2
0
        void Cleanup()
        {
            if (m_PreviewScene.IsValid())
            {
                List <GameObject> roots = new List <GameObject>();
                m_PreviewScene.GetRootGameObjects(roots);
                foreach (var go in roots)
                {
                    UnityEngine.Object.DestroyImmediate(go);
                }
                PrefabStageUtility.DestroyPreviewScene(m_PreviewScene);
            }

            m_PrefabContentsRoot  = null;
            m_HideFlagUtility     = null;
            m_PrefabAssetPath     = null;
            m_InitialSceneDirtyID = 0;
            m_LastSceneDirtyID    = 0;
            m_IgnoreNextAssetImportedEventForCurrentPrefab = false;
            m_PrefabWasChangedOnDisk = false;
        }