public void moveCards(CardSpider card, int iPos, int iRow) { adMgr.PlaySound("move"); bool bAutoMove = true; if (card.transform.parent.gameObject == goMove) { bAutoMove = false; } if (bAutoMove == true && iPos == 0) { card.addItems(); } var items = card.getItems(); Transform upTrans; if (bAutoMove == true) { var cIdx = card.transform.GetSiblingIndex(); if (cIdx > 0 && card.getPos() == 0) { upTrans = card.transform.parent; var upCard = upTrans.GetChild(cIdx - 1).GetComponent <CardSpider>(); if (upCard.getBShowBg() == true) { upCard.showBg(false); } } } else { upTrans = getTransP(card.getPos(), card.getRow()); var iLen = upTrans.childCount; if (iLen > 0) { var upCard = upTrans.GetChild(iLen - 1).GetComponent <CardSpider>(); if (upCard.getBShowBg() == true) { upCard.showBg(false); } } } var trans = getTransP(iPos, iRow); card.setPos(iPos); card.setRow(iRow); card.transform.SetParent(trans); if (iPos == 0) { if (items.Count > 0) { foreach (Transform item in items) { var itemCard = item.GetComponent <CardSpider>(); itemCard.setPos(iPos); itemCard.setRow(iRow); item.SetParent(trans); } } _transWin = trans; setBMove(); showWin(); if (bAutoMove == false) { card.transform.localPosition = new Vector3(0, 0 - 30 * (trans.childCount - 1 - items.Count), 0); if (items.Count > 0) { var idx = 0; foreach (Transform item in items) { idx++; item.localPosition = new Vector3(0, 0 - 30 * (trans.childCount - 1 - items.Count + idx), 0); } } } else { card.transform.SetParent(goMove.transform); var iPosX = _px + IROWDIS * iRow; var iPosY = _py - 30 * (trans.childCount - items.Count); var pos = card.gameObject.GetComponent <RectTransform>().anchoredPosition; if (items.Count > 0) { foreach (Transform item in items) { item.SetParent(card.transform); } } card.showMove(iPosX - pos.x, iPosY - pos.y, iPosX); } } }