public void AddAbilityButton(int _index, string _name) { ButtonAbility button = Instantiate(Resources.Load <ButtonAbility>("Prefabs/AbilityButton"), transform.Find("InfoHolder")); button.Initialize(SelectionManager.GetSelectedUnit(), _index, _name); AddAbilityButton(button); }
public void AddAbilityButton(ButtonAbility _button) { _button.GetComponent <RectTransform>().position += new Vector3(0, offset, 0); offset += offset_size; buttons.Add(_button); }