Beispiel #1
0
 public string Add(CuiLabel label, string parent = "Hud", string name = null)
 {
     if (string.IsNullOrEmpty(name))
     {
         name = CuiHelper.GetGuid();
     }
     Add(new CuiElement
     {
         Name       = name,
         Parent     = parent,
         Components =
         {
             label.Text,
             label.RectTransform
         }
     });
     return(name);
 }
        public string Add(CuiLabel label, string parent = "Hud", string name = null)
        {
            if (String.IsNullOrEmpty(name))
            {
                name = CuiHelper.GetGuid();
            }
            CuiElement cuiElement = new CuiElement()
            {
                Name    = name,
                Parent  = parent,
                FadeOut = label.FadeOut
            };

            cuiElement.Components.Add(label.Text);
            cuiElement.Components.Add(label.RectTransform);
            base.Add(cuiElement);
            return(name);
        }