Beispiel #1
0
 protected virtual void OnCardClick(CardUITemplate template)
 {
     if (OnClick != null)
     {
         OnClick(template);
     }
 }
        private void OnCardClicked(CardUITemplate template)
        {
            Debug.Log(template.Data.name);

            var card = template.Data as TowerUpgradeCard;

            if (References.Level.CardsManager.Inventory.Use(card))
            {
                Tower.AddUnit(card.Prefab);

                cardsUI.OnClick -= OnCardClicked;

                Close();
            }
        }
Beispiel #3
0
 protected virtual void InitCardTemplate(CardUITemplate template)
 {
     template.OnClick += () => OnCardClick(template);
 }
 private void OnCardClicked(CardUITemplate obj)
 {
     if (Level.Current.CardsManager.Inventory.Use(obj.Data))
     {
     }
 }