void UpdateSettings(ChiselModel model, GameObjectState state, bool meshIsModified) { #if UNITY_EDITOR Profiler.BeginSample("CheckIfFullMeshNeedsToBeHidden"); // If we need to render partial meshes (where some brushes are hidden) then we should show the full mesh ChiselGeneratedComponentManager.CheckIfFullMeshNeedsToBeHidden(model, this); Profiler.EndSample(); if (meshIsModified) { // Setting the sharedMesh to ensure the meshFilter knows it needs to be updated Profiler.BeginSample("OverrideMesh"); meshFilter.sharedMesh = meshFilter.sharedMesh; Profiler.EndSample(); Profiler.BeginSample("SetDirty"); UnityEditor.EditorUtility.SetDirty(meshFilter); UnityEditor.EditorUtility.SetDirty(model); Profiler.EndSample(); Profiler.BeginSample("SetHasLightmapUVs"); ChiselGeneratedComponentManager.SetHasLightmapUVs(sharedMesh, false); Profiler.EndSample(); Profiler.BeginSample("ClearLightmapData"); ChiselGeneratedComponentManager.ClearLightmapData(state, this); Profiler.EndSample(); } #endif }
void UpdateSettings(ChiselModel model, GameObjectState state, bool meshIsModified) { #if UNITY_EDITOR // If we need to render partial meshes (where some brushes are hidden) then we should show the full mesh ChiselGeneratedComponentManager.CheckIfFullMeshNeedsToBeHidden(model, this); if (meshIsModified) { ChiselGeneratedComponentManager.ClearLightmapData(state, this); } #endif }