Skip to content

Commit

Permalink
Merge pull request #88 from anatawa12/improve-generated-asset
Browse files Browse the repository at this point in the history
fix: saved assets are invisible
  • Loading branch information
anatawa12 authored Mar 30, 2023
2 parents 8b14e17 + ff6dd90 commit e613ee8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-PRERELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog].
### Fixed
- Mesh is broken if more than 65536 vertices are exists `#87`
- Because we didn't check for vertices count and index format, vertex index can be overflow before.
- Generated assets are invisible for a while `#88`

### Security

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The format is based on [Keep a Changelog].
- This can make invalid mesh
- Mesh is broken if more than 65536 vertices are exists `#87`
- Because we didn't check for vertices count and index format, vertex index can be overflow before.
- Generated assets are invisible for a while `#88`

### Security

Expand Down
4 changes: 4 additions & 0 deletions Editor/OptimizerProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,20 @@ public static void ProcessObject(OptimizerSession session)
if (_processing) return;
try
{
AssetDatabase.StartAssetEditing();
_processing = true;
DoProcessObject(session);
}
finally
{
_processing = false;
AssetDatabase.StopAssetEditing();
foreach (var component in session.GetComponents<AvatarTagComponent>())
UnityEngine.Object.DestroyImmediate(component);
foreach (var activator in session.GetComponents<AvatarActivator>())
UnityEngine.Object.DestroyImmediate(activator);

AssetDatabase.SaveAssets();
}
}

Expand Down

0 comments on commit e613ee8

Please sign in to comment.