Skip to content

Commit

Permalink
Fix RewiredGlyphManagerEditor not setting glyph map dirty
Browse files Browse the repository at this point in the history
  • Loading branch information
Orange-Panda committed Jun 24, 2023
1 parent a626df9 commit 3dfbf9f
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions Editor/RewiredGlyphManagerEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,16 @@ public override void OnInspectorGUI()
collection.NullGlyph,
collection.UnboundGlyph
};
foreach (GlyphCollection.GuidEntry hardwareEntry in collection.GuidMaps)
foreach (GlyphCollection.GuidEntry guidEntry in collection.GuidMaps)
{
EditorUtility.SetDirty(hardwareEntry.glyphMap);
foreach (Glyph glyph in hardwareEntry.glyphMap.Glyphs)
foreach (Glyph glyph in guidEntry.glyphMap.Glyphs)
{
glyphs.Add(glyph);
}
}

foreach (GlyphCollection.HardwareEntry hardwareEntry in collection.HardwareMaps)
{
EditorUtility.SetDirty(hardwareEntry.glyphMap);
foreach (Glyph glyph in hardwareEntry.glyphMap.Glyphs)
{
glyphs.Add(glyph);
Expand All @@ -51,7 +49,6 @@ public override void OnInspectorGUI()

foreach (GlyphCollection.TemplateEntry templateEntry in collection.TemplateMaps)
{
EditorUtility.SetDirty(templateEntry.glyphMap);
foreach (Glyph glyph in templateEntry.glyphMap.Glyphs)
{
glyphs.Add(glyph);
Expand Down Expand Up @@ -95,6 +92,22 @@ public override void OnInspectorGUI()
glyph.TextMeshSpriteSheetName = spriteSheetOutput.spriteAssetName;
}
}

// Set assets as dirty
foreach (GlyphCollection.GuidEntry guidEntry in collection.GuidMaps)
{
EditorUtility.SetDirty(guidEntry.glyphMap);
}

foreach (GlyphCollection.HardwareEntry hardwareEntry in collection.HardwareMaps)
{
EditorUtility.SetDirty(hardwareEntry.glyphMap);
}

foreach (GlyphCollection.TemplateEntry templateEntry in collection.TemplateMaps)
{
EditorUtility.SetDirty(templateEntry.glyphMap);
}
}
}

Expand Down

0 comments on commit 3dfbf9f

Please sign in to comment.