예제 #1
0
    private void Processor2PlayCard()
    {
        if (mPlayCard == null)
        {
            mPlayCard = new PlayCard();
        }
        Player   playPlayer   = mPlayCard.player.GetComponent <Player>();;
        PlayerAI playPlayerAI = mPlayCard.player.GetComponent <PlayerAI>();

        //出牌
        if (mPlayCard.cardDataListToPlayer == null || mPlayCard.player == mPlayCard.cardDataListToPlayer)
        {
            if (playPlayer != null)
            {
                Debug.LogError("出牌:" + playPlayer.gameObject);
                playPlayer.PlayCardInit();
                playPlayer.mPlay.SetActive(true);
            }
            else if (playPlayerAI != null)
            {
                Debug.LogError("出牌:" + playPlayerAI.gameObject);
                playPlayerAI.mPass.SetActive(false);
                for (int i = 0; i < playPlayerAI.mCardList.Count; i++)
                {
                    playPlayerAI.mCardList[i].gameObject.SetActive(false);
                }
                playPlayerAI.SetTime(true);
                mTimerTask.Add(TimeManage.Instance.AddTimerTask(playPlayerAI.Play, Random.Range(1.4f, 3.4f)));
            }
        }
        else//打牌
        {
            if (playPlayer != null)
            {
                Debug.LogError("打牌:" + playPlayer.gameObject);
                playPlayer.PlayCardInit();
                if (CardArithmetic.AutoPlay(mCombatView.mPlayer.mCardData, mPlayCard) == null)
                {
                    playPlayer.mPass.SetActive(true);
                }
                else
                {
                    playPlayer.mAct.SetActive(true);
                }
            }
            else if (playPlayerAI != null)
            {
                Debug.LogError("打牌:" + playPlayerAI.gameObject);
                playPlayerAI.mPass.SetActive(false);
                for (int i = 0; i < playPlayerAI.mCardList.Count; i++)
                {
                    playPlayerAI.mCardList[i].gameObject.SetActive(false);
                }
                playPlayerAI.SetTime(true);
                mTimerTask.Add(TimeManage.Instance.AddTimerTask(playPlayerAI.HitPlay, Random.Range(1.4f, 3.4f)));
            }
        }
    }
예제 #2
0
 void OnEnable()
 {
     time = 30;
     mPlayerAI.SetTime(true, time);
     InvokeRepeating("ChangTime", 1, 1);
 }