void Convert(Scene scene, Hash128 sceneGUID, GameObjectConversionUtility.ConversionFlags flags, BuildConfiguration config) { using (m_ConvertMarker.Auto()) { // Try incremental conversion if (!_RequestCleanConversion) { // Debug.Log("Incremental convert"); try { GameObjectConversionUtility.ConvertIncremental(_GameObjectWorld, _ChangedGameObjects, flags); _ChangedGameObjects.Clear(); } #pragma warning disable 168 catch (Exception e) { _RequestCleanConversion = true; // Debug.Log("Incremental conversion failed. Performing full conversion instead\n" + e.ToString()); } #pragma warning restore 168 } // If anything failed, fall back to clean conversion if (_RequestCleanConversion) { // Debug.Log("Clean convert"); _ConvertedWorld.EntityManager.DestroyEntity(_ConvertedWorld.EntityManager.UniversalQuery); var conversionSettings = new GameObjectConversionSettings(_ConvertedWorld, flags); conversionSettings.BuildConfiguration = config; conversionSettings.SceneGUID = sceneGUID; conversionSettings.DebugConversionName = _SceneName; conversionSettings.BlobAssetStore = m_BlobAssetStore; conversionSettings.FilterFlags = WorldSystemFilterFlags.HybridGameObjectConversion; if (_GameObjectWorld != null && _GameObjectWorld.IsCreated) { _GameObjectWorld.Dispose(); _GameObjectWorld = null; } _GameObjectWorld = GameObjectConversionUtility.ConvertIncrementalInitialize(scene, conversionSettings); m_AssetDependencies.Clear(); AddAssetDependencies(_GameObjectWorld.GetExistingSystem <GameObjectConversionMappingSystem>().Dependencies, ref m_AssetDependencies); } _ChangedGameObjects.Clear(); _RequestCleanConversion = false; } }
/// <summary> /// Clears the container. /// </summary> /// <remarks>Containers capacity remains unchanged.</remarks> public void Clear() { CheckWrite(); m_HashMapData.Clear(); }
void AddLiveLinkChangeSet(Hash128 sceneGUID, List <LiveLinkChangeSet> changeSets, LiveLinkMode mode) { var liveLink = GetLiveLink(sceneGUID); var editScene = _GUIDToEditScene[sceneGUID]; // The current behaviour is that we do incremental conversion until we release the hot control // This is to avoid any unexpected stalls // Optimally the undo system would tell us if only properties have changed, but currently we don't have such an event stream. var sceneDirtyID = GetSceneDirtyID(editScene); var updateLiveLink = true; if (IsHotControlActive()) { if (liveLink != null) { sceneDirtyID = liveLink.LiveLinkDirtyID; } else { updateLiveLink = false; EditorUpdateUtility.EditModeQueuePlayerLoopUpdate(); } } else { if (liveLink != null && liveLink.LiveLinkDirtyID != sceneDirtyID) { liveLink.RequestCleanConversion(); } } if (updateLiveLink) { //@TODO: need one place that LiveLinkDiffGenerators are managed. UpdateLiveLink does a Dispose() // but this must be paired with membership in _SceneGUIDToLiveLink. not good to have multiple places // doing ownership management. // // also: when implementing an improvement to this, be sure to deal with exceptions, which can occur // during conversion. if (liveLink != null) { _SceneGUIDToLiveLink.Remove(sceneGUID); } try { changeSets.Add(LiveLinkDiffGenerator.UpdateLiveLink(editScene, sceneGUID, ref liveLink, sceneDirtyID, mode, _BuildConfiguration, out var assetDependencies)); if (assetDependencies.IsCreated) { m_AssetDependencies.Clear(); foreach (var asset in assetDependencies) { m_AssetDependencies.Add(asset, 1); } assetDependencies.Dispose(); } } finally { if (liveLink != null) { _SceneGUIDToLiveLink.Add(sceneGUID, liveLink); } } } }
internal void Clear() { uniqueParameters.Clear(); uniqueParameterCount = 0; }