示例#1
0
        public override void Dispose()
        {
            if (this.IsDisposed)
            {
                return;
            }

            base.Dispose();

            GameHelp.DeleteAllItem(FaceObj);
            FaceObj = null;
        }
示例#2
0
        /// <summary>
        /// 继续游戏
        /// </summary>
        public void ContinueGamer()
        {
            players?.SetActive(false);
            this.changeTableBtn.gameObject.SetActive(true);
            this.readyBtn.gameObject.SetActive(true);
            this.desk.SetActive(false);
            this.trustship.SetActive(false);

            //碰刚按钮隐藏
            this.giveUpBtn.gameObject.SetActive(false);
            this.huBtn.gameObject.SetActive(false);
            this.gangBtn.gameObject.SetActive(false);
            this.pengBtn.gameObject.SetActive(false);

            this.head.GetComponentInParent <RectTransform>().gameObject.SetActive(true);
            players.SetActive(false);
            isTreasureFinish = true;
            treasure.SetActive(false);
            faceCardObj.SetActive(false);
            //剩余牌数
            restText.text = $"";
            GamerComponent gamerComponent = this.GetParent <UI>().GetComponent <GamerComponent>();

            gamerComponent.IsPlayed = false;
            Gamer[] gamers = gamerComponent.GetAll();

            foreach (var gamer in gamers)
            {
                if (gamer == null)
                {
                    continue;
                }
                gamer?.GetComponent <HandCardsComponent>()?.ClearAll();
                gamer?.GetComponent <GamerUIComponent>()?.zhuang.SetActive(false);
                gamer?.RemoveComponent <HandCardsComponent>();
            }

            foreach (var face in FacePanel)
            {
                GameHelp.DeleteAllItem(face.gameObject);
            }
        }
        /// <summary>
        /// 其他人的牌
        /// </summary>
        /// <param name="messageMahjongs"></param>
        public void AddOtherCards(bool isBanker)
        {
            GameHelp.DeleteAllItem(CardBottom);
            this.grabObj = this.CreateCardSprite($"{this.Direction}_back1", this.grabPostionX, this.grabPostionY);

            if (!isBanker)
            {
                //grabObj.SetActive(false);
                grabObj.transform.localScale = Vector3.zero;
            }

            for (int i = 0; i < 13; i++)
            {
                GameObject cardSprite = this.CreateCardSprite($"{Direction}_back1", i * this.postionX, i * this.postionY);
            }

            if (Direction.Equals("left"))
            {
                grabObj.transform.SetAsLastSibling();
            }
        }
        public void AddCards(List <MahjongInfo> mahjongs)
        {
            Logic_NJMJ.getInstance().SortMahjong(mahjongs);
            handCards.Clear();
            ItemCards.Clear();
            GameHelp.DeleteAllItem(CardBottom);

            for (int i = 0; i < mahjongs.Count; i++)
            {
                if (i > 12)
                {
                    AddCard(mahjongs[i], (mahjongs.Count - 1) * postionX + 30, 0, i);
                }
                else
                {
                    AddCard(mahjongs[i], postionX * i, postionY * i, i);
                }
            }

            handCards = mahjongs;
        }