Ejemplo n.º 1
0
        public DDZCallScorePlugin Awake(GameObject panel)
        {
            this.panel = panel;

            _rf = this.panel.GetComponent <ReferenceCollector>();

            Clock = _rf.Get <GameObject>("Clock");

            Num = _rf.Get <GameObject>("Num").GetComponent <Text>();

            fen1Obj = _rf.Get <GameObject>("fen" + 1 + "Btn").GetComponent <Button>();

            fen2Obj = _rf.Get <GameObject>("fen" + 2 + "Btn").GetComponent <Button>();

            fen3Obj = _rf.Get <GameObject>("fen" + 3 + "Btn").GetComponent <Button>();

            this.Clock.SetActive(false);

            clockComponent = AddComponent <DDZClockComponent>().Awake(Num.gameObject);

            ButtonHelper.RegisterButtonEvent(_rf, "fen0Btn", () =>
            {
                SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click);

                callScore = 0;

                SendCallScore();
            });

            ButtonHelper.RegisterButtonEvent(_rf, "fen1Btn", () =>
            {
                SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click);

                callScore = 1;

                SendCallScore();
            });

            ButtonHelper.RegisterButtonEvent(_rf, "fen2Btn", () =>
            {
                SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click);

                callScore = 2;

                SendCallScore();
            });

            ButtonHelper.RegisterButtonEvent(_rf, "fen3Btn", () =>
            {
                SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click);

                callScore = 3;

                SendCallScore();
            });

            return(this);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 指定头像UI
        /// </summary>
        /// <param name="panel"></param>
        /// <param name="seatId"></param>
        public void SetPanel(GameObject panel, int seatId)
        {
            this.Panel = panel;

            _rf = this.Panel.GetComponent <ReferenceCollector>();

            this.seatId = seatId;

            this.PlayerHead = _rf.Get <GameObject>("PlayerHead").GetComponent <Image>();

            this.nongmin = this.PlayerHead.transform.Find("nongmin");

            this.dizhu = this.PlayerHead.transform.Find("dizhu");

            this.PlayerName = _rf.Get <GameObject>("PlayerName").GetComponent <Text>();

            this.PlayerGold = _rf.Get <GameObject>("PlayerGold").GetComponent <Text>();

            this.LandlordFlag = _rf.Get <GameObject>("LandlordFlag");

            this.CardNumObj = _rf.Get <GameObject>("CardNumObj");

            this.CardNumLab = _rf.Get <GameObject>("CardNumLab").GetComponent <Text>();

            this.PlayerGoldItem = _rf.Get <GameObject>("PlayerGoldItem");

            this.bg = _rf.Get <GameObject>("bg").GetComponent <Image>();

            this.box = _rf.Get <GameObject>("box");

            Clock = _rf.Get <GameObject>("Clock");

            Num = _rf.Get <GameObject>("Num").GetComponent <Text>();

            ChangeJieSeFx = _rf.Get <GameObject>("ChangeJieSeFx");

            Clock.SetActive(false);

            clockComponent = AddComponent <DDZClockComponent>().Awake(Num.gameObject);
        }
Ejemplo n.º 3
0
        public DDZInteractivePlugin Awake(GameObject panel)
        {
            this.panel = panel;

            _rf = this.panel.GetComponent <ReferenceCollector>();

            Clock = _rf.Get <GameObject>("Clock");

            Num = _rf.Get <GameObject>("Num").GetComponent <Text>();

            TipBtn = _rf.Get <GameObject>("TipBtn").GetComponent <Button>();

            Clock.SetActive(false);

            clockComponent = AddComponent <DDZClockComponent>().Awake(Num.gameObject);

            ButtonHelper.RegisterButtonEvent(_rf, "NotOutBtn", () =>
            {
                Game.PopupComponent.SetClickLock();

                SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click);

                DDZConfig.GameScene.RequestPlayCard(1, new DDZCard());
            });

            ButtonHelper.RegisterButtonEvent(_rf, "ReSetBtn", () =>
            {
                SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click);

                DDZConfig.GameScene.DDZHandCardPlugin.ReSelect();
            });

            ButtonHelper.RegisterButtonEvent(_rf, "TipBtn", () =>
            {
                Game.PopupComponent.SetClickLock();

                SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click);

                DDZConfig.GameScene.DDZHandCardPlugin.ReSelect();

                var tipCardDic = DDZConfig.GameScene.DDZAIComponent.GetTipCards();

                if (tipCardDic != null && tipCardDic.Count > 0)
                {
                    Log.Debug("获得的提示长度是:" + tipCardDic.Count);

                    if (tipCardIndex == -1)
                    {
                        tipCardIndex = 0;
                    }

                    if (tipCardIndex > tipCardDic.Count - 1)
                    {
                        tipCardIndex = 0;
                    }

                    List <int> tipCards = tipCardDic[tipCardIndex];

                    DDZConfig.GameScene.DDZHandCardPlugin.SelectTipCard(tipCards);

                    tipCardIndex++;
                }
                else
                {
                    Game.PopupComponent.ShowTips(DataCenterComponent.Instance.tipInfo.NoTipCardsTip);
                }
            });

            ButtonHelper.RegisterButtonEvent(_rf, "OutBtn", () =>
            {
                Game.PopupComponent.SetClickLock();

                SoundComponent.Instance.PlayClip(DataCenterComponent.Instance.soundInfo.click);

                DDZCard _data = new DDZCard();

                List <byte> outCardList = DDZConfig.GameScene.DDZHandCardPlugin.GetOutCardList();

                _data.Card = PbHelper.CopyFrom(outCardList);

                foreach (var item in outCardList)
                {
                    Log.Debug("牌值:" + PokerCardsHelper.GetPokerOfInt(item));

                    Log.Debug("中文牌:" + PokerCardsHelper.GetPokerString(item));
                }

                _data.CardsNum = outCardList.Count;

                Log.Debug("出牌的长度:" + _data.CardsNum);

                //增加判断:出牌是否为空
                if (_data.CardsNum <= 0)
                {
                    DDZConfig.GameScene.DDZMaskPlugin.Show(2);
                }
                else
                {
                    DDZConfig.GameScene.RequestPlayCard(0, _data);
                }
            });

            this.Reset();

            return(this);
        }