Ejemplo n.º 1
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;
        }
Ejemplo n.º 2
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();
        }