Fix error on text frame update if texture not found.

This commit is contained in:
2023-02-19 22:11:59 +08:00
parent e59769158a
commit 99b4c2dfc1

View File

@@ -81,6 +81,7 @@ namespace Cryville.Crtr.Components {
materials = new Material[m_frames.Count];
int i = 0;
foreach (var f in m_frames) {
if (SpriteInfo.IsNullOrEmpty(f.Value)) continue;
if (frameHeight == 0) frameHeight = f.Value.Rect.height;
else if (frameHeight != f.Value.Rect.height) throw new Exception("Inconsistent frame height for text component");
var tex = f.Value.Frame.Texture;