예제 #1
0
        protected void AddFont(string family, List <string> assets, List <int> weights)
        {
            if (assets.Count != weights.Count)
            {
                Debug.LogError($"The size of {family}‘s assets should be equal to the weights'.");
                return;
            }

            var textFont = new TextFont {
                family = family
            };
            var fonts = new Font[assets.Count];

            for (var j = 0; j < assets.Count; j++)
            {
                var font = new Font {
                    asset = assets[index : j], weight = weights[index : j]
                };
                fonts[j] = font;
            }

            textFont.fonts = fonts;
            _configurations.AddFont(family, textFont);
        }