示例#1
0
 // Use this for initialization
 void Start()
 {
     try
     {
         RoleInfo info = LobbyClient.Instance.CurrentRole;
         if (null != info)
         {
             UserInfo user_info = info.GetPlayerSelfInfo();
             if (user_info != null)
             {
                 if (lblLevel != null)
                 {
                     lblLevel.text = info.Level.ToString();
                 }
                 if (lblName != null)
                 {
                     lblName.text = info.Nickname;
                 }
                 Data_PlayerConfig playerData = PlayerConfigProvider.Instance.GetPlayerConfigById(info.HeroId);
                 if (playerData != null)
                 {
                     if (spPortrait != null)
                     {
                         spPortrait.spriteName = playerData.m_Portrait;
                     }
                 }
             }
         }
     }
     catch (System.Exception ex)
     {
         ArkCrossEngine.LogicSystem.LogErrorFromGfx("Exception {0}\n{1}", ex.Message, ex.StackTrace);
     }
 }
示例#2
0
    internal static void Execute(object msg, NetConnection conn, NetworkSystem networkSystem)
    {
        Msg_RC_UpdateUserBattleInfo _msg = msg as Msg_RC_UpdateUserBattleInfo;

        if (null == _msg)
        {
            return;
        }
        List <int> skills = networkSystem.Robot.SkillIds;

        skills.Clear();
        if (null != _msg.skill_info && _msg.skill_info.Count > 0)
        {
            for (int i = 0; i < _msg.skill_info.Count; i++)
            {
                int skill_id = _msg.skill_info[i].skill_id;
                if (skill_id > 0 && !IsExSkill(skill_id))
                {
                    skills.Add(skill_id);
                    AddSubSkill(skills, skill_id);
                }
            }
            Data_PlayerConfig playerData = PlayerConfigProvider.Instance.GetPlayerConfigById(networkSystem.Robot.ConfigId);
            if (null != playerData && null != playerData.m_FixedSkillList && playerData.m_FixedSkillList.Count > 0)
            {
                foreach (int skill_id in playerData.m_FixedSkillList)
                {
                    if (skill_id > 0 && !IsExSkill(skill_id))
                    {
                        skills.Add(skill_id);
                    }
                }
            }
        }
    }
示例#3
0
    void OnEnable()
    {
        RoleInfo info = LobbyClient.Instance.CurrentRole;

        if (null != info)
        {
            if (lblLevel != null)
            {
                lblLevel.text = "Lv." + info.Level.ToString();
            }
            if (lblFighting != null)
            {
                lblFighting.text = ((int)info.FightingScore).ToString();
            }
            if (lblDiamond != null)
            {
                lblDiamond.text = info.Gold.ToString();
            }
            if (lblMoneyCoin != null)
            {
                lblMoneyCoin.text = info.Money.ToString();
            }
            Data_PlayerConfig playerData = PlayerConfigProvider.Instance.GetPlayerConfigById(info.HeroId);
            if (playerData != null)
            {
                if (spPortrait != null)
                {
                    spPortrait.spriteName = playerData.m_Portrait;
                }
            }
        }
    }
示例#4
0
 private void ApplyRage(CharacterInfo target, ImpactInfo impactInfo, int damage)
 {
     if (impactInfo.ConfigData.ExtraParams.Count >= 3)
     {
         int rage = int.Parse(impactInfo.ConfigData.ExtraParams[2]);
         if (target.IsUser)
         {
             target.SetRage(Operate_Type.OT_Relative, rage);
             Data_PlayerConfig dpc = PlayerConfigProvider.Instance.GetPlayerConfigById(target.GetLinkId());
             CharacterProperty cp  = target.GetActualProperty();
             if (dpc != null && cp != null)
             {
                 target.SetRage(Operate_Type.OT_Relative, (int)(damage * dpc.m_DamageRagePercent * cp.RageMax / cp.HpMax));
             }
             if (null != EventImpactLogicRage)
             {
                 EventImpactLogicRage(target, target.Rage);
             }
         }
         else
         {
             CharacterInfo user = target.SceneContext.GetCharacterInfoById(impactInfo.m_ImpactSenderId);
             if (user != null && user.IsUser)
             {
                 user.SetRage(Operate_Type.OT_Relative, rage);
                 if (null != EventImpactLogicRage)
                 {
                     EventImpactLogicRage(user, user.Rage);
                 }
             }
         }
     }
 }
