コード例 #1
0
 public void SetEquipment(VictPlayerData playerData)
 {
     if (playerData.HeroEquipmentList == null)
     {
         return;
     }
     for (int i = 0; i < this.P_Equips.Length; i++)
     {
         if (i >= playerData.HeroEquipmentList.Count)
         {
             this.P_Equips[i].enabled = false;
         }
         else if (this.P_Equips[i].name != playerData.HeroEquipmentList[i])
         {
             if (playerData.HeroEquipmentList[i] == string.Empty)
             {
                 this.P_Equips[i].spriteName = null;
             }
             else
             {
                 SysBattleItemsVo dataById = BaseDataMgr.instance.GetDataById <SysBattleItemsVo>(playerData.HeroEquipmentList[i]);
                 if (dataById != null)
                 {
                     this.P_Equips[i].spriteName = dataById.icon;
                 }
             }
         }
     }
 }
コード例 #2
0
 private void SetEquipment(VictPlayerData playerData)
 {
     if (playerData.HeroEquipmentList == null)
     {
         for (int i = 0; i < this.equips.Length; i++)
         {
             this.equips[i].transform.FindChild("NullMask").gameObject.SetActive(true);
         }
         return;
     }
     for (int j = 0; j < this.equips.Length; j++)
     {
         if (j >= playerData.HeroEquipmentList.Count)
         {
             this.equips[j].enabled = false;
         }
         else if (this.equips[j].name != playerData.HeroEquipmentList[j])
         {
             if (playerData.HeroEquipmentList[j] == string.Empty)
             {
                 this.equips[j].transform.FindChild("NullMask").gameObject.SetActive(true);
             }
             else
             {
                 SysBattleItemsVo dataById = BaseDataMgr.instance.GetDataById <SysBattleItemsVo>(playerData.HeroEquipmentList[j]);
                 if (dataById != null)
                 {
                     this.equips[j].spriteName = dataById.icon;
                     this.equips[j].transform.FindChild("NullMask").gameObject.SetActive(false);
                 }
             }
         }
     }
 }
コード例 #3
0
    public void Init(HeroData _heroData, bool _win, VictPlayerData _playerData, bool isSelf = false, bool isFriend = false)
    {
        this._IsAlly = Singleton <PvpManager> .Instance.IsOurPlayer(int.Parse(_playerData.UserID));

        this.mPlayerData = _playerData;
        this.reward.gameObject.SetActive(_win);
        SysHeroMainVo heroMainData = BaseDataMgr.instance.GetHeroMainData(_heroData.HeroID);

        this.headIcon.mainTexture = ResourceManager.Load <Texture>(heroMainData.avatar_icon, true, true, null, 0, false);
        this.summonerName.text    = _playerData.SummonerName;
        this.kdaLabel.text        = string.Format("{0}/{1}/{2}", _playerData.KillHero, _playerData.Death, _playerData.KillAssist);
        this.goldLabel.text       = this.ThousandFormat(_playerData.Gold);
        if (Singleton <PvpManager> .Instance.IsObserver)
        {
            this.addFriend.gameObject.SetActive(false);
            this.addGood.gameObject.SetActive(false);
            this.report.gameObject.SetActive(false);
        }
        else
        {
            this.addFriend.gameObject.SetActive(!isSelf && !isFriend);
            this.addFriend.name = _playerData.SummonerId;
            this.addGood.gameObject.SetActive(!isSelf);
            this.addGood.name = _playerData.UserID;
            this.report.gameObject.SetActive(!isSelf);
        }
        UIEventListener.Get(this.addFriend.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickAddFriend);
        UIEventListener.Get(this.addGood.gameObject).onClick   = new UIEventListener.VoidDelegate(this.ClickAddGood);
        UIEventListener.Get(this.report.gameObject).onClick    = new UIEventListener.VoidDelegate(this.ClickReport);
        this.SetEquipment(_playerData);
    }
コード例 #4
0
 public void UpdateInfo(HeroData data, VictPlayerType type, VictPlayerData playerData, bool isSelf = false)
 {
     this.P_SummonerName.text = playerData.SummonerName;
     this.P_KillHero.text     = playerData.KillHero.ToString();
     this.P_KillMonster.text  = this.ThousandFormat(playerData.Gold);
     this.P_Kill.text         = playerData.Death.ToString();
     this.P_KillAssist.text   = playerData.KillAssist.ToString();
     this.P_Frame.gameObject.SetActive(isSelf);
     if (playerData.FirstKill)
     {
         this.Sign.gameObject.SetActive(true);
     }
 }
