示例#1
0
        public void Load()
        {
            for (int i = 0; i < 4; i++)
            {
                uiScoreDec[i] = Object.Instantiate(prefabUIScoreDec, uiCanvasTransform);
                uiScoreDec[i].SetActive(false);
                uiScoreDec[i].transform.localPosition = mjMachine.uiScorePosSeat[i] + offset;
                mjAssetsMgr.AppendToDestoryPool(uiScoreDec[i]);

                uiScoreInc[i] = Object.Instantiate(prefabUIScoreInc, uiCanvasTransform);
                uiScoreInc[i].SetActive(false);
                uiScoreInc[i].transform.localPosition = mjMachine.uiScorePosSeat[i] + offset;
                mjAssetsMgr.AppendToDestoryPool(uiScoreInc[i]);

                uiSpeedLine[i] = Object.Instantiate(prefabSpeedLine, uiCanvasTransform);
                uiSpeedLine[i].transform.localPosition = mjMachine.uiScorePosSeat[i];
                uiSpeedLine[i].SetActive(false);
                mjAssetsMgr.AppendToDestoryPool(uiSpeedLine[i]);

                uiStarShan[i] = Object.Instantiate(prefabStarShan, uiCanvasTransform);
                uiStarShan[i].transform.localPosition = mjMachine.uiScorePosSeat[i];
                uiStarShan[i].SetActive(false);
                mjAssetsMgr.AppendToDestoryPool(uiStarShan[i]);
            }
        }
示例#2
0
        public void Load()
        {
            pointTransform = Object.Instantiate(prefabPoint, mjTable).transform;
            mjAssetsMgr.AppendToDestoryPool(pointTransform.gameObject);

            tweener = pointTransform.DOBlendableLocalMoveBy(new Vector3(0, 0.01f, 0), 0.6f);
            tweener.SetAutoKill(false);
            tweener.SetEase(Ease.Linear).SetLoops(-1, LoopType.Yoyo);
            tweener.Pause();
            mjAssetsMgr.AppendToDestoryPool(tweener);

            pointTransform.gameObject.SetActive(false);
        }
示例#3
0
        public void Load()
        {
            diceMachineTransform = Object.Instantiate(prefabDiceMachine, mjTable).transform;
            mjAssetsMgr.AppendToDestoryPool(diceMachineTransform.gameObject);

            gaiziTransform = diceMachineTransform.Find("QiDongQiGanZi");
            Renderer renderer = gaiziTransform.GetComponent <Renderer>();

            gaiziMat = renderer.sharedMaterial;

            diceTransform  = diceMachineTransform.Find("dice");
            diceAnim       = diceTransform.GetComponent <Animation>();
            dice1Transform = diceTransform.Find("diceRot").Find("dice1");
            dice2Transform = diceTransform.Find("diceRot").Find("dice2");

            qiDongQiDictBoxTransform = diceMachineTransform.Find("QiDongQiDictBox");

            timerNumTransform[0]      = diceMachineTransform.Find("Num1");
            timerNumSpriteRenderer[0] = timerNumTransform[0].GetComponent <SpriteRenderer>();
            timerNumTransform[0].gameObject.SetActive(false);

            timerNumTransform[1]      = diceMachineTransform.Find("Num2");
            timerNumSpriteRenderer[1] = timerNumTransform[1].GetComponent <SpriteRenderer>();
            timerNumTransform[1].gameObject.SetActive(false);

            qiDongQi = diceMachineTransform.Find("QiDongQi");

            fengWeiQiDongQiOff[(int)FengWei.EAST]  = qiDongQi.Find("QiDongQiEast");
            fengWeiQiDongQiOff[(int)FengWei.SOUTH] = qiDongQi.Find("QiDongQiSouth");
            fengWeiQiDongQiOff[(int)FengWei.WEST]  = qiDongQi.Find("QiDongQiWest");
            fengWeiQiDongQiOff[(int)FengWei.NORTH] = qiDongQi.Find("QiDongQiNorth");

            fengWeiQiDongQiOn[(int)FengWei.EAST]  = qiDongQi.Find("QiDongQiEastLight");
            fengWeiQiDongQiOn[(int)FengWei.SOUTH] = qiDongQi.Find("QiDongQiSouthLight");
            fengWeiQiDongQiOn[(int)FengWei.WEST]  = qiDongQi.Find("QiDongQiWestLight");
            fengWeiQiDongQiOn[(int)FengWei.NORTH] = qiDongQi.Find("QiDongQiNorthLight");


            renderer = qiDongQi.Find("QiDongQiEastLight").GetComponent <Renderer>();

            renderer.sharedMaterial.SetColor("_Color", qiDongQiOnStartFlashColor);
            qiDongQiMatTweener = renderer.sharedMaterial.DOColor(qiDongQiOnEndFlashColor, 0.5f);
            qiDongQiMatTweener.SetAutoKill(false);
            qiDongQiMatTweener.SetEase(Ease.Linear).SetLoops(-1, LoopType.Yoyo);
            qiDongQiMatTweener.Pause();
            mjAssetsMgr.AppendToDestoryPool(qiDongQiMatTweener);
        }
