public void AddButton(MapPiece piece) { if (pieceButtonPool == null) { Debug.Log("PieceButtonPanel has no pool!"); } else { PieceButton newButton = pieceButtonPool.GetObject(piece).GetComponent <PieceButton>(); newButton.transform.SetParent(transform, false); buttonCount += 1; buttons.Insert(0, newButton); UiController.instance.commandPanel.Show(); } }
public void RemoveButton(PieceButton button) { button.gameObject.SetActive(false); }
public void RemoveButton(PieceButton button) { buttons.Remove(button); pieceButtonPool.ReturnObject(button.gameObject); }