コード例 #5
0
    public void UpdateInfo(HeroData data, VictPlayerType type, VictPlayerData playerData, bool isSelf = false)
    {
        isSelf = playerData.IsControlPlayer;
        this.P_HeroLevel.text = data.LV.ToString();
        SysHeroMainVo heroMainData = BaseDataMgr.instance.GetHeroMainData(data.HeroID);

        if (LevelManager.Instance.IsPvpBattleType)
        {
            this.P_SummonerName.text = playerData.SummonerName;
        }
        else
        {
            this.P_SummonerName.text = LanguageManager.Instance.GetStringById(heroMainData.name);
        }
        this.SetIsHighestKillHero(playerData.isHighestKillHero);
        this.SetIsHighestKillMonster(playerData.isHighestKillMonster);
        this.P_KillHero.text    = playerData.KillHero.ToString();
        this.P_KillMonster.text = playerData.KillMonster.ToString();
        this.P_Kill.text        = "/" + playerData.Death.ToString();
        this.P_KillAssist.text  = "/" + playerData.KillAssist.ToString();
        if (isSelf)
        {
            this.P_SummonerName.color = new Color(0.9647059f, 0.9019608f, 0.360784322f);
        }
        else
        {
            this.P_SummonerName.color = Color.white;
        }
        if (playerData.LastChamRank <= 50)
        {
            this.P_SummonerName.gameObject.GetComponent <AllochroicLabelChecker>().RenderLabel(playerData.LastChamRank);
        }
        if (playerData.SelfIsDeath)
        {
            if (this.P_BG2 != null)
            {
                this.P_BG2.gameObject.SetActive(true);
            }
            if (this.LeftDeathTimeLabel != null)
            {
                this.LeftDeathTimeLabel.text = playerData.LeftDeathTime.ToString();
            }
        }
        else if (this.P_BG2 != null)
        {
            this.P_BG2.gameObject.SetActive(false);
        }
        this.CheckEquipment(playerData);
    }
コード例 #6
0
    public void Init(HeroData data, VictPlayerType type, VictPlayerData playerData, bool isSelf = false, bool isFriend = false)
    {
        this.mPlayerData = playerData;
        this._IsAlly     = Singleton <PvpManager> .Instance.IsOurPlayer(int.Parse(playerData.UserID));

        this.playerType = type;
        NGUITools.SetActiveChildren(this.P_HeroItem, false);
        GameObject  gameObject = NGUITools.AddChild(this.P_HeroItem, Resources.Load <GameObject>("Prefab/NewUI/SelectHero/SelectHeroItem"));
        NewHeroItem component  = gameObject.GetComponent <NewHeroItem>();

        component.Init(data, NewHeroItem.CardType.HeroAvator, true, true);
        gameObject.name = data.HeroID;
        if (isSelf)
        {
            this.P_SummonerName.color = new Color32(253, 173, 41, 255);
        }
        this.P_SummonerName.text = playerData.SummonerName;
        if (playerData.LastChamRank <= 50)
        {
            this.P_SummonerName.gameObject.GetComponent <AllochroicLabelChecker>().RenderLabel(playerData.LastChamRank);
        }
        this.P_KillHero.text    = playerData.KillHero.ToString();
        this.P_KillMonster.text = this.ThousandFormat(playerData.Gold);
        this.P_Kill.text        = playerData.Death.ToString();
        this.P_KillAssist.text  = playerData.KillAssist.ToString();
        if (Singleton <PvpManager> .Instance.IsObserver || ((LevelManager.m_CurLevel.IsFightWithRobot() || LevelManager.m_CurLevel.IsBattleNewbieGuide()) && type == VictPlayerType.BL))
        {
            this.P_AddFriend.gameObject.SetActive(false);
            this.P_AddGood.gameObject.SetActive(false);
        }
        else
        {
            this.P_AddFriend.gameObject.SetActive(!isSelf && !isFriend);
            this.P_AddFriend.name = playerData.SummonerId;
            this.P_AddGood.gameObject.SetActive(!isSelf);
            this.P_AddGood.name = playerData.UserID;
        }
        this.RegisteListener();
        this.SetEquipment(playerData);
        if (playerData.FirstKill)
        {
            this.Sign.gameObject.SetActive(true);
        }
        this.P_MvpIcon.SetActive(ModelManager.Instance.Get_Settle_MvpUserId() == playerData.UserID);
    }
