예제 #1
0
        public static void GetRoleDesButton(GameObject go, LuaTable roleInfo, bool isPlayer, bool isLongPress = true)
        {
            RoleDesButton       btn  = RoleDesButton.Get(go);
            ShowDescriptionType type = isLongPress ? ShowDescriptionType.longPress : ShowDescriptionType.click;

            if (isPlayer)
            {
                btn.SetRoleInfo(new PlayerInfo(roleInfo), type);
            }
            else
            {
                btn.SetRoleInfo(new HeroInfo(roleInfo), type);
            }
        }
예제 #2
0
        public static void GetRoleDesButton(GameObject go, int id, int star, bool isShowBase, bool isLongPress = true)
        {
            RoleDesButton       btn  = RoleDesButton.Get(go);
            ShowDescriptionType type = isLongPress ? ShowDescriptionType.longPress : ShowDescriptionType.click;

            if (isShowBase)
            {
                btn.SetRoleInfo(new GameResData(BaseResType.Hero, id, 0, star), type);
            }
            else
            {
                if (GameProxy.instance.IsPlayer((uint)id))
                {
                    btn.SetRoleInfo(GameProxy.instance.PlayerInfo, type);
                }
                else
                {
                    btn.SetRoleInfo(Logic.Hero.Model.HeroProxy.instance.GetHeroInfo((uint)id), type);
                }
            }
        }
예제 #3
0
        private void RefreshHero()
        {
            //            roleRoot.SetActive(true);
            //            if (_roleInfo is PlayerInfo)
            //            {
            //                heroHeadIcon.sprite = ResMgr.instance.Load<Sprite>((_roleInfo as PlayerInfo).PetHeadIcon);
            //            }
            //            else
            //            {
            //                heroHeadIcon.sprite = ResMgr.instance.Load<Sprite>(_roleInfo.HeadIcon);
            //            }
            //            RefreshStars();
            //
            //            if (roleTypeIconImage != null)
            //            {
            //                roleTypeIconImage.sprite = UIUtil.GetRoleTypeSmallIconSprite(_roleInfo.heroData.roleType);
            //                roleTypeIconImage.gameObject.SetActive(true);
            //            }
            //            SetName(Localization.Get(_roleInfo.heroData.name));

            roleRoot.SetActive(false);
            if (_commonHeroIcon == null)
            {
                _commonHeroIcon = UI.CommonHeroIcon.View.CommonHeroIcon.Create(transform);
            }

            if (_roleInfo is PlayerInfo)
            {
                _commonHeroIcon.SetPlayerInfo(_roleInfo as PlayerInfo);
            }
            else
            {
                _commonHeroIcon.SetHeroInfo(_roleInfo as HeroInfo);
            }

            RoleDesButton btn = RoleDesButton.Get(_commonHeroIcon.gameObject);

            btn.SetRoleInfo(_roleInfo);

            if (_commonHeroIcon != null)
            {
                _commonHeroIcon.gameObject.SetActive(true);
            }
            if (_commonEquipIcon != null)
            {
                _commonEquipIcon.gameObject.SetActive(false);
            }
            if (_commonItemIcon != null)
            {
                _commonItemIcon.gameObject.SetActive(false);
            }
        }
예제 #4
0
        private void Refresh()
        {
            imgIcon.SetSprite(ResMgr.instance.Load <Sprite>(_friendInfo.headIcon));
            textLevel.text = string.Format(Localization.Get("ui.friendView.friendLv"), _friendInfo.level);
            textName.text  = _friendInfo.name;
            textPower.text = string.Format(Localization.Get("ui.friendView.friendPower"), _friendInfo.power);

            RoleInfo roleInfo;

            for (int i = 0, count = _friendInfo.formationHeroList.Count; i < count; i++)
            {
                roleInfo = _friendInfo.formationHeroList[i];
                CommonHeroIcon.View.CommonHeroIcon icon = CommonHeroIcon.View.CommonHeroIcon.Create(heroRoot);
                icon.SetRoleInfo(roleInfo);
                RoleDesButton des = icon.gameObject.AddComponent <RoleDesButton>();
                des.SetRoleInfo(roleInfo);
            }
        }