コード例 #1
0
        public static void AgreeProp(Proposal prop)
        {
            BookManager      BM = BookManager.Instance;
            HandCardsManager HM = HandCardsManager.Instance;

            if (prop.InBook != null)
            {
                BM.RemoveBook(prop.InBook);
            }
            if (prop.InHand != null)
            {
                HM.Add_Book(prop.InHand);
            }
        }
コード例 #2
0
        /// <summary>
        /// 根据策略换牌
        /// </summary>
        /// <param name="hm"></param>
        public void RollCards(HandCardsManager hm)
        {
            Debug.Log("换牌1");
            int value = hm.drop.value;

            int[] ploy = new int[] { -1, -1, -1, -1, -1 };

            RefreshLib();

            //选择策略
            switch (value)
            {
            case 0:
                ploy = HandCardsManager.Ploy.PJ;
                break;

            case 1:
                ploy = HandCardsManager.Ploy.JH;
                break;

            case 2:
                ploy = HandCardsManager.Ploy.WH;
                break;
            }
            Debug.Log("换牌");
            //为卡牌对象获取卡牌信息
            for (int i = 0; i < hm.Cards.Count; i++)
            {
                GameObject h = hm.Cards[i];
                CardData   nCard;
                if (ploy[i] != -1)
                {
                    nCard = RollCard(ploy[i]);
                }
                else
                {
                    Debug.Log("策略加载失败");
                    continue;
                }
                if (nCard == null)
                {
                    Debug.Log("未找到合适的卡牌 :" + ploy[i] + "\n");
                    continue;
                }
                nCard.Get_IsInLib = false;
                RefreshCard(h, nCard);
            }
        }
コード例 #3
0
ファイル: CardMsg.cs プロジェクト: RyouTomokin/NewGBT_Game
 private void Update()
 {
     if (GM == null)
     {
         GM = GameManager.Instance;
     }
     if (HM == null)
     {
         HM = HandCardsManager.Instance;
     }
     if (BM == null)
     {
         BM = BookManager.Instance;
     }
     //if (card != null)
     //{
     //    obj.transform.parent.gameObject.GetComponent<Image>().sprite = card.icon;
     //}
 }
コード例 #4
0
 private void Start()
 {
     Instance = this;
     GM       = GameManager.Instance;
 }