public static Label Label(string name, string str, bool multiLine, float maxWidth, float fontSize, SpriteText.Font_Effect fontEffect, SpriteText.Anchor_Pos anchor, SpriteText.Alignment_Type alignment, Color color) { Label result; using (new ScopeProfile("UICreateControl - Label")) { GameObject gameObject = new GameObject(name); Label label = gameObject.AddComponent <Label>(); label.Setup(maxWidth, fontSize); label.gameObject.layer = GUICamera.UILayer; label.SetAnchor(SpriteRoot.ANCHOR_METHOD.UPPER_LEFT); label.includeTextInAutoCollider = false; label.DefaultTextAnchor = anchor; label.DefaultTextAlignment = alignment; label.fontSize = fontSize; label.multiLine = multiLine; label.maxWidth = maxWidth; label.color = color; label.CreateSpriteText(); if (multiLine) { label.spriteText.useWhiteSpace = false; label.spriteTextShadow.useWhiteSpace = false; } label.SetCharacterSize(fontSize); label.SetFontEffect(fontEffect); label.Text = str; label.BackGroundHide(true); label.Start(); BoxCollider boxCollider = (BoxCollider)label.GetComponent(typeof(BoxCollider)); if (null != boxCollider) { UnityEngine.Object.Destroy(boxCollider); } result = label; } return(result); }