コード例 #7
0
 private void CheckEquipment(VictPlayerData playerData)
 {
     if (playerData.HeroEquipmentList == null)
     {
         return;
     }
     for (int i = 0; i < this.P_Equips.Length; i++)
     {
         if (!(this.P_Equips[i] == null))
         {
             if (i >= playerData.HeroEquipmentList.Count)
             {
                 this.P_Equips[i].spriteName = null;
             }
             else if (this.P_Equips[i].name != playerData.HeroEquipmentList[i])
             {
                 this.P_Equips[i].name = playerData.HeroEquipmentList[i];
                 if (playerData.HeroEquipmentList[i] == string.Empty)
                 {
                     this.P_Equips[i].spriteName = null;
                 }
                 else
                 {
                     SysBattleItemsVo dataById = BaseDataMgr.instance.GetDataById <SysBattleItemsVo>(playerData.HeroEquipmentList[i]);
                     if (dataById != null)
                     {
                         this.P_Equips[i].spriteName = dataById.icon;
                     }
                     this.P_Equips[i].name = playerData.HeroEquipmentList[i];
                     UIEventListener expr_114 = UIEventListener.Get(this.P_Equips[i].gameObject);
                     expr_114.onMobileHover = (UIEventListener.BoolDelegate)Delegate.Combine(expr_114.onMobileHover, new UIEventListener.BoolDelegate(this.HoverEquip));
                 }
             }
         }
     }
 }
コード例 #8
0
    public void Init(VictPlayerType side, HeroData data, VictPlayerType type, VictPlayerData playerData, bool isSelf = false, bool isFriend = false)
    {
        if (side == type)
        {
            this.P_Frame.color = new Color32(7, 154, 0, 255);
            this.P_BG2.color   = new Color32(0, 154, 91, 171);
        }
        else
        {
            this.P_Frame.color = new Color32(222, 0, 0, 255);
            this.P_BG2.color   = new Color32(132, 5, 5, 171);
        }
        isSelf = playerData.IsControlPlayer;
        SysHeroMainVo heroMainData = BaseDataMgr.instance.GetHeroMainData(data.HeroID);

        this.P_HeroPic.spriteName = heroMainData.avatar_icon;
        if (LevelManager.Instance.IsPvpBattleType)
        {
            this.P_SummonerName.text = playerData.SummonerName;
            this.P_SummonerSkill.gameObject.SetActive(true);
            SysSkillMainVo skillMainData = BaseDataMgr.instance.GetSkillMainData(playerData.SummonerSkillID);
            if (skillMainData != null)
            {
                this.P_SummonerSkill.mainTexture = ResourceManager.Load <Texture>(skillMainData.skill_icon, true, true, null, 0, false);
            }
            else
            {
                this.P_SummonerSkill.gameObject.SetActive(false);
            }
        }
        else
        {
            this.P_SummonerName.text = LanguageManager.Instance.GetStringById(heroMainData.name);
            this.P_SummonerSkill.gameObject.SetActive(false);
        }
        this.SetIsHighestKillHero(playerData.isHighestKillHero);
        this.SetIsHighestKillMonster(playerData.isHighestKillMonster);
        this.P_HeroLevel.text      = data.LV.ToString();
        this.P_HeroPic.parent.name = data.HeroID;
        this.P_KillHero.text       = playerData.KillHero.ToString();
        this.P_KillMonster.text    = playerData.KillMonster.ToString();
        this.P_Kill.text           = "/" + playerData.Death.ToString();
        this.P_KillAssist.text     = "/" + playerData.KillAssist.ToString();
        this.P_BG1.gameObject.SetActive(isSelf);
        if (isSelf)
        {
            this.P_SummonerName.color = new Color(0.9647059f, 0.9019608f, 0.360784322f);
        }
        else
        {
            this.P_SummonerName.color = Color.white;
        }
        if (playerData.SelfIsDeath && !GameManager.IsGameOver())
        {
            this.P_BG2.gameObject.SetActive(true);
            this.LeftDeathTimeLabel.text = playerData.LeftDeathTime.ToString();
        }
        else
        {
            this.P_BG2.gameObject.SetActive(false);
        }
        this.P_AddFriend.gameObject.SetActive(!isSelf && !isFriend);
        this.P_AddFriend.name = playerData.SummonerId;
        UIEventListener.Get(this.P_AddFriend.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickAddFriend);
        this.CheckEquipment(playerData);
        if (this.SilencedIcon != null)
        {
            UIEventListener.Get(this.SilencedIcon.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickBlock);
            if (Singleton <StatisticView> .Instance.blockedSummonerList.Contains(playerData.SummonerId))
            {
                this.SilencedOn(true);
            }
            else
            {
                this.SilencedOn(false);
            }
            if (!isSelf && side == type)
            {
                this.SilencedIcon.gameObject.SetActive(true);
            }
            else
            {
                this.SilencedIcon.gameObject.SetActive(false);
            }
        }
        if (playerData.LastChamRank <= 50)
        {
            this.P_SummonerName.gameObject.GetComponent <AllochroicLabelChecker>().RenderLabel(playerData.LastChamRank);
        }
    }