浏览代码

use first fontNames as key

/main
fzhangtj 6 年前
当前提交
187b0d96
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 10
      Runtime/ui/painting/txt/font_manager.cs

10
Runtime/ui/painting/txt/font_manager.cs


font.hideFlags = HideFlags.DontSave & ~HideFlags.DontSaveInBuild;
FontInfo current;
this._fonts.TryGetValue(font.name, out current);
D.assert(current == null || current.font == font, $"font with name {font.name} already exists");
var name = font.fontNames[0];
this._fonts.TryGetValue(name, out current);
D.assert(current == null || current.font == font, $"font with name {name} already exists, object name={font.name}");
this._fonts[font.name] = fontInfo;
this._fonts[name] = fontInfo;
D.assert(fontInfo.font.fontNames[0] == name);
return fontInfo;
}

osFont.material.mainTexture.hideFlags = HideFlags.DontSave;
var newFont = new FontInfo(osFont);
this._fonts[osFont.name] = newFont;
this._fonts[osFont.fontNames[0]] = newFont;
return newFont;
}

正在加载...
取消
保存