IEnumerator openCardEffect(UserPreviewCard card, DavinciController.ActionCallback callback) { yield return(new WaitForSeconds(1)); card.openCard((bool isSuccess) => { callback(); }); }
public void reload() { for (int i = 0; i < userData.cards.Count; i++) { UserPreviewCard preV = preViewList[i].GetComponent <UserPreviewCard>(); preV.setData(userData.cards[i], isMy()); preV.reload(); } }
public void openCard(int index, DavinciController.ActionCallback callback) { foreach (GameObject obj in preViewList) { UserPreviewCard card = obj.GetComponent <UserPreviewCard>(); if (card != null && card.getIndex() == index) { StartCoroutine(openCardEffect(card, callback)); break; } } }
IEnumerator attackEffect(int selectIndex, int attackIndex, DavinciController.ResultCallback callback) { yield return(new WaitForSeconds(2)); UserPreviewCard c = preViewList[selectIndex].GetComponent <UserPreviewCard>(); c.attackCard(attackIndex, (bool isSuccess) => { spriteBg.color = Color.white; attackInfo.hide(); callback(isSuccess); }); }
// Use this for initialization void Start() { attackInfo.hide(); preViewList.Add(previewObj); previewObj.GetComponent <UserPreviewCard>().init(); for (int i = 0; i < 15; i++) { GameObject item = NGUITools.AddChild(grid.gameObject, previewObj); UserPreviewCard itemSource = item.GetComponent <UserPreviewCard>(); itemSource.init(); preViewList.Add(item); } setTurn(false); }
public void setData(UserGameData data) { userData = data; nickName.text = userData.nickName; for (int i = 0; i < userData.cards.Count; i++) { UserPreviewCard preV = preViewList[i].GetComponent <UserPreviewCard>(); preV.setData(userData.cards[i], isMy()); } if (data.isLose == false) { spriteLoseBg.gameObject.SetActive(false); labelLose.gameObject.SetActive(false); } }
public void selectCard(int index) { UserPreviewCard c = preViewList[index].GetComponent <UserPreviewCard>(); c.selectCard(); }