示例#4
0
        public void Load()
        {
            GameObject go = Object.Instantiate(prefabUISwapPaiingTips, uiCanvasTransform);

            go.SetActive(false);
            mjAssetsMgr.AppendToDestoryPool(go);

            uiSwapPaiingTips = go.transform;
            textSwapType     = uiSwapPaiingTips.Find("TextSwapType");
        }
示例#5
0
        public void Load()
        {
            for (int i = 0; i < 4; i++)
            {
                playerTouXiangSeat[i] = Object.Instantiate(prefabPlayerTouXiang, canvas).transform;
                playerTouXiangSeat[i].localPosition = mjMachine.uiTouXiangPosSeat[i];
                tingPaiFlagSeat[i] = playerTouXiangSeat[i].Find("TingPaiFlag");
                huaSeFlagSeat[i]   = playerTouXiangSeat[i].Find("HuaSeFlag");
                scoreSeat[i]       = playerTouXiangSeat[i].Find("Coin").GetComponent <Text>();

                canvasGroup[i] = playerTouXiangSeat[i].GetComponent <CanvasGroup>();
                HideTingFlag(i);
                HideHuaSeFlag(i);
                mjAssetsMgr.AppendToDestoryPool(playerTouXiangSeat[i].gameObject);


                fadeTweener[i] = canvasGroup[i].DOFade(0.25f, 0.8f);
                fadeTweener[i].SetAutoKill(false);
                fadeTweener[i].SetEase(Ease.Linear).SetLoops(-1, LoopType.Yoyo);
                fadeTweener[i].Pause();
                mjAssetsMgr.AppendToDestoryPool(fadeTweener[i]);
            }

            GameObject touXiangLiuGuang;

            for (int i = 0; i < MahjongMachine.playerCount; i++)
            {
                if (!mjMachine.isCanUseSeatPlayer[i])
                {
                    playerTouXiangSeat[i].gameObject.SetActive(false);
                    continue;
                }

                SetHuaSeFlagDir(i);

                playerTouXiangSeat[i].gameObject.SetActive(true);
                touXiangLiuGuang = playerTouXiangSeat[i].Find("TouXiangLiuGuang").gameObject;
                seatTouXiangLiuGuangEffects[i] = new UITouXiangLiuGuangEffect();
                seatTouXiangLiuGuangEffects[i].Setting(mjMachine, touXiangLiuGuang);
                seatTouXiangLiuGuangEffects[i].Stop();
            }
        }
        public void Load()
        {
            uiHuaSeMove = Object.Instantiate(uiQueMen.prefabUISprite, uiQueMen.uiSelectQueYiMen.transform);
            mjAssetsMgr.AppendToDestoryPool(uiHuaSeMove);
            uiHuaSeMoveImage = uiHuaSeMove.GetComponent <Image>();
            uiHuaSeMove.SetActive(false);

            uiHuaSeFlag = Object.Instantiate(uiQueMen.prefabUIHuaSeFlag, uiQueMen.uiSelectQueYiMen.transform);
            mjAssetsMgr.AppendToDestoryPool(uiHuaSeFlag);

            ParticleSystem.MainModule main = uiHuaSeFlag.transform.Find("Guang").GetComponent <ParticleSystem>().main;
            main.duration      = 0.4f;
            main.startLifetime = 0.4f;

            main               = uiHuaSeFlag.transform.Find("OutGuangQuan").GetComponent <ParticleSystem>().main;
            main.duration      = 0.6f;
            main.startLifetime = 0.6f;

            uiHuaSeFlag.SetActive(false);
            uiHuaSeFlagImage = uiHuaSeFlag.transform.Find("HuaSe").GetComponent <Image>();
        }
