private void criaFatiaELegenda(Color c, UIRadialChartAge chart, UIPanel legendPanel, string localeID, float offsetY) { chart.AddSlice(c, c); UIPanel legendItemContainer = null; TLMUtils.createUIElement <UIPanel>(ref legendItemContainer, legendPanel.transform); legendItemContainer.width = legendPanel.width; legendItemContainer.relativePosition = new Vector3(0f, offsetY); legendItemContainer.name = "LegendItem"; legendItemContainer.autoLayout = false; legendItemContainer.useCenter = true; legendItemContainer.wrapLayout = false; legendItemContainer.height = 20; UILabel legendColor = null; TLMUtils.createUIElement <UILabel>(ref legendColor, legendItemContainer.transform); legendColor.backgroundSprite = "EmptySprite"; legendColor.width = 10; legendColor.height = 10; legendColor.relativePosition = new Vector3(0, 0); legendColor.color = c; UILabel legendName = null; TLMUtils.createUIElement <UILabel>(ref legendName, legendItemContainer.transform); legendName.textAlignment = UIHorizontalAlignment.Right; legendName.width = legendItemContainer.width - 10; legendName.localeID = localeID; legendName.textScale = 0.6f; legendName.relativePosition = new Vector3(15f, 2f); legendName.verticalAlignment = UIVerticalAlignment.Middle; }