internal void PlaceButton() { IElementUI newElement = _view.workers[_view.workers.Count - 1]; RectTransform rectTransformButton = newElement.rectTransform; RectTransform rectTransformParent = _view.parentOfInstance; float widthButton = rectTransformButton.rect.width; rectTransformButton.position = rectTransformParent.position + new Vector3(rectTransformParent.rect.width, 0, 0); rectTransformParent.sizeDelta += new Vector2(widthButton, 0.0f); }
public void RegisterNewElement(IElementUI newElement) { if (workers.Contains(newElement)) { return; } workers.Add(newElement); if (_controller == null) { _controller = new CompetenceButtonManagerController(this); } _controller.PlaceButton(); }