示例#7
0
        public void Load()
        {
            huPaiTips = Object.Instantiate(prefabUiHuPaiTips, uiCanvasTransform);
            huPaiTipsRectTransform = huPaiTips.GetComponent <RectTransform>();
            huPaiTipsContent       = huPaiTips.transform.Find("Scroll View").Find("Viewport").Find("Content");
            gridLayoutGroup        = huPaiTipsContent.GetComponent <GridLayoutGroup>();
            spacingx = gridLayoutGroup.spacing.x;
            spacingy = gridLayoutGroup.spacing.y;

            huPaiTips.SetActive(false);

            mjAssetsMgr.AppendToDestoryPool(huPaiTips);
        }
示例#8
0
        public void Load()
        {
            GameObject go = Object.Instantiate(prefabUiSelectHuaSeHandPaiTips, uiCanvasTransform);

            go.SetActive(false);
            uiSelectHuaSeHandPai = go.transform;
            mjAssetsMgr.AppendToDestoryPool(go);


            uiXuanPaiZhongTips[1] = uiSelectHuaSeHandPai.transform.Find("UIXuanPaiZhongTips1");
            GameObject dian1 = uiXuanPaiZhongTips[1].Find("dian1").gameObject;
            GameObject dian2 = uiXuanPaiZhongTips[1].Find("dian2").gameObject;
            GameObject dian3 = uiXuanPaiZhongTips[1].Find("dian3").gameObject;

            uiTextDianWaittings[1] = new UITextDianWaitting(new GameObject[] { dian1, dian2, dian3 });

            uiXuanPaiZhongTips[2] = uiSelectHuaSeHandPai.transform.Find("UIXuanPaiZhongTips2");
            dian1 = uiXuanPaiZhongTips[2].Find("dian1").gameObject;
            dian2 = uiXuanPaiZhongTips[2].Find("dian2").gameObject;
            dian3 = uiXuanPaiZhongTips[2].Find("dian3").gameObject;
            uiTextDianWaittings[2] = new UITextDianWaitting(new GameObject[] { dian1, dian2, dian3 });

            uiXuanPaiZhongTips[3] = uiSelectHuaSeHandPai.transform.Find("UIXuanPaiZhongTips3");
            dian1 = uiXuanPaiZhongTips[3].Find("dian1").gameObject;
            dian2 = uiXuanPaiZhongTips[3].Find("dian2").gameObject;
            dian3 = uiXuanPaiZhongTips[3].Find("dian3").gameObject;
            uiTextDianWaittings[3] = new UITextDianWaitting(new GameObject[] { dian1, dian2, dian3 });

            tips      = uiSelectHuaSeHandPai.Find("Tips");
            btnOK     = tips.Find("BtnOK");
            btnOkRect = btnOK.GetComponent <RectTransform>();

            imageQue         = btnOK.Find("ImageQue").GetComponent <RectTransform>();
            imageDing        = btnOK.Find("ImageDing").GetComponent <RectTransform>();
            imageLeftKuoHao  = btnOK.Find("ImageLeftKuoHao").GetComponent <RectTransform>();
            imageRightKuoHao = btnOK.Find("ImageRightKuoHao").GetComponent <RectTransform>();
            imageNum1        = btnOK.Find("ImageNum1").GetComponent <RectTransform>();
            imageNum2        = btnOK.Find("ImageNum2").GetComponent <RectTransform>();

            Rect rect = imageNum1.GetComponent <Image>().sprite.rect;

            numScaleX = imageNum1.sizeDelta.x / rect.width;
            numScaleY = imageNum1.sizeDelta.y / rect.height;

            cdsTimer.SetLimitTime(20);

            EventTriggerListener.Get(btnOK.gameObject).onClick = OnButtonClick;
        }
