コード例 #1
0
        private void RefleshData(int playerId)
        {
            GameOverRecordData data       = DataCenter.Instance.players[playerId].gameOverRecord;
            PlayerInfo         playerInfo = DataCenter.Instance.players[playerId].playerInfo;

            GameObject parent = GameUtility.FindDeepChild(gameObject, string.Format("Player_GameOver_Record_{0}", playerId)).gameObject;

            GameUtility.FindDeepChild(parent, "胡牌次数/Num").GetComponent <UILabel>().text = "" + data.HuPaiCount;
            GameUtility.FindDeepChild(parent, "点炮次数/Num").GetComponent <UILabel>().text = "" + data.DianPaoCount;
            GameUtility.FindDeepChild(parent, "公杠次数/Num").GetComponent <UILabel>().text = "" + data.GongGangCount;
            GameUtility.FindDeepChild(parent, "暗杠次数/Num").GetComponent <UILabel>().text = "" + data.AnGangCount;
            GameUtility.FindDeepChild(parent, "中码次数/Num").GetComponent <UILabel>().text = "" + data.ZhongMaCount;
            GameUtility.FindDeepChild(parent, "总战绩/Num").GetComponent <UILabel>().text  = "" + data.ZongProfit;

            GameUtility.FindDeepChild(parent, "Head").GetComponent <UISprite>().atlas      = null;
            GameUtility.FindDeepChild(parent, "Head").GetComponent <UISprite>().atlas      = ResourcesManager.GetAtlas(Tags.MJ_DynamicAtlas);
            GameUtility.FindDeepChild(parent, "Head").GetComponent <UISprite>().spriteName = playerInfo.WXTX_Icon_SpriteName;
            GameUtility.FindDeepChild(parent, "Head/Name").GetComponent <UILabel>().text   = playerInfo.WXName;
            GameUtility.FindDeepChild(parent, "Head/ID").GetComponent <UILabel>().text     = playerInfo.GameID;
        }
コード例 #2
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 = "";
                }
            }
        }
コード例 #3
0
 void Start()
 {
     AddTexture(ResourcesManager.GetTexture("people"));
     AddTexture(ResourcesManager.GetTexture("playOffline"));
 }