Exemplo n.º 1
0
    void ChangeCard(List <int> ChangeCardIndex)
    {
        if (gamePhase == GamePhase.Select)
        {
            showZone.SetActive(true);
        }
        int num = ChangeCardIndex.Count;

        for (int i = 0; i < CardHandNum; i++)
        {
            for (int j = 0; j < num; j++)
            {
                if (gamePhase == GamePhase.Change)
                {
                    if (i == ChangeCardIndex[j])
                    {
                        player.PlayerCard[i].transform.DORotate(new Vector3(0f, 180f), 0.5f);
                        player.PlayerCard[i].transform.SetParent(cardPoolObj.transform);
                        player.PlayerCard[i].transform.DOMove(cardPoolObj.transform.position, 0.5f);
                        player.PlayerCard[i]       = null;
                        player.PlayerCardScript[i] = null;
                    }
                }
                if (gamePhase == GamePhase.Select)
                {
                    if (i == ChangeCardIndex[j])
                    {
                        showSpace.ShowCard.Add(player.PlayerCard[i]);
                        showSpace.ShowcardScripts.Add(player.PlayerCardScript[i]);
                    }
                }
            }
        }
        SE[0].PlayOneShot(SE[0].clip);
        switch (gamePhase)
        {
        case GamePhase.Change:
            if (num != 0)
            {
                StartSet();
            }
            else
            {
                gamePhase = GamePhase.Select; MainGame();
            };
            break;

        case GamePhase.Select:
            showSpace.ShowSetUp();
            for (int i = 0; i < 5; i++)
            {
                showSpace.ShowCard[i].transform.DOMove(showSpace.ShowFrame[i].transform.position, 0.5f);
            }
            gamePhase = GamePhase.RoleCheck; MainGame();
            break;
        }
    }
Exemplo n.º 2
0
    IEnumerator CardShow()
    {
        for (int i = 0; i < Const_int.MaxCard; i++)
        {
            if (EnemyCardScript[i].Select)
            {
                showSpace.ShowCard.Add(EnemyCard[i]);
                showSpace.ShowcardScripts.Add(EnemyCardScript[i]);
            }
        }
        for (int i = 0; ; i++)
        {
            if (showSpace.ShowCard.Count == 5)
            {
                break;
            }
            if (!EnemyCardScript[i].Select)
            {
                showSpace.ShowCard.Add(EnemyCard[i]);
                showSpace.ShowcardScripts.Add(EnemyCardScript[i]);
            }
        }
        EnemyShowSpace.SetActive(true);
        showSpace.ShowSetUp(gameObject);
        for (int i = 0; i < Const_int.ShowCard; i++)
        {
            showSpace.ShowCard[i].transform.DOMove(showSpace.ShowFrame[i].transform.position, 0.5f);
        }

        yield return(new WaitForSeconds(1f));

        for (int i = 0; i < 5; i++)
        {
            showSpace.ShowCard[i].transform.DORotate(new Vector3(0f, 0f), 0.5f, RotateMode.FastBeyond360);
        }
        SE[1].PlayOneShot(SE[1].clip);

        showEnd = true;
    }