示例#9
0
        public void LoadOppositeArrow()
        {
            swapPaiHintOppositeArrow = Object.Instantiate(prefabSwapPaiHintOppositeArrow, mjTable);
            swapPaiHintOppositeArrow.SetActive(false);
            mjAssetsMgr.AppendToDestoryPool(swapPaiHintOppositeArrow);

            swapPaiHintOppositeArrowUp   = swapPaiHintOppositeArrow.transform.Find("SwapPaiHintOppositeArrowUp");
            swapPaiHintOppositeArrowDown = swapPaiHintOppositeArrow.transform.Find("SwapPaiHintOppositeArrowDown");

            oppArrowUpTweener = swapPaiHintOppositeArrowUp.DOLocalMoveZ(-0.05f, 0.6f).SetRelative();
            oppArrowUpTweener.SetAutoKill(false);
            oppArrowUpTweener.SetEase(Ease.Linear).SetLoops(-1, LoopType.Yoyo);
            oppArrowUpTweener.Pause();
            mjAssetsMgr.AppendToDestoryPool(oppArrowUpTweener);

            oppArrowDownTweener = swapPaiHintOppositeArrowDown.DOLocalMoveZ(0.05f, 0.6f).SetRelative();
            oppArrowDownTweener.SetAutoKill(false);
            oppArrowDownTweener.SetEase(Ease.Linear).SetLoops(-1, LoopType.Yoyo);
            oppArrowDownTweener.Pause();
            mjAssetsMgr.AppendToDestoryPool(oppArrowDownTweener);
        }
示例#10
0
        public void Setting(MahjongMachine mjMachine)
        {
            this.mjMachine    = mjMachine;
            mjGame            = mjMachine.mjGame;
            mjAssets          = mjMachine.mjAssets;
            mjAssetsMgr       = mjMachine.mjAssetsMgr;
            uiCanvasTransform = mjMachine.uiCanvasTransform;

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


            uiBtnPS               = uiBtn.GetComponent <ParticleSystem>();
            huTextPS              = uiBtn.Find("HuText").GetComponent <ParticleSystem>();
            huTextHuXiPS          = uiBtn.Find("HuTextHuXi").GetComponent <ParticleSystem>();
            meiHuaImgPS           = uiBtn.Find("MeiHuaImg").GetComponent <ParticleSystem>();
            outsideExtGuangQuanPS = uiBtn.Find("OutsideExtGuangQuan").GetComponent <ParticleSystem>();
            petalsPS              = uiBtn.Find("Petals").GetComponent <ParticleSystem>();
            petalsPS2             = uiBtn.Find("Petals2").GetComponent <ParticleSystem>();
            petalsPS3             = uiBtn.Find("Petals3").GetComponent <ParticleSystem>();

            Image img = uiBtn.GetComponent <Image>();

            mat = img.material;


            meiHuaImgScale = meiHuaImgPS.transform.DOLocalRotate(new Vector3(0, 0, 10f), 1.5f);
            meiHuaImgScale.SetAutoKill(false);
            meiHuaImgScale.SetEase(Ease.Linear).SetLoops(-1, LoopType.Yoyo);
            meiHuaImgScale.Pause();

            mjAssetsMgr.AppendToDestoryPool(meiHuaImgScale);

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

            State5();
        }