示例#5
0
    //初始化玩家信息
    public void InitPlayerInfo(ArenaTargetInfo playerInfo)
    {
        if (null == playerInfo)
        {
            return;
        }
        m_PlayerInfo = playerInfo;
        if (lblLevel != null)
        {
            lblLevel.text = playerInfo.Level.ToString();
        }
        if (lblName != null)
        {
            lblName.text = playerInfo.Nickname;
        }
        if (lblRank != null)
        {
            lblRank.text = playerInfo.Rank.ToString();
        }
        if (lblFighting != null)
        {
            lblFighting.text = playerInfo.FightingScore.ToString();
        }
        //还差个战力
        Data_PlayerConfig playerCfg = PlayerConfigProvider.Instance.GetPlayerConfigById(playerInfo.HeroId);

        if (playerCfg != null && spPortrait != null)
        {
            spPortrait.spriteName = playerCfg.m_Portrait;
        }
    }
示例#6
0
    private string GetHeadSpName(int heroId)
    {
        Data_PlayerConfig cg = PlayerConfigProvider.Instance.GetPlayerConfigById(heroId);

        if (cg != null)
        {
            return(cg.m_Portrait);
        }
        return("");
    }
示例#7
0
 private void SetStaticProperty()
 {
     ArkCrossEngine.RoleInfo player = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
     if (player != null)
     {
         UnityEngine.Transform tf = transform.Find("Head/name_label");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = player.Nickname;
             }
         }
         tf = transform.Find("LeftFrame/Top/Label1");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 Data_PlayerConfig dpc = PlayerConfigProvider.Instance.GetPlayerConfigById(player.HeroId);
                 if (dpc != null)
                 {
                     ul.text = dpc.m_Name;
                 }
             }
         }
         tf = transform.Find("Head/headPic");
         if (tf != null)
         {
             UISprite us = tf.gameObject.GetComponent <UISprite>();
             if (us != null)
             {
                 Data_PlayerConfig cg = PlayerConfigProvider.Instance.GetPlayerConfigById(player.HeroId);
                 us.spriteName = cg.m_Portrait;
             }
         }
         tf = transform.Find("Right0/Button/Label");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(138);
             }
         }
     }
 }
示例#8
0
    /*设置好友头像区的信息*/
    void SetHeadInfo(GfxUserInfo userInfo)
    {
        SharedGameObjectInfo share_info = LogicSystem.GetSharedGameObjectInfo(userInfo.m_ActorId);

        UnityEngine.Transform transform;
        transform = gameObject.transform.Find("HeadInfo/Head");
        if (transform != null)
        {
            UISprite us = transform.gameObject.GetComponent <UISprite>();
            if (us != null)
            {
                Data_PlayerConfig cg = PlayerConfigProvider.Instance.GetPlayerConfigById(userInfo.m_HeroId);
                us.spriteName = cg.m_Portrait;
            }
        }
    }
示例#9
0
 void SetMemberInfo(GroupMemberInfo member, UnityEngine.GameObject go)
 {
     if (null != go && null != member)
     {
         UnityEngine.Transform transform;
         transform = go.transform.Find("name");
         if (null != transform)
         {
             UILabel uiLable = transform.gameObject.GetComponent <UILabel>();
             if (null != uiLable)
             {
                 uiLable.text = member.Nick;
             }
         }
         transform = go.transform.Find("level_label");
         if (null != transform)
         {
             UILabel uiLable = transform.gameObject.GetComponent <UILabel>();
             if (null != uiLable)
             {
                 uiLable.text = "Lv." + member.Level;
             }
         }
         transform = go.transform.Find("portrait");
         if (transform != null)
         {
             UISprite us = transform.gameObject.GetComponent <UISprite>();
             if (us != null)
             {
                 if (member.Status == UserState.DropOrOffline)
                 {
                     us.color = color2;
                 }
                 else
                 {
                     us.color = color1;
                 }
                 Data_PlayerConfig cg = PlayerConfigProvider.Instance.GetPlayerConfigById(member.HeroId);
                 if (cg != null)
                 {
                     us.spriteName = cg.m_Portrait;
                 }
             }
         }
     }
 }
