示例#1
0
    public void OnRoll(int index)
    {
        isCompleteCreatePlayerCard = false;
        GameObject gObj          = GetInvisibleCard(index);
        Sequence   seq           = Util.PlayRotation(gObj, 0.2f);
        Vector3    playerCardPos = PlayerCardManager.GetInstance().GetNextPosPlayerCard();

        seq.Append(gObj.transform.DOMove(playerCardPos, 0.2f));
        seq.OnComplete(() =>
        {
            CardInVisibleScript cardInvisible = gObj.GetComponent <CardInVisibleScript>();
            if (cardInvisible != null)
            {
                cardInvisible.isHide = true;
            }
            gObj.SetActive(false);
            if (SoundManager.getInstance())
            {
                SoundManager.getInstance().PlaySound(SoundId.TOUCH);
            }
            if (PlayerCardManager.GetInstance() != null)
            {
                PlayerCardManager.GetInstance().OnCreatePlayerCard(index);
            }
            isCompleteCreatePlayerCard = true;
        });
    }
示例#2
0
    public void OnChooseCard()
    {
        GamePlayScript gamePlayScript = GamePlayScript.GetInstance();
        GameController gController    = GameController.GetInstance();

        if (gamePlayScript != null && !gamePlayScript.IsCompleteShowCard || !gamePlayScript.IsCompleteCreatePlayerCard)
        {
            if (gController != null)
            {
                gController.ShowHint(ConstantManager.HINT_WAITING_FOR_COMPLETING_CARD, this.GetComponent <RectTransform>());
            }
            return;
        }
        if (PlayerCardManager.GetInstance() != null && PlayerCardManager.GetInstance().IsFullSlot())
        {
            return;
        }
        gamePlayScript.OnRoll(cardIndex);
    }