Пример #1
0
    //
    void Awake()
    {
        _cardArray = new CardButton[BoardGame.BoardGameMode.MAX_NUM_CARD];

        int numCard = _cardArray.Length;

        for (int i = 0; i < numCard; ++i)
        {
            GameObject o = Instantiate(PrefCardButton);
            o.transform.SetParent(transform, false);

            CardButton card = o.GetComponent <CardButton>();
            card.SetIndex(i);

            _cardArray[i] = card;
        }

        var mode = Manager.Instance.Object.BoardGameMode;

        mode.ShuffleEvent.Attach(onShuffle);
        mode.RemoveAllDefenseEvent.Attach(onRemoveAllDefense);
    }