Ejemplo n.º 1
0
        public void Setting(MahjongMachine mjMachine, PengChiGangTingHuType type = PengChiGangTingHuType.PENG)
        {
            this.mjMachine    = mjMachine;
            this.type         = type;
            mjGame            = mjMachine.mjGame;
            mjAssets          = mjMachine.mjAssets;
            mjAssetsMgr       = mjMachine.mjAssetsMgr;
            uiCanvasTransform = mjMachine.uiCanvasTransform;

            uiBtn         = mjAssetsMgr.pengChiGangTingHuBtns[(int)type].transform;
            orgUIBtnScale = uiBtn.localScale;

            if (type != PengChiGangTingHuType.GUO && type != PengChiGangTingHuType.CANCEL)
            {
                fxAddPS          = uiBtn.Find("FxAdd").GetComponent <ParticleSystem>();
                fxOutGuangQuanPS = uiBtn.Find("FxOutGuangQuan").GetComponent <ParticleSystem>();
                uiInGuangQuanPS  = uiBtn.Find("UIInGuangQuan").GetComponent <ParticleSystem>();
            }


            EventTriggerListener.Get(uiBtn.gameObject).onDown  = OnButtonDown;
            EventTriggerListener.Get(uiBtn.gameObject).onClick = OnButtonClick;

            State4();
        }
Ejemplo n.º 2
0
        int GetPrefabIdxForPengChiGangTingHuType(PengChiGangTingHuType type)
        {
            int prefabIdx = (int)PrefabIdx.UI_PENG_BTN;

            switch (type)
            {
            case PengChiGangTingHuType.PENG: prefabIdx = (int)PrefabIdx.UI_PENG_BTN; break;

            case PengChiGangTingHuType.CHI: prefabIdx = (int)PrefabIdx.UI_CHI_BTN; break;

            case PengChiGangTingHuType.GANG: prefabIdx = (int)PrefabIdx.UI_GANG_BTN; break;

            case PengChiGangTingHuType.TING: prefabIdx = (int)PrefabIdx.UI_TING_BTN; break;

            case PengChiGangTingHuType.HU: prefabIdx = (int)PrefabIdx.UI_HU_BTN; break;

            case PengChiGangTingHuType.GUO: prefabIdx = (int)PrefabIdx.UI_GUO_BTN; break;

            case PengChiGangTingHuType.CANCEL: prefabIdx = (int)PrefabIdx.UI_CANCEL_BTN; break;
            }

            return(prefabIdx);
        }
Ejemplo n.º 3
0
        bool CheckClicked()
        {
            for (int i = 0; i < btnTypes.Length; i++)
            {
                switch (btnTypes[i])
                {
                case PengChiGangTingHuType.HU:
                    if (uiHuBtn.IsClicked == true)
                    {
                        clickedBtnType = PengChiGangTingHuType.HU;
                        return(true);
                    }
                    break;

                case PengChiGangTingHuType.PENG:
                    if (uiPengBtn.IsClicked == true)
                    {
                        clickedBtnType = PengChiGangTingHuType.PENG;
                        return(true);
                    }
                    break;

                case PengChiGangTingHuType.CHI:
                    if (uiChiBtn.IsClicked == true)
                    {
                        clickedBtnType = PengChiGangTingHuType.CHI;
                        return(true);
                    }
                    break;

                case PengChiGangTingHuType.GANG:
                    if (uiGangBtn.IsClicked == true)
                    {
                        clickedBtnType = PengChiGangTingHuType.GANG;
                        return(true);
                    }
                    break;

                case PengChiGangTingHuType.TING:
                    if (uiTingBtn.IsClicked == true)
                    {
                        clickedBtnType = PengChiGangTingHuType.TING;
                        return(true);
                    }
                    break;

                case PengChiGangTingHuType.GUO:
                    if (uiGuoBtn.IsClicked == true)
                    {
                        clickedBtnType = PengChiGangTingHuType.GUO;
                        return(true);
                    }
                    break;

                case PengChiGangTingHuType.CANCEL:
                    if (uiCancelBtn.IsClicked == true)
                    {
                        clickedBtnType = PengChiGangTingHuType.CANCEL;
                        return(true);
                    }
                    break;
                }
            }

            return(false);
        }