示例#1
0
    private void StartSelectionForContainerObj(GameObject containerObj, BehaviorSystem.SavedCardPack existingPack = null)
    {
        CardContainer container = containerObj.GetComponentInChildren <CardContainer>();

        if (container.GetCard().GetModel().IsBuiltin())
        {
            containerObj.SetActive(false);
        }
        else
        {
            bool startSelected = existingPack != null && existingPack.uris.Contains(container.GetCard().GetModel().GetUri());
            container.StartSelectionMode(
                (selected) =>
            {
                if (selection == null)
                {
                    return;
                }
                if (selected)
                {
                    selection.selectedCards.Add(container.GetCard().GetModel().GetUri());
                }
                else
                {
                    selection.selectedCards.Remove(container.GetCard().GetModel().GetUri());
                }
            }, startSelected);
        }
    }