示例#1
0
        public string GetSpriteName(MJType type, int playerId, MJ_STAGE stage, bool bBack)
        {
            SEAT_DIR dir        = GameGD.GetSeatDir(playerId);
            string   spriteName = GetSpriteName(type, dir, stage, bBack);

            return(spriteName);
        }
示例#2
0
        private PanelType GetPlayerPanelType(int playerId)
        {
            PanelType type = PanelType.Player_LEFT;

            if (GameGD.GetSeatDir(playerId) == SEAT_DIR.DIR_LEFT)
            {
                type = PanelType.Player_LEFT;
            }
            else if (GameGD.GetSeatDir(playerId) == SEAT_DIR.DIR_BOTTOM)
            {
                type = PanelType.Player_BOTTOM;
            }
            else if (GameGD.GetSeatDir(playerId) == SEAT_DIR.DIR_RIGHT)
            {
                type = PanelType.Player_RIGHT;
            }
            else if (GameGD.GetSeatDir(playerId) == SEAT_DIR.DIR_TOP)
            {
                type = PanelType.Player_TOP;
            }
            return(type);
        }
示例#3
0
        private void SetPrepare(int playerId, bool bPrepare)
        {
            PlayerInfo player = DataCenter.Instance.players[playerId].playerInfo;
            SEAT_DIR   dir    = GameGD.GetSeatDir(player.DNXBDir);
            GameObject go     = null;

            switch (dir)
            {
            case SEAT_DIR.DIR_BOTTOM:
                go = GameUtility.FindDeepChild(gameObject, "Player_B").gameObject;
                break;

            case SEAT_DIR.DIR_RIGHT:
                go = GameUtility.FindDeepChild(gameObject, "Player_R").gameObject;
                break;

            case SEAT_DIR.DIR_TOP:
                go = GameUtility.FindDeepChild(gameObject, "Player_T").gameObject;
                break;

            case SEAT_DIR.DIR_LEFT:
                go = GameUtility.FindDeepChild(gameObject, "Player_L").gameObject;
                break;

            case SEAT_DIR.DIR_NULL:
                break;

            default:
                break;
            }

            if (go != null)
            {
                UISprite headIconSprite = GameUtility.FindDeepChild(go, "Head").GetComponent <UISprite>();
                headIconSprite.atlas = null;
                headIconSprite.atlas = ResourcesManager.GetAtlas(Tags.MJ_DynamicAtlas);
                if (bPrepare)
                {
                    headIconSprite.spriteName = player.WXTX_Icon_SpriteName;
                }
                else
                {
                    headIconSprite.spriteName = "";
                }

                UISprite prepareOKSprite = GameUtility.FindDeepChild(go, "PrepareOK").GetComponent <UISprite>();
                prepareOKSprite.gameObject.SetActive(bPrepare);

                UILabel nameLabel = GameUtility.FindDeepChild(go, "Name").GetComponent <UILabel>();
                if (bPrepare)
                {
                    nameLabel.text = player.WXName;
                }
                else
                {
                    nameLabel.text = "";
                }

                UILabel coinLabel = GameUtility.FindDeepChild(go, "Coin").GetComponent <UILabel>();
                if (bPrepare)
                {
                    coinLabel.text = "" + player.coin;
                }
                else
                {
                    coinLabel.text = "";
                }
            }
        }
示例#4
0
        public void GetSpriteWH(ref int w, ref int h, int playerId, MJ_STAGE stage)
        {
            SEAT_DIR dir = GameGD.GetSeatDir(playerId);

            switch (dir)
            {
            case SEAT_DIR.DIR_LEFT:
            {
                if (stage == MJ_STAGE.IN)
                {
                    w = GameGD.MJ_LEFT_IN_W; h = GameGD.MJ_LEFT_IN_H;
                }
                else if (stage == MJ_STAGE.OUT)
                {
                    w = GameGD.MJ_LEFT_OUT_W; h = GameGD.MJ_LEFT_OUT_H;
                }
                else if (stage == MJ_STAGE.CPG)
                {
                    w = GameGD.MJ_LEFT_CPG_W; h = GameGD.MJ_LEFT_CPG_H;
                }
                if (DataCenter.Instance.hFdata.IsHuiFanging)
                {
                    w = GameGD.MJ_LEFT_CPG_W; h = GameGD.MJ_LEFT_CPG_H;
                }
            }
            break;

            case SEAT_DIR.DIR_BOTTOM:
            {
                if (stage == MJ_STAGE.IN)
                {
                    w = GameGD.MJ_BOTTOM_IN_W; h = GameGD.MJ_BOTTOM_IN_H;
                }
                else if (stage == MJ_STAGE.OUT)
                {
                    w = GameGD.MJ_BOTTOM_OUT_W; h = GameGD.MJ_BOTTOM_OUT_H;
                }
                else if (stage == MJ_STAGE.CPG)
                {
                    w = GameGD.MJ_BOTTOM_CPG_W; h = GameGD.MJ_BOTTOM_CPG_H;
                }
                else if (stage == MJ_STAGE.CPGResult)
                {
                    w = GameGD.MJ_BOTTOM_CPG_RESULT_W; h = GameGD.MJ_BOTTOM_CPG_RESULT_H;
                }
            }
            break;

            case SEAT_DIR.DIR_RIGHT:
            {
                if (stage == MJ_STAGE.IN)
                {
                    w = GameGD.MJ_RIGHT_IN_W; h = GameGD.MJ_RIGHT_IN_H;
                }
                else if (stage == MJ_STAGE.OUT)
                {
                    w = GameGD.MJ_RIGHT_OUT_W; h = GameGD.MJ_RIGHT_OUT_H;
                }
                else if (stage == MJ_STAGE.CPG)
                {
                    w = GameGD.MJ_RIGHT_CPG_W; h = GameGD.MJ_RIGHT_CPG_H;
                }
                if (DataCenter.Instance.hFdata.IsHuiFanging)
                {
                    w = GameGD.MJ_RIGHT_CPG_W; h = GameGD.MJ_RIGHT_CPG_H;
                }
            }
            break;

            case SEAT_DIR.DIR_TOP:
            {
                if (stage == MJ_STAGE.IN)
                {
                    w = GameGD.MJ_TOP_IN_W; h = GameGD.MJ_TOP_IN_H;
                }
                else if (stage == MJ_STAGE.OUT)
                {
                    w = GameGD.MJ_TOP_OUT_W; h = GameGD.MJ_TOP_OUT_H;
                }
                else if (stage == MJ_STAGE.CPG)
                {
                    w = GameGD.MJ_TOP_CPG_W; h = GameGD.MJ_TOP_CPG_H;
                }
                if (DataCenter.Instance.hFdata.IsHuiFanging)
                {
                    w = GameGD.MJ_TOP_CPG_W; h = GameGD.MJ_TOP_CPG_H;
                }
            }
            break;

            default:
                break;
            }
        }
示例#5
0
        private void ShowCurChuPai(int playerId)
        {
            MJ mj = GetPlayerPanel(playerId).LastOutMJ;

            if (mj != null)
            {
                SetCurChuMJ(mj);
                ViewCenter.Instance.GetPanel <Panel_UI>(PanelType.UIManager).ShowChuPai(GameGD.GetSeatDir(playerId), mj.type);
                //UIManager.Instance.ShowChuPai(GameGD.GetSeatDir(playerId), mj.type);
            }
        }