Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: saved assets are invisible #88

Merged
merged 2 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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