示例#11
0
        public void Load()
        {
            uiSelectQueYiMen = Object.Instantiate(prefabUISelectQueYiMen, uiCanvasTransform);
            uiSelectQueYiMen.SetActive(false);
            mjAssetsMgr.AppendToDestoryPool(uiSelectQueYiMen);

            uiDingQueZhongTips[1] = uiSelectQueYiMen.transform.Find("UIDingQueZhongTips1");
            GameObject dian1 = uiDingQueZhongTips[1].Find("dian1").gameObject;
            GameObject dian2 = uiDingQueZhongTips[1].Find("dian2").gameObject;
            GameObject dian3 = uiDingQueZhongTips[1].Find("dian3").gameObject;

            uiTextDianWaittings[1] = new UITextDianWaitting(new GameObject[] { dian1, dian2, dian3 });

            uiDingQueZhongTips[2] = uiSelectQueYiMen.transform.Find("UIDingQueZhongTips2");
            dian1 = uiDingQueZhongTips[2].Find("dian1").gameObject;
            dian2 = uiDingQueZhongTips[2].Find("dian2").gameObject;
            dian3 = uiDingQueZhongTips[2].Find("dian3").gameObject;
            uiTextDianWaittings[2] = new UITextDianWaitting(new GameObject[] { dian1, dian2, dian3 });

            uiDingQueZhongTips[3] = uiSelectQueYiMen.transform.Find("UIDingQueZhongTips3");
            dian1 = uiDingQueZhongTips[3].Find("dian1").gameObject;
            dian2 = uiDingQueZhongTips[3].Find("dian2").gameObject;
            dian3 = uiDingQueZhongTips[3].Find("dian3").gameObject;
            uiTextDianWaittings[3] = new UITextDianWaitting(new GameObject[] { dian1, dian2, dian3 });


            wangTongTiao[(int)MahjongHuaSe.WANG]       = uiSelectQueYiMen.transform.Find("Wang");
            wangTongTiaoOrgPos[(int)MahjongHuaSe.WANG] = wangTongTiao[(int)MahjongHuaSe.WANG].localPosition;

            wangTongTiao[(int)MahjongHuaSe.TONG]       = uiSelectQueYiMen.transform.Find("Tong");
            wangTongTiaoOrgPos[(int)MahjongHuaSe.TONG] = wangTongTiao[(int)MahjongHuaSe.TONG].localPosition;

            wangTongTiao[(int)MahjongHuaSe.TIAO]       = uiSelectQueYiMen.transform.Find("Tiao");
            wangTongTiaoOrgPos[(int)MahjongHuaSe.TIAO] = wangTongTiao[(int)MahjongHuaSe.TIAO].localPosition;

            guangPS      = uiSelectQueYiMen.transform.Find("Guang").GetComponent <ParticleSystem>();
            clickGuangPS = uiSelectQueYiMen.transform.Find("ClickGuang").GetComponent <ParticleSystem>();

            tips = uiSelectQueYiMen.transform.Find("Tips");


            uiWangTongTiaoMove = Object.Instantiate(prefabUISprite, uiSelectQueYiMen.transform);
            mjAssetsMgr.AppendToDestoryPool(uiWangTongTiaoMove);
            uiWangTongTiaoMove.SetActive(false);
            uiWangTongTiaoMove.GetComponent <RectTransform>().sizeDelta = wangTongTiao[0].GetComponent <RectTransform>().sizeDelta;
            uiWangTongTiaoMoveImage = uiWangTongTiaoMove.GetComponent <Image>();


            uiWangTongTiaoFlag = Object.Instantiate(prefabUIHuaSeFlag, uiSelectQueYiMen.transform);
            mjAssetsMgr.AppendToDestoryPool(uiWangTongTiaoFlag);
            uiWangTongTiaoFlag.SetActive(false);
            uiWangTongTiaoFlagImage = uiWangTongTiaoFlag.transform.Find("HuaSe").GetComponent <Image>();


            EventTriggerListener.Get(wangTongTiao[0].gameObject).onClick = OnButtonClick;
            EventTriggerListener.Get(wangTongTiao[1].gameObject).onClick = OnButtonClick;
            EventTriggerListener.Get(wangTongTiao[2].gameObject).onClick = OnButtonClick;



            uiQueMenMoveHuaSe[1].Load();
            uiQueMenMoveHuaSe[2].Load();
            uiQueMenMoveHuaSe[3].Load();
        }