示例#10
0
 /*设置好友item信息*/
 void SetFriendItemInfo(UnityEngine.GameObject go, ArkCrossEngine.FriendInfo friendInfo)
 {
     if (null != go && null != friendInfo)
     {
         UnityEngine.Transform transform;
         transform = go.transform.Find("name");
         if (null != transform)
         {
             UILabel uiLable = transform.gameObject.GetComponent <UILabel>();
             if (null != uiLable)
             {
                 uiLable.text = friendInfo.Nickname;
             }
         }
         transform = go.transform.Find("lv");
         if (null != transform)
         {
             UILabel uiLable = transform.gameObject.GetComponent <UILabel>();
             if (null != uiLable)
             {
                 uiLable.text = "Lv." + friendInfo.Level.ToString();
             }
         }
         transform = go.transform.Find("head");
         if (transform != null)
         {
             UISprite us = transform.gameObject.GetComponent <UISprite>();
             if (us != null)
             {
                 Data_PlayerConfig cg = PlayerConfigProvider.Instance.GetPlayerConfigById(friendInfo.HeroId);
                 us.spriteName = cg.m_PortraitForCell;
             }
         }
         transform = go.transform.Find("zhanli");
         if (null != transform)
         {
             UILabel uiLable = transform.gameObject.GetComponent <UILabel>();
             if (null != uiLable)
             {
                 uiLable.text = friendInfo.FightingScore.ToString();
             }
         }
     }
 }
示例#11
0
 /*设置item信息*/
 void SetItemInfo(UnityEngine.GameObject go, GroupMemberInfo info)
 {
     if (null != go && null != info)
     {
         UnityEngine.Transform transform;
         transform = go.transform.Find("name");
         if (null != transform)
         {
             UILabel uiLable = transform.gameObject.GetComponent <UILabel>();
             if (null != uiLable)
             {
                 uiLable.text = info.Nick;
             }
         }
         transform = go.transform.Find("lv");
         if (null != transform)
         {
             UILabel uiLable = transform.gameObject.GetComponent <UILabel>();
             if (null != uiLable)
             {
                 uiLable.text = "LV " + info.Level.ToString();
             }
         }
         transform = go.transform.Find("Sprite");
         if (transform != null)
         {
             UISprite us = transform.gameObject.GetComponent <UISprite>();
             if (us != null)
             {
                 Data_PlayerConfig cg = PlayerConfigProvider.Instance.GetPlayerConfigById(info.HeroId);
                 us.spriteName = cg.m_PortraitForCell;
             }
         }
         transform = go.transform.Find("zhanli");
         if (null != transform)
         {
             UILabel uiLable = transform.gameObject.GetComponent <UILabel>();
             if (null != uiLable)
             {
                 uiLable.text = info.FightingScore.ToString();
             }
         }
     }
 }
示例#12
0
 //自己的血条
 public void UpdateSelfPanel()
 {
     if (m_GfxUserInfo != null)
     {
         SharedGameObjectInfo share_info = LogicSystem.GetSharedGameObjectInfo(m_GfxUserInfo.m_ActorId);
         if (null != share_info)
         {
             UpdateHealthBar((int)share_info.Blood, (int)share_info.MaxBlood);
             UpdateMp((int)share_info.Energy, (int)share_info.MaxEnergy);
             SetHeroLevel(m_GfxUserInfo.m_Level);
             if (!m_IsInitialized)
             {
                 Data_PlayerConfig playerData = PlayerConfigProvider.Instance.GetPlayerConfigById(m_GfxUserInfo.m_HeroId);
                 if (playerData != null)
                 {
                     m_IsInitialized = true;
                     SetHeroPortrait(playerData.m_Portrait);
                 }
             }
         }
     }
 }
示例#13
0
 // Update is called once per frame
 void Update()
 {
     try
     {
         RoleInfo role_info = LobbyClient.Instance.CurrentRole;
         if (role_info != null)
         {
             //UpdateEx(role_info.Level, role_info.Exp);
             SetPlayerLevel(role_info.Level);
             SetFighting((int)role_info.FightingScore);
             if (preCurStamina != role_info.CurStamina || preMaxStamina != role_info.StaminaMax)
             {
                 preCurStamina = role_info.CurStamina;
                 StringBuilder sbuild = new StringBuilder();
                 sbuild.Append(role_info.CurStamina + "/" + role_info.StaminaMax);
                 if (lblStamina != null)
                 {
                     lblStamina.text = sbuild.ToString();
                 }
             }
             if (!m_IsInitialized)
             {
                 Data_PlayerConfig playerData = PlayerConfigProvider.Instance.GetPlayerConfigById(role_info.HeroId);
                 if (playerData != null)
                 {
                     m_IsInitialized = true;
                     SetPortrait(playerData.m_Portrait);
                     SetNickname(role_info.Nickname);
                 }
             }
         }
         UpdatePerTime(RealTime.deltaTime);
     }
     catch (System.Exception ex)
     {
         ArkCrossEngine.LogicSystem.LogErrorFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace);
     }
 }
