using CommonLang.Xml; using CommonUnity3D.UGUI; using System; using System.Xml; using UnityEngine; using CommonUI.Data; using TextAnchor = CommonUI.Data.TextAnchor; using FontStyle = CommonUI.Data.FontStyle; using CommonUI.Cell; namespace CommonUnity3D.UGUIEditor.UI { public class UELabel : UETextComponent { public UELabel() : this(UIEditor.GlobalUseBitmapText) { } public UELabel(bool use_bitmap) : base(use_bitmap) { this.Enable = false; this.EnableChildren = false; } public UELabel(string text, UILayout layout = null, CPJAtlas imageFont = null, bool use_bitmap = false) : base(use_bitmap) { this.Enable = false; this.EnableChildren = false; if (layout != null) { if (imageFont != null) { var vt = new ImageFontSprite("image_font"); vt.SetAtlas(imageFont); this.mTextSprite = vt; } else if (base.mUseBitmapFont) { mTextSprite = new BitmapTextSprite("bitmap_text"); } else { mTextSprite = new TextSprite("text"); } this.AddChild(mTextSprite); } else { if (imageFont != null) { var vt = mGameObject.AddComponent(); this.mTextGraphics = vt; vt.Atlas = imageFont; } else if (base.mUseBitmapFont) { this.mTextGraphics = mGameObject.AddComponent(); } else { this.mTextGraphics = mGameObject.AddComponent(); } } this.Text = text; } } }