Beispiel #1
0
 public bool Equals(E2DFontStyle other)
 {
     return(size == other.size &&
            align == other.align &&
            noedge == other.noedge &&
            color.Equals(other.color) &&
            width == other.width &&
            height == other.height &&
            langKey == other.langKey);
 }
Beispiel #2
0
    public E2DText(Text text, RectTransform root)
    {
        this.root  = root;
        this.node  = text.rectTransform;
        this.text  = text;
        this.style = E2DPackage.active.AddFontStyle(text);

        this.id    = this.style.id;      //text引用ID与fontStyle一致
        this.name  = text.name;          //当前节点名
        this.touch = this.node.GetComponent <Selectable>();
    }
Beispiel #3
0
    /// <summary>
    /// 分析Text组件,生成对应FontStyle缓存下来,最终导出为label类型配置
    /// </summary>
    /// <param name="text"></param>
    /// <returns></returns>
    public E2DFontStyle AddFontStyle(Text text)
    {
        var newFont = new E2DFontStyle(text);

        foreach (var oldFont in fontStyles)
        {
            if (newFont.Equals(oldFont))
            {
                return(oldFont);
            }
        }

        //新样式字体
        RegisterCom(newFont);
        this.fontStyles.Add(newFont);
        return(newFont);
    }