Ejemplo n.º 1
0
        public override GameObject Build()
        {
            var label = PUIElements.CreateUI(null, base.Name);

            text              = PTextComponent.TextChildHelper(label, PUITuning.Fonts.UILightStyle, ForcedExit.Options.RenderTime(System.DateTime.Now));
            tooltip           = EntityTemplateExtensions.AddOrGet <ToolTip>(label);
            tooltip.OnToolTip = OnToolTip;
            label.SetActive(true);
            var layout = label.AddComponent <RelativeLayoutGroup>();

            layout.Margin = new RectOffset(10, 10, 8, 8);
            ArrangeComponent(layout, text.gameObject, base.TextAlignment);
            if (!DynamicSize)
            {
                layout.LockLayout();
            }
            layout.flexibleWidth  = FlexSize.x;
            layout.flexibleHeight = FlexSize.y;
            DestroyLayoutIfPossible(label);
            InvokeRealize(label);
            return(label);
        }