|
|
|
|
|
|
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; |
|
|
|
} |
|
|
|