Пример #1
0
    IEnumerator openCardEffect(UserPreviewCard card, DavinciController.ActionCallback callback)
    {
        yield return(new WaitForSeconds(1));

        card.openCard((bool isSuccess) => {
            callback();
        });
    }
Пример #2
0
 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();
     }
 }
Пример #3
0
 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;
         }
     }
 }
Пример #4
0
    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);
        });
    }
Пример #5
0
 // 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);
 }
Пример #6
0
    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);
        }
    }
Пример #7
0
    public void selectCard(int index)
    {
        UserPreviewCard c = preViewList[index].GetComponent <UserPreviewCard>();

        c.selectCard();
    }