Example #1
0
        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();
            }
        }
Example #2
0
 public void RemoveButton(PieceButton button)
 {
     button.gameObject.SetActive(false);
 }
Example #3
0
        public void RemoveButton(PieceButton button)
        {
            buttons.Remove(button);

            pieceButtonPool.ReturnObject(button.gameObject);
        }