private int addCardToPlayerDeck()
{
int cardsSelectedCount = 0;
foreach( Transform child in transform )
{
BattleCard bCard = child.GetComponent<BattleCard>();
bCard.cardController = cardOwner;
bCard.cardOwner = cardOwner;
child.GetComponent<UISprite>().color = mColor;
child.GetComponent<UIDragDropItem>().restriction = UIDragDropItem.Restriction.Horizontal;
if( !_selectedBattleCards.Contains(bCard) )
{
if(onCardSelected(bCard))
{
_selectedBattleCards.Add(bCard);
}
else
{
Debug.Log("current: "+bCard.transform.GetComponent<WCDragDropItemSelection>().Parent+" Previous: " + bCard.previousParent);
bCard.transform.GetComponent<WCDragDropItemSelection>().Parent = bCard.previousParent;
NGUITools.MarkParentAsChanged(gameObject);
bCard.previousParent.GetComponent<UIGrid>().Reposition();
}
}
++cardsSelectedCount;
}
return cardsSelectedCount;
}