Example #1
0
 public PlayerInfo(PlayerProtoData playerProtoData)
 {
     this.playerData   = PlayerData.GetPlayerData((uint)playerProtoData.modelId);
     this.heroData     = HeroData.GetHeroDataByID(playerData.heroId);
     this.advanceLevel = (int)heroData.starMin;
     //            this.name = PlayerProxy.instance.PlayerName;
     //			this.faceIndex = (uint)playerProtoData.faceId;
     //			this.hairCutIndex = (uint)playerProtoData.hairCutId;
     //			this.hairColorIndex = (uint)playerProtoData.hairColorId;
     SetPlayerInfo(playerProtoData);
 }
Example #2
0
        public void SetPlayerInfo(PlayerProtoData playerProtoData)
        {
            if (playerProtoData == null)
            {
                return;
            }
            this.instanceID = (uint)playerProtoData.id;
            if (playerProtoData.modelId != 0)
            {
                this.playerData = PlayerData.GetPlayerData((uint)playerProtoData.modelId);
                this.heroData   = HeroData.GetHeroDataByID(playerData.heroId);
            }

            this.avatarData = AvatarData.GetAvatarData(this.playerData.avatarID);
            if (playerProtoData.hairCutId != 0)
            {
                this.hairCutIndex = (uint)playerProtoData.hairCutId;
            }
            if (playerProtoData.hairColorId != 0)
            {
                this.hairColorIndex = (uint)playerProtoData.hairColorId;
            }
            if (playerProtoData.faceId != 0)
            {
                this.faceIndex = (uint)playerProtoData.faceId;
            }
            if (playerProtoData.skinId != 0)
            {
                this.skinIndex = playerProtoData.skinId;
            }
            this.exp   = (playerProtoData.exp > 0 || this.level != playerProtoData.lv) ? playerProtoData.exp : this.exp;
            this.level = playerProtoData.lv != 1 ? playerProtoData.lv : this.level;
            if (playerProtoData.star != 0)
            {
                this.advanceLevel = playerProtoData.star;
            }
            if (playerProtoData.aggrLv != -1)
            {
                this.strengthenLevel = playerProtoData.aggrLv;
            }
            if (playerProtoData.aggrExp != -1)
            {
                this.strengthenExp = playerProtoData.aggrExp;
            }
            if (playerProtoData.breakLayer != 0)
            {
                this.breakthroughLevel = playerProtoData.breakLayer;
            }
        }