Example #1
0
    public void ApplyMaterialCardSlotData(MaterialCardSlotData data)
    {
        var activeSelection = data.SelectedIndex > 0;

        SelectionRoot.SetActive(activeSelection);
        if (activeSelection)
        {
            SelectionIndex.text = data.SelectedIndex.ToString();
        }
    }
Example #2
0
    private void OnClickMaterialCardSlot(MaterialCardSlotData data, MaterialCardSlot slot)
    {
        var selected = selectedCardDataList.FirstOrDefault(d => d.CardData.UserCard.UserCardId == data.CardData.UserCard.UserCardId);

        if (selected == null)
        {
            if (initData.LimitCount <= selectedCardDataList.Count)
            {
                return;
            }

            selectedCardDataList.Add(data);
        }
        else
        {
            selectedCardDataList.RemoveAll(r => r.CardData.UserCard.UserCardId == data.CardData.UserCard.UserCardId);
            data.SelectedIndex = 0;
        }
        UpdateCardSelection();
    }