internal void ShowBattleInfo(HeroBattleInfo heroBattleInfo)
        {
            SetVib(true);
            PlayerName.text       = heroBattleInfo.HeroName;
            PlayerLevel.text      = heroBattleInfo.Level.ToString();
            PlayerKills.text      = heroBattleInfo.Kills.ToString();
            PlayerDeath.text      = heroBattleInfo.Deaths.ToString();
            PlayerIcon.spriteName = heroBattleInfo.HeadIcon.ToString();
            PlayerPlains.text     = heroBattleInfo.LastHit.ToString();
            Assist.text           = heroBattleInfo.Assist.ToString();
            int i = 1;

            if (heroBattleInfo.GetItemsInfo() != null)
            {
                foreach (var item in PlayerGoodsDic)
                {
                    item.Value.gameObject.SetActive(true);
                    int id = heroBattleInfo.GetId(i++);
                    item.Value.spriteName = "";
                    if (id != 0 && ConfigReader.ItemXmlInfoDict.ContainsKey(id))
                    {
                        item.Value.spriteName = ConfigReader.ItemXmlInfoDict[id].sIcon;
                    }
                }
            }
            else
            {
                foreach (var item in PlayerGoodsDic)
                {
                    //item.Value.gameObject.SetActive(false);
                    item.Value.spriteName = "";
                }
            }
        }
예제 #2
0
    public List <HeroBattleInfo> BuildHeroesBattleInfo()
    {
        var heroes = new List <HeroBattleInfo>();

        var hero = new HeroBattleInfo()
        {
            name      = "Berengar",
            thumbnail = "GuerreiroMachado",
            isPresent = true
        };

        heroes.Add(hero);

        hero = new HeroBattleInfo()
        {
            name      = "Brayan",
            thumbnail = "DruidaCajadoVinha",
            isPresent = true
        };

        heroes.Add(hero);

        hero = new HeroBattleInfo()
        {
            name      = "Malu",
            thumbnail = "Arqueira",
            isPresent = true
        };

        heroes.Add(hero);

        return(heroes);
    }
예제 #3
0
 void SetDic(UInt64 sGUID, HeroBattleInfo info)
 {
     if (info.campType == EntityCampTypeEnum.A)
     {
         AllBlueHeroBattle[sGUID] = info;
     }
     else if (info.campType == EntityCampTypeEnum.B)
     {
         AllRedHeroBattle[sGUID] = info;
     }
 }
예제 #4
0
        public List <HeroBattleInfo> BuildHeroesBattleInfo()
        {
            var heroes = new List <HeroBattleInfo>();

            var hero = new HeroBattleInfo()
            {
                name      = "Berengar",
                thumbnail = "GuerreiroMachado",
                isPresent = true
            };

            heroes.Add(hero);

            return(heroes);
        }
예제 #5
0
    public void AddInitPlayer(UInt64 sGUID, string name, int kills, int death, int Assist, int level, int lastHit, EntityCampTypeEnum type, int heroid)
    {
        HeroBattleInfo HeroBattle = null;
        Dictionary <UInt64, HeroBattleInfo> heroBattleDic = GetCamp(type);
        int id = heroid;
        HeroSelectConfigInfo info = ConfigReader.GetHeroSelectInfo(id);

        if (info == null)
        {
            Debug.LogError("HeroSeletCfg not Find heroId");
            return;
        }
        if (!heroBattleDic.TryGetValue(sGUID, out HeroBattle))
        {
            HeroBattle          = new HeroBattleInfo();
            HeroBattle.SGUID    = sGUID;
            HeroBattle.HeroName = name;
            HeroBattle.Level    = level;
            HeroBattle.Kills    = kills;
            HeroBattle.Deaths   = death;
            HeroBattle.Assist   = Assist;
            HeroBattle.HeadIcon = info.HeroSelectHead;
            HeroBattle.LastHit  = lastHit;
            HeroBattle.campType = type;
            SetDic(sGUID, HeroBattle);
            return;
        }
        HeroBattle.SGUID    = sGUID;
        HeroBattle.HeroName = name;
        HeroBattle.Level    = level;
        HeroBattle.Kills    = kills;
        HeroBattle.Deaths   = death;
        HeroBattle.Assist   = Assist;
        HeroBattle.HeadIcon = info.HeroSelectHead;
        HeroBattle.LastHit  = lastHit;
        HeroBattle.campType = type;
        SetDic(sGUID, HeroBattle);
    }
예제 #6
0
    public void AddPlayer(UInt64 sGUID, int temp, BattleDataType type, int index = 0, int goodsID = 0)
    {
        HeroBattleInfo HeroBattle = null;
        Dictionary <UInt64, HeroBattleInfo> heroBattleDic = GetCamp(sGUID);

        if (heroBattleDic == null)
        {
            return;
        }
        if (!heroBattleDic.TryGetValue(sGUID, out HeroBattle))
        {
            HeroBattle = new HeroBattleInfo();
            SetDic(sGUID, HeroBattle);
        }
        if (!EntityManager.AllEntitys.ContainsKey(sGUID))
        {
            return;
        }
        IEntity sEntity = EntityManager.AllEntitys[sGUID];

        switch (type)
        {
        case BattleDataType.Cp:
            HeroBattle.Cp = temp;
            break;

        case BattleDataType.LastHit:
            HeroBattle.LastHit = temp;
            break;

        case BattleDataType.HeadIcon:
            int id = (int)sEntity.ObjTypeID;
            HeroSelectConfigInfo info = ConfigReader.GetHeroSelectInfo(id);
            HeroBattle.HeadIcon = info.HeroSelectHead;
            break;

        case BattleDataType.NickName:
            HeroBattle.HeroName = temp.ToString();
            break;

        case BattleDataType.Level:
            HeroBattle.Level = temp;
            break;

        case BattleDataType.Kills:
            HeroBattle.Kills = temp;
            break;

        case BattleDataType.Deaths:
            HeroBattle.Deaths = temp;
            break;

        case BattleDataType.Assist:
            HeroBattle.Assist = temp;
            break;

        case BattleDataType.Goods:
            //if (goodsID != 0)
            HeroBattle.AddGoodItem(index, goodsID);
            //else
            //    HeroBattle.DelGoodsItem(index);
            break;
        }
        heroBattleDic[sGUID] = HeroBattle;
    }