Пример #1
0
        /// <summary>
        /// Adds the given button to the group.
        /// </summary>
        /// <param name="button">The button to add</param>
        public ButtonGroup AddButton(IButtonGroupElement button)
        {
            button.rectTransform.parent = ButtonLayoutGroup.transform;
            _buttons.Add(button);

            return(this);
        }
Пример #2
0
        /// <summary>
        /// Removes the given button from the group.
        /// </summary>
        /// <param name="button">The button to remove</param>
        public ButtonGroup RemoveButton(IButtonGroupElement button)
        {
            _buttons.Remove(button);
            GameObject.DestroyImmediate(button.gameObject);

            return(this);
        }