示例#14
0
 public void SetLevelInfo(ExpeditionImageInfo enemy_info)
 {
     if (enemy_info != null)
     {
         if (lblFighting != null)
         {
             lblFighting.text = ((int)enemy_info.FightingScore).ToString();
         }
         if (lblLevel != null)
         {
             lblLevel.text = "Lv." + enemy_info.Level.ToString();
         }
         if (lblName != null)
         {
             lblName.text = enemy_info.Nickname;
         }
         Data_PlayerConfig playerCfg = PlayerConfigProvider.Instance.GetPlayerConfigById(enemy_info.HeroId);
         if (playerCfg != null && spPortrait != null)
         {
             spPortrait.spriteName = playerCfg.m_Portrait;
         }
     }
 }
示例#15
0
    public void InitData(ArkCrossEngine.Teammate info)
    {
        if (spHead != null)
        {
            Data_PlayerConfig cg = PlayerConfigProvider.Instance.GetPlayerConfigById(info.ResId);
            spHead.spriteName = cg.m_PortraitForCell;
        }
        if (lblName != null)
        {
            lblName.text = info.Nick;
        }

        if (lblMoney != null)
        {
            m_SourceValue = info.Money;
            m_tempValue   = info.Money;
            lblMoney.text = info.Money.ToString();
        }
        if (lblDiamond != null)
        {
            lblDiamond.text = "";
        }
    }
示例#16
0
        internal static UserArenaAttr CalcBaseAttr(int heroid, int level)
        {
            UserArenaAttr user = new UserArenaAttr();

            level       = level > 0 ? level : 0;
            user.HeroId = heroid;
            user.level  = level;
            Data_PlayerConfig config = PlayerConfigProvider.Instance.GetPlayerConfigById(heroid);

            if (config != null)
            {
                user.HpMax     = (int)config.m_AttrData.GetAddHpMax(0, 0);
                user.HpRecover = (int)config.m_AttrData.GetAddHpRecover(0, 0);
            }

            LevelupConfig level_config = PlayerConfigProvider.Instance.GetPlayerLevelupConfigById(heroid);

            if (level_config != null)
            {
                user.HpMax     += (int)(level_config.m_AttrData.GetAddHpMax(0, 0) * level);
                user.HpRecover += (int)(level_config.m_AttrData.GetAddHpRecover(0, 0) * level);
            }
            return(user);
        }
示例#17
0
        public void Init()
        {
            ArkCrossEngine.RoleInfo ri = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
            if (ri != null)
            {
                Data_PlayerConfig cg = PlayerConfigProvider.Instance.GetPlayerConfigById(ri.HeroId);
                if (cg != null)
                {
                    herostr = cg.m_Portrait;
                }
                heroname = ri.Nickname;
            }
            m_StoryInfos.Clear();
            DBC dlgCfg = new DBC();

            if (dlgCfg.Load(HomePath.GetAbsolutePath(FilePathDefine_Client.C_DialogConfig)))
            {
                for (int index = 0; index < dlgCfg.RowNum; index++)
                {
                    DBC_Row node = dlgCfg.GetRowByIndex(index);
                    if (null != node)
                    {
                        StoryDlgInfo info = new StoryDlgInfo();
                        info.ID           = DBCUtil.ExtractNumeric <int>(node, "Id", 0, true);
                        info.StoryName    = DBCUtil.ExtractString(node, "StoryName", "", true);
                        info.DlgType      = (StoryDlgPanel.StoryDlgType)DBCUtil.ExtractNumeric <int>(node, "DlgType", 0, true);
                        info.IntervalTime = DBCUtil.ExtractNumeric <float>(node, "IntervalTime", 1.0f, true);
                        info.StoryItems   = BuildStoryItems(info.StoryName);
                        if (!m_StoryInfos.ContainsKey(info.ID))
                        {
                            m_StoryInfos.Add(info.ID, info);
                        }
                    }
                }
            }
        }
示例#18
0
 void PvpResult(int result, int enemyheroid, int oldelo, int elo, int enemyoldelo, int enemyelo, int damage, int enemydamage, int maxhitcount, int enemyhitcount, string enemynickname)
 {
     try
     {
         if (JoyStickInputProvider.JoyStickEnable)
         {
             JoyStickInputProvider.JoyStickEnable = false;
         }
         UIManager.Instance.ShowWindowByName("MarsVictory");
         if (result == 0)
         {
             if (win != null)
             {
                 NGUITools.SetActive(win.gameObject, true);
                 NGUITools.SetActive(lose.gameObject, false);
             }
         }
         else
         {
             if (lose != null)
             {
                 NGUITools.SetActive(win.gameObject, false);
                 NGUITools.SetActive(lose.gameObject, true);
             }
         }
         ArkCrossEngine.RoleInfo ri = ArkCrossEngine.LobbyClient.Instance.CurrentRole;
         UnityEngine.Transform   tf;
         if (ri != null)
         {
             tf = transform.Find("sp_headMeBottom/lb_nameMe");
             if (tf != null)
             {
                 UILabel ul = tf.gameObject.GetComponent <UILabel>();
                 if (ul != null)
                 {
                     ul.text = ri.Nickname;
                 }
             }
             tf = transform.Find("sp_headMeBottom/sp_headMe");
             if (tf != null)
             {
                 UISprite us = tf.gameObject.GetComponent <UISprite>();
                 if (us != null)
                 {
                     Data_PlayerConfig cg = PlayerConfigProvider.Instance.GetPlayerConfigById(ri.HeroId);
                     us.spriteName = cg.m_Portrait;
                 }
             }
         }
         tf = transform.Find("sp_headYouBottom/sp_headYou");
         if (tf != null)
         {
             UISprite us = tf.gameObject.GetComponent <UISprite>();
             if (us != null)
             {
                 Data_PlayerConfig cg = PlayerConfigProvider.Instance.GetPlayerConfigById(enemyheroid);
                 us.spriteName = cg.m_Portrait;
             }
         }
         tf = transform.Find("sp_headYouBottom/lb_nameMe");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = enemynickname;
             }
         }
         tf = transform.Find("go_mainRect/go_jifen/lb_jifenMe");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = oldelo.ToString();
             }
         }
         tf = transform.Find("go_mainRect/go_jifen/lb_jifenMeJia");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = (elo - oldelo) >= 0 ? "+" + (elo - oldelo) : (elo - oldelo).ToString();
             }
         }
         tf = transform.Find("go_mainRect/go_jifen/lb_jifenYou");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = enemyoldelo.ToString();
             }
         }
         tf = transform.Find("go_mainRect/go_jifen/lb_jifenYouJia");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = (enemyelo - enemyoldelo) >= 0 ? "+" + (enemyelo - enemyoldelo) : (enemyelo - enemyoldelo).ToString();
             }
         }
         tf = transform.Find("go_mainRect/go_hurt/lb_hurtMe");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = damage.ToString();
             }
         }
         tf = transform.Find("go_mainRect/go_hurt/lb_hurtYou");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = enemydamage.ToString();
             }
         }
         tf = transform.Find("go_mainRect/go_lianji/lb_lianjiMe");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = maxhitcount.ToString();
             }
         }
         tf = transform.Find("go_mainRect/go_lianji/lb_lianjiYou");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = enemyhitcount.ToString();
             }
         }
     }
     catch (Exception ex)
     {
         ArkCrossEngine.LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace);
     }
 }
示例#19
0
    //初始化item信息
    public void InitItemInfo(ChallengeInfo info)
    {
        int             maxRank = 8000;
        ArenaBaseConfig bc      = ArenaConfigProvider.Instance.GetBaseConfigById(1);

        if (null != bc)
        {
            maxRank = bc.MaxRank + 1;
        }
        RoleInfo            role = LobbyClient.Instance.CurrentRole;
        ChallengeEntityInfo challengeInfo;

        if (role.Guid == info.Challenger.Guid)
        { // 自己是挑战者
            challengeInfo = info.Target;
            int rankUp = 0;
            if (info.IsChallengerSuccess)
            {     // 挑战别人赢了
                if (info.Target.Rank < 0)
                { // 别人未上榜 , 名次不变
                    rankUp = 0;
                }
                else if (info.Challenger.Rank == -1 && info.Target.Rank > 0)
                { //自己未上榜 别人在榜上
                    rankUp = maxRank - info.Target.Rank;
                }
                else
                {     // 都在榜上
                    if (info.Challenger.Rank - info.Target.Rank < 0)
                    { // 名次高于他人  ,此时名次不变
                        rankUp = 0;
                    }
                    else
                    {//自己在榜上 ,且名次低于他人, 改变名次此时要改变名次
                        rankUp = info.Challenger.Rank - info.Target.Rank;
                    }
                }
                winLabel.text = rankUp.ToString();
                NGUITools.SetActive(win, true);
                NGUITools.SetActive(fail, false);
            }
            else
            {// 挑战他人失败
                if (winLabel != null)
                {
                    failNum.text = "0";
                }
                NGUITools.SetActive(win, false);
                NGUITools.SetActive(fail, true);
            }
        }
        else
        { // 自己是被挑战者
            challengeInfo = info.Challenger;
            if (info.IsChallengerSuccess)
            { // 挑战者赢了 (我输了),
                NGUITools.SetActive(win, false);
                NGUITools.SetActive(fail, true);
                if (winLabel != null)
                {
                    int rankUp = 0;
                    if (info.Target.Rank == -1)
                    {// 我未上榜
                        rankUp = 0;
                    }
                    else if (info.Challenger.Rank == -1)
                    { // 他未上榜,那么我将是未上榜的人了 下降自己的名次
                        rankUp = info.Target.Rank + 1;
                    }
                    else if (info.Target.Rank - info.Challenger.Rank > 0)
                    { // 都在榜上,我名次低于他 名次不变
                        rankUp = 0;
                    }
                    else
                    { // 我名次高于他
                        rankUp = info.Challenger.Rank - info.Target.Rank;
                    }
                    failNum.text = rankUp.ToString();
                }
            }
            else
            { // 我赢了(挑战的人输了) 名次不变
                NGUITools.SetActive(win, true);
                NGUITools.SetActive(fail, false);
                if (winLabel != null)
                {
                    winLabel.text = "0";
                }
            }
        }
        if (playerName != null)
        {
            playerName.text = challengeInfo.NickName;
        }
        if (playerLevel != null)
        {
            playerLevel.text = "Lv." + challengeInfo.Level.ToString();
        }
        if (PlayerScore != null)
        {
            PlayerScore.text = challengeInfo.FightScore.ToString();
        }
        if (heroHead != null)
        {
            Data_PlayerConfig cg = PlayerConfigProvider.Instance.GetPlayerConfigById(challengeInfo.HeroId);
            heroHead.spriteName = cg.m_PortraitForCell;
        }
    }
示例#20
0
    // Update is called once per frame
    void Update()
    {
        try
        {
            RoleInfo role_info = LobbyClient.Instance.CurrentRole;
            if (role_info != null)
            {
                if (lblDiamond != null)
                {
                    lblDiamond.text = role_info.Gold.ToString();
                }
                if (lblMoney != null)
                {
                    lblMoney.text = role_info.Money.ToString();
                }
                if (lblStamina != null)
                {
                    lblStamina.text = role_info.CurStamina + "/" + 120;
                    if (staminaBar != null)
                    {
                        staminaBar.value = role_info.CurStamina / (float)120;
                    }
                }
                ExpeditionPlayerInfo ep_info   = role_info.GetExpeditionInfo();
                UserInfo             user_info = role_info.GetPlayerSelfInfo();
                if (ep_info != null && user_info != null)
                {
                    if (hpBar != null)
                    {
                        hpBar.value = ep_info.Hp / 1000f;
                        int    hpMax = user_info.GetActualProperty().HpMax;
                        int    curhp = (int)((float)ep_info.Hp / 1000f * hpMax);
                        string hpstr = string.Format("{0}/{1}", curhp > hpMax ? hpMax : curhp, hpMax);
                        if (lblHp != null)
                        {
                            lblHp.text = hpstr;
                        }
                    }
                    if (mpBar != null)
                    {
                        mpBar.value = ep_info.Mp / 1000f;
                    }

                    int    mpMax = user_info.GetActualProperty().EnergyMax;
                    int    curMp = (int)((float)ep_info.Mp / 1000f * mpMax);
                    string mpStr = string.Format("{0}/{1}", curMp > mpMax ? mpMax : curMp, mpMax);
                    if (lblMp != null)
                    {
                        lblMp.text = mpStr;
                    }
                    if (lblLevel != null)
                    {
                        lblLevel.text = role_info.Level.ToString();
                    }
                    if (spPortrait != null)
                    {
                        Data_PlayerConfig playerData = PlayerConfigProvider.Instance.GetPlayerConfigById(role_info.HeroId);
                        if (playerData != null)
                        {
                            spPortrait.spriteName = playerData.m_Portrait;
                        }
                    }
                }
            }
        }
        catch (System.Exception ex)
        {
            ArkCrossEngine.LogicSystem.LogErrorFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace);
        }
    }
示例#21
0
 private void SetMarsCellInfo(UnityEngine.GameObject go, GowDataForMsg gdfm, int order)
 {
     if (go != null && gdfm != null)
     {
         UnityEngine.Transform tf = go.transform.Find("Label4/Sprite");
         if (tf != null)
         {
             UISprite us = tf.gameObject.GetComponent <UISprite>();
             if (us != null)
             {
                 us.spriteName = "no" + (order + 1);
             }
         }
         tf = go.transform.Find("Head");
         if (tf != null)
         {
             UISprite us = tf.gameObject.GetComponent <UISprite>();
             if (us != null)
             {
                 Data_PlayerConfig cg = PlayerConfigProvider.Instance.GetPlayerConfigById(gdfm.m_Heroid);
                 us.spriteName = cg.m_PortraitForCell;
             }
         }
         tf = go.transform.Find("Label0");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = "Lv." + gdfm.m_Level;
             }
         }
         tf = go.transform.Find("Label1");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = gdfm.m_FightingScore.ToString();
             }
         }
         tf = go.transform.Find("Label2");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = gdfm.m_GowElo.ToString();
             }
         }
         tf = go.transform.Find("Label3");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 ul.text = gdfm.m_Nick;
             }
         }
         tf = go.transform.Find("Label4");
         if (tf != null)
         {
             UILabel ul = tf.gameObject.GetComponent <UILabel>();
             if (ul != null)
             {
                 if (order + 1 < 4)
                 {
                     ul.text = "NOD" + (char)('A' + order);
                 }
                 else
                 {
                     ul.text = (order + 1).ToString() + "ETH";
                 }
             }
         }
     }
 }
示例#22
0
 void OnEnable()
 {
     try
     {
         m_IsChapterMoving = false;
         RoleInfo info = LobbyClient.Instance.CurrentRole;
         if (null != info)
         {
             if (lblDiamond != null)
             {
                 lblDiamond.text = info.Gold.ToString();
             }
             if (lblMoney != null)
             {
                 lblMoney.text = info.Money.ToString();
             }
             if (lblPlayerLevel != null)
             {
                 lblPlayerLevel.text = info.Level.ToString();
             }
             if (lblPlayerName != null)
             {
                 lblPlayerName.text = info.Nickname;
             }
             UserInfo user_info = info.GetPlayerSelfInfo();
             if (user_info != null)
             {
                 Data_PlayerConfig playerData = PlayerConfigProvider.Instance.GetPlayerConfigById(info.HeroId);
                 if (playerData != null)
                 {
                     if (spPortrait != null)
                     {
                         spPortrait.spriteName = playerData.m_Portrait;
                     }
                 }
             }
         }
         hasCommonChapter = HasCommonChapter();
         hasMasterChapter = HasMasterChapter();
         if (startChapterId > 0)
         {
             StartChapter(startChapterId);
             startChapterId = 0;
         }
         else
         {
             if (!hasCommonChapter)
             {
                 m_SubSceneType = SubSceneType.Master;
             }
             else if (!hasMasterChapter)
             {
                 m_SubSceneType = SubSceneType.Common;
             }
             InitChapters(m_SubSceneType);
         }
     }
     catch (System.Exception ex)
     {
         ArkCrossEngine.LogicSystem.LogErrorFromGfx("Exception {0}\n{1}", ex.Message, ex.StackTrace);
     }
 }
示例#23
0
    //初始化item信息
    public void InitItemInfo(ArenaTargetInfo info)
    {
        if (info == null)
        {
            NGUITools.SetActive(sprite1, false);
            NGUITools.SetActive(sprite2, true);
            return;
        }
        NGUITools.SetActive(sprite2, false);
        NGUITools.SetActive(sprite1, true);
        RoleInfo role = LobbyClient.Instance.CurrentRole;

        if (info.Guid == role.Guid)
        {
            bg.color = color;
        }
        else
        {
            bg.color = color1;
        }
        if (playerName != null)
        {
            playerName.text = info.Nickname;
        }
        if (playerLevel != null)
        {
            playerLevel.text = "Lv." + info.Level.ToString();
        }
        if (PlayerScore != null)
        {
            PlayerScore.text = info.FightingScore.ToString();
        }
        unRank.text = "";
        if (info.Rank < 4)
        {
            switch (info.Rank)
            {
            case 1:
                cup.spriteName = "no1";
                number.text    = "NODA";
                NGUITools.SetActive(cup.gameObject, true);
                break;

            case 2:
                cup.spriteName = "no2";
                number.text    = "NODB";
                NGUITools.SetActive(cup.gameObject, true);
                break;

            case 3:
                cup.spriteName = "no3";
                number.text    = "NODC";
                NGUITools.SetActive(cup.gameObject, true);
                break;

            case -1:
                number.text = "";
                unRank.text = "未排名";
                NGUITools.SetActive(cup.gameObject, false);
                break;
            }
        }
        else
        {
            number.text = info.Rank + "ETH";
            NGUITools.SetActive(cup.gameObject, false);
        }
        if (heroHead != null)
        {
            Data_PlayerConfig cg = PlayerConfigProvider.Instance.GetPlayerConfigById(info.HeroId);
            heroHead.spriteName = cg.m_PortraitForCell;
        }
        SetPartnerPortraitActive();
        if (info.Guid == role.Guid)
        { // 自己 由于服务器发回来的列表里没有自己,所以自己要担架
            for (int i = 0; i < role.ArenaStateInfo.FightPartners.Count; i++)
            {
                PartnerInfo    partnerInfo = GetPartnerInfoById(role.ArenaStateInfo.FightPartners[i]);
                Data_NpcConfig npcCfg      = NpcConfigProvider.Instance.GetNpcConfigById(partnerInfo.LinkId);
                if (npcCfg != null)
                {
                    if (i <= arrNum)
                    {
                        SetPartnerIcon(portrait[i], portraitFrame[i], partnerInfo);
                        NGUITools.SetActive(portrait[i].gameObject, true);
                    }
                }
            }
        }
        else
        { // 列表其他人
            for (int i = 0; i < info.FightPartners.Count; i++)
            {
                Data_NpcConfig npcCfg = NpcConfigProvider.Instance.GetNpcConfigById(info.FightPartners[i].LinkId);
                if (npcCfg != null)
                {
                    if (i <= arrNum)
                    {
                        SetPartnerIcon(portrait[i], portraitFrame[i], info.FightPartners[i]);
                        NGUITools.SetActive(portrait[i].gameObject, true);
                    }
                }
            }
        }
    }
示例#24
0
    //对外接口,初始化信息
    public void ShowIntro(ArenaTargetInfo info)
    {
        if (hasStart == false)
        {
            Start();
        }
        if (info != null)
        {
            if (lblName != null)
            {
                lblName.text = info.Nickname;
            }
            if (lblFightScore != null)
            {
                lblFightScore.text = info.FightingScore.ToString();
            }
            if (lblRank != null)
            {
                lblRank.text = info.Rank.ToString();
            }
            if (spHead != null)
            {
                Data_PlayerConfig cg = PlayerConfigProvider.Instance.GetPlayerConfigById(info.HeroId);
                spHead.spriteName = cg.m_PortraitForCell;
            }
            //装备
            for (int i = 0; i < equiparry.Length; i++)
            {
                equiparry[i].hasEquip = false;
            }
            for (int i = 0; i < info.Equips.Length; i++)
            {
                ItemDataInfo item = info.Equips[i];
                if (item != null)
                {
                    ItemConfig config = ItemConfigProvider.Instance.GetDataById(item.ItemId);
                    if (config != null && config.m_WearParts < equiparry.Length)
                    {
                        equiparry[config.m_WearParts].SetEquipmentInfo(item.ItemId, item.Level, item.RandomProperty, 1);
                    }
                }
            }
            for (int i = 0; i < equiparry.Length; i++)
            {
                if (equiparry[i].hasEquip == false)
                {
                    equiparry[i].SetFrameAndIcon(defaultEquipSprite[i]);//无装备设为默认图标
                }
            }
            //伙伴
            int totalFightScore = info.FightingScore;
            for (int i = 0; i < partnerSlotList.Count; i++)
            {
                if (i < info.FightPartners.Count)
                {
                    partnerSlotList[i].InitPartnerInfo(info.FightPartners[i]);
                    totalFightScore += partnerSlotList[i].GetFighting();
                    NGUITools.SetActive(partnerSlotList[i].gameObject, true);
                }
                else
                {
                    NGUITools.SetActive(partnerSlotList[i].gameObject, false);
                }
            }
            if (gridPartnersParent != null)
            {
                gridPartnersParent.repositionNow = true;
            }
            if (lblTotalFightScore != null)
            {
                lblTotalFightScore.text = totalFightScore.ToString();//所有伙伴战力
            }

            UIManager.Instance.ShowWindowByName("PPVPFighterIntro");
        }
    }