示例#1
0
 public void SetHeroInfo(HeroProtoData heroProtoData)
 {
     this.instanceID = (uint)heroProtoData.id;
     if (heroProtoData.modelId != 0)
     {
         this.heroData = HeroData.GetHeroDataByID(heroProtoData.modelId);
     }
     if (heroProtoData.breakLayer != 0)
     {
         this.breakthroughLevel = heroProtoData.breakLayer;
     }
     if (heroProtoData.aggrLv != -1)
     {
         this.strengthenLevel = heroProtoData.aggrLv;
     }
     if (heroProtoData.star != 0)
     {
         this.advanceLevel = heroProtoData.star;
     }
     if (heroProtoData.exp != -1)
     {
         this.exp = heroProtoData.exp;
     }
     if (heroProtoData.lv != 0)
     {
         this.level = heroProtoData.lv;
     }
     if (heroProtoData.aggrExp != -1)
     {
         this.strengthenExp = heroProtoData.aggrExp;
     }
     UpdateHeroAttribute();
 }
示例#2
0
        //		public HeroInfo (BuyHeroInfo buyHeroInfo)
        //		{
        //			this.instanceID = 0;
        //			this.heroData = HeroData.GetHeroDataByID(buyHeroInfo.modelId);
        //			this.advanceLevel = buyHeroInfo.star;
        //			UpdateHeroAttribute();
        //		}

        public HeroInfo(int heroId)
        {
            this.instanceID   = (uint)heroId;
            heroData          = HeroData.GetHeroDataByID(heroId);
            this.advanceLevel = 1;
            UpdateHeroAttribute();
        }
示例#3
0
 public HeroInfo(DrawCardDropProto drawDropCardProto)
 {
     this.instanceID        = 0;
     this.heroData          = HeroData.GetHeroDataByID(drawDropCardProto.no);
     this.breakthroughLevel = 0;
     this.strengthenLevel   = 0;
     this.advanceLevel      = drawDropCardProto.star;
     this.level             = 1;
 }
示例#4
0
        //public int breakthroughLevel = 0;
        //public int strengthenLevel = 0;
        //public int advanceLevel = 0;
        //public int level = 1;

        //public int exp = 0;
        //public int strengthenExp = 0;
        //public int weaponID = 0;
        //public int armorID = 0;
        //public int accessoryID = 0;

        public HeroInfo(uint instanceID, int heroDataID, int breakthroughLevel, int strengthenLevel, int advanceLevel, int level = 1)
        {
            this.instanceID = instanceID;
            this.heroData   = HeroData.GetHeroDataByID(heroDataID);
            if (this.heroData == null)
            {
                Debugger.LogError("heroData is null,can't find id :" + heroDataID);
            }
            this.breakthroughLevel = breakthroughLevel;
            this.strengthenLevel   = strengthenLevel;
            this.advanceLevel      = advanceLevel;
            this.level             = level;
            UpdateHeroAttribute();
        }
示例#5
0
 public HeroInfo(TeamHeroProtoData data)
 {
     this.instanceID = (uint)data.id;
     heroData        = HeroData.GetHeroDataByID(data.heroNo);
     if (data.lv != 1)
     {
         level = data.lv;
     }
     if (data.star != 0)
     {
         advanceLevel = data.star;
     }
     if (data.aggrLv != -1)
     {
         strengthenLevel = data.aggrLv;
     }
     if (data.breakLayer != 0)
     {
         breakthroughLevel = data.breakLayer;
     }
 }
示例#6
0
        public HeroInfo(LuaTable heroInfoLuaTable)
        {
            this.instanceID = heroInfoLuaTable["instanceID"].ToString().ToUInt32();
            LuaTable heroDataLuaTable = (LuaTable)heroInfoLuaTable["heroData"];

            if (heroDataLuaTable == null)
            {
                Debugger.LogError("heroData is null,can't find ");
            }
            this.heroData          = HeroData.GetHeroDataByID(heroDataLuaTable["id"].ToString().ToInt32());
            this.breakthroughLevel = heroInfoLuaTable["breakthroughLevel"].ToString().ToInt32();
            this.strengthenLevel   = heroInfoLuaTable["strengthenLevel"].ToString().ToInt32();
            this.advanceLevel      = heroInfoLuaTable["advanceLevel"].ToString().ToInt32();
            this.level             = heroInfoLuaTable["level"].ToString().ToInt32();

            this.exp           = heroInfoLuaTable["exp"].ToString().ToInt32();
            this.strengthenExp = heroInfoLuaTable["strengthenExp"].ToString().ToInt32();

            this.weaponID    = heroInfoLuaTable["weaponID"].ToString().ToInt32();
            this.armorID     = heroInfoLuaTable["armorID"].ToString().ToInt32();
            this.accessoryID = heroInfoLuaTable["accessoryID"].ToString().ToInt32();
        }
示例#7
0
 public HeroInfo(GameResData gameResData)
 {
     this.heroData     = HeroData.GetHeroDataByID(gameResData.id);
     this.advanceLevel = gameResData.star;
     UpdateHeroAttribute();
 }