public Vector3 SetTemplateItem(string templateItemName) { this.templateItem = this.uxFactory.GetElement <UXElement>(templateItemName); this.templateItem.Visible = true; this.itemSize = UXUtils.CalculateElementSize(this.templateItem); this.templateItem.Visible = false; return(this.itemSize); }
public void AutoCenter() { if (base.Count == 0) { return; } if (!this.autoCenterPositionSet) { this.autoCenterPositionSet = true; this.autoCenterPosition = base.LocalPosition; } base.Width = 0f; Vector3 localPosition = this.autoCenterPosition; localPosition.x -= 0.5f * (UXUtils.CalculateElementSize(this).x + this.Padding.x); base.LocalPosition = localPosition; }