少年修仙传客户端代码仓库
client_Wu Xijin
2018-08-20 1c4c5c5cb829334303bff98837a69a9653dca714
UI/HUD/HeadUpName.cs
@@ -80,38 +80,50 @@
        {
            m_PlayerName.text = _name;
            m_HangHint.gameObject.SetActive(_hang);
            SetRealm(_realm);
            SetPlayerRealm(_realm);
            SetTitle(_titleId);
            SetAlliance(_alliance);
            SyncPosition(true);
        }
        public void SetRealm(int _realm)
        public void SetPlayerRealm(int _realm)
        {
            m_Realm.gameObject.SetActive(_realm > 0);
            m_PlayerName.alignment = _realm > 0 ? TextAnchor.MiddleLeft : TextAnchor.MiddleCenter;
            if (_realm > 0)
            if (m_Realm)
            {
                var realmConfig = ConfigManager.Instance.GetTemplate<RealmConfig>(_realm);
                if (realmConfig != null)
                if (_realm > 0)
                {
                    m_Realm.gameObject.SetActive(true);
                    m_PlayerName.alignment = TextAnchor.MiddleLeft;
                    var realmConfig = ConfigManager.Instance.GetTemplate<RealmConfig>(_realm);
                    m_Realm.SetSprite(realmConfig.Img);
                    SetImageMaterialTexture(realmConfig.Img);
                }
                else
                {
                    m_Realm.gameObject.SetActive(false);
                    m_PlayerName.alignment = TextAnchor.MiddleCenter;
                }
            }
        }
        public void SetFunctionalNpcRealm(int _realm)
        public void SetNpcRealm(int _realm)
        {
            m_Realm.gameObject.SetActive(true);
            m_PlayerName.alignment = TextAnchor.MiddleLeft;
            var realmConfig = ConfigManager.Instance.GetTemplate<RealmConfig>(_realm);
            if (realmConfig != null)
            if (m_Realm != null)
            {
                m_Realm.SetSprite(realmConfig.Img);
                SetImageMaterialTexture(realmConfig.Img);
                if (ConfigManager.Instance.ContainKey<RealmConfig>(_realm))
                {
                    m_Realm.gameObject.SetActive(true);
                    m_PlayerName.alignment = TextAnchor.MiddleLeft;
                    var realmConfig = ConfigManager.Instance.GetTemplate<RealmConfig>(_realm);
                    m_Realm.SetSprite(realmConfig.Img);
                    SetImageMaterialTexture(realmConfig.Img);
                }
                else
                {
                    m_PlayerName.alignment = TextAnchor.MiddleCenter;
                    m_Realm.gameObject.SetActive(false);
                }
            }
        }
@@ -193,7 +205,7 @@
        public void SetNPCName(string _name)
        {
            SetFunctionalNpcRealm(0);
            SetNpcRealm(999);
            m_PlayerName.text = _name;
            SyncPosition(true);
        }
@@ -203,7 +215,7 @@
            var config = ConfigManager.Instance.GetTemplate<NPCConfig>(_id);
            if (config != null)
            {
                SetFunctionalNpcRealm(config.Realm);
                SetNpcRealm(config.ClientRealm);
                m_PlayerName.text = config.charName;
            }
@@ -217,10 +229,11 @@
            findPreciousModel.bossInfoUpdateEvent -= UpdateNpcRebornTime;
            findPreciousModel.bossInfoUpdateEvent += UpdateNpcRebornTime;
            npcId = _npcId;
            var config = ConfigManager.Instance.GetTemplate<NPCConfig>(_npcId);
            if (config != null)
            {
                SetRealm(config.Realm);
                SetNpcRealm(config.ClientRealm);
                m_PlayerName.text = config.charName;
            }
@@ -279,7 +292,7 @@
            var config = ConfigManager.Instance.GetTemplate<NPCConfig>(_npcId);
            if (config != null)
            {
                SetRealm(config.Realm);
                SetNpcRealm(config.ClientRealm);
                m_PlayerName.text = StringUtility.Contact(config.charName, Language.Get("HeadUpName_Monster", _level));
                monsterLevel = _level;
                monsterType = (E_MonsterType)config.IsBoss;