public void ShowInfo(string Header, object Value) { GameObject _go = new GameObject(); _go.transform.SetParent(Infopanel.transform, false); UIInfoComponent _uic = _go.AddComponent <UIInfoComponent>(); _uic.Content = new NameValue(Header, Value.ToString()); _uic.Position = new Vector2(50, 50); _uic.Size = new Vector2(50, 200); }
private void AddUIComponent(NameValue nameValue, int PostitionX, int PositionY) { GameObject _go = new GameObject(); _go.name = nameValue.Name; _go.transform.SetParent(_FrameParent.transform, false); UIInfoComponent _uic = _go.AddComponent <UIInfoComponent>(); Content.Add(_uic); _uic.Position = new Vector2(UISettings.FrameComponentsInterval + (UISettings.FrameComponentsInterval + UISettings.ComponentWidth) * PostitionX + UISettings.ComponentWidth / 2, UISettings.FrameComponentsDistance + (UISettings.FrameComponentsDistance + UISettings.ComponentHeight) * PositionY + UISettings.ComponentHeight / 2); _uic.Size = new Vector2(UISettings.ComponentWidth, UISettings.ComponentHeight); _uic.Content = nameValue; }