Esempio n. 1
0
        /// <summary>
        /// 设置伙伴信息
        /// </summary>
        /// <param name="partnerData">伙伴数据</param>
        public void F_SetCardInfo(HeroBattleChoiceCellData partnerData)
        {
            m_Data = partnerData;
            bool isNull = partnerData == null;

            m_SelfObj.SetActive(!isNull);
            if (!isNull)
            {
                //获取指定的伙伴数据
                LTPartnerData data = LTPartnerDataManager.Instance.GetGeneralPartnerList().Find(p => p.HeroStat.id == partnerData.heroTplID);
                if (data != null)
                {
                    m_Card.Fill(data);
                    ////不要设置死亡情况
                    m_Card.DeathSprite.gameObject.SetActive(false);
                }
                else
                {
                    EB.Debug.LogError("为什么相应的partnerData.heroTplID:{0},没有相应的伙伴数据?", partnerData.heroTplID);
                }
                //是否选中
                m_SelectState.SetActive(partnerData.isUsed);
                //特效是否显示
                bool fxVisible = !partnerData.isUsed;
                if (fxVisible && data.HeroInfo.role_grade != (int)PartnerGrade.SSR)
                {
                    fxVisible = false;
                }
                for (int i = 0; i < m_Card.LevelSprite.transform.childCount; i++)
                {
                    m_Card.LevelSprite.transform.GetChild(i).gameObject.SetActive(fxVisible);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 实例化卡片
        /// </summary>
        /// <param name="parent"></param>
        public void ReflashTransCard()
        {
            if (tempTransData[0] != null)
            {
                leftIcon.Fill(LTPartnerDataManager.Instance.GetPartnerByHeroId(tempTransData[0].HeroId));
                leftNameLabel.text = leftIcon.ItemData.HeroInfo.name;
                leftIcon.mDMono.gameObject.CustomSetActive(true);
            }
            else
            {
                leftIcon.mDMono.gameObject.CustomSetActive(false);
                leftNameLabel.text = EB.Localizer.GetString("ID_PARTNER_TRANSTIPS");
            }
            if (tempTransData[1] != null)
            {
                rightIcon.Fill(LTPartnerDataManager.Instance.GetPartnerByHeroId(tempTransData[1].HeroId));
                rightNameLabel.text = rightIcon.ItemData.HeroInfo.name;
                rightIcon.mDMono.gameObject.CustomSetActive(true);
            }
            else
            {
                rightIcon.mDMono.gameObject.CustomSetActive(false);
                rightNameLabel.text = EB.Localizer.GetString("ID_PARTNER_TRANSTIPS");
            }

            DragPartnerCell.mDMono.gameObject.CustomSetActive(false);
        }
Esempio n. 3
0
        private void OnDragStart(CombatPartnerCellController partnerCell)
        {
            if (isOnDrag)
            {
                return;
            }
            isOnDrag    = true;
            partnerData = partnerCell.ItemData;
            EB.Debug.Log(partnerData.HeroId);
            tempCell     = partnerCell;
            tempWorldVec = partnerCell.mDMono.transform.position;
            tempVec      = partnerCell.mDMono.transform.localPosition;
            tempCell.mDMono.transform.localPosition = new Vector3(tempVec.x, tempVec.y + 1000, tempVec.z);

            DragPartnerCell.mDMono.gameObject.CustomSetActive(true);
            DragPartnerCell.Fill(partnerData);
            DragPartnerCell.mDMono.transform.position = new Vector3(partnerCell.mDMono.transform.position.x, partnerCell.mDMono.transform.position.y, 0);
            OnDrag();
        }
Esempio n. 4
0
        /// <summary>
        /// 设置伙伴信息
        /// </summary>
        /// <param name="choiceData">伙伴数据</param>
        /// <param name="playerInfo">玩家信息</param>
        /// <param name="isBan">是否被禁用</param>
        /// <param name="isNeedSetFx">是否需要设置特效</param>
        public void F_SetCardInfo(HeroBattleChoiceCellData choiceData, SidePlayerInfoData playerInfo, bool isBan, bool isNeedSetFx)
        {
            m_ChoiceData = choiceData;
            LTPartnerData data = null;

            m_LockState.CustomSetActive(isBan);
            m_SelectLockState.CustomSetActive(false);
            if (choiceData != null)
            {
                data          = new LTPartnerData();
                data.StatId   = 0;
                data.InfoId   = choiceData.heroTplID;
                data.HeroStat = null;
                int characterId = choiceData.heroTplID;
                //判断当前的数据是否为机器人
                if (playerInfo.uid == 0)
                {
                    Hotfix_LT.Data.MonsterInfoTemplate monster = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetMonsterInfo(choiceData.heroTplID);
                    if (monster != null)
                    {
                        characterId = int.Parse(monster.character_id);
                    }
                    else
                    {
                        EB.Debug.LogError("为什么输入的choiceData.heroTplID:{0},没有相应的怪物数据", choiceData.heroTplID);
                    }
                }
                else
                {
                    characterId -= 1;
                }
                //模型皮肤
                data.HeroInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(characterId, choiceData.skin);
                //不能为零
                data.mHeroId = 1;
                //修改这里来调整UI的表现
                data.IsHire            = true;
                data.HireHeroId        = 1;
                data.HireLevel         = choiceData.level;
                data.HireAllRoundLevel = choiceData.peak;
                data.HireArtifactLevel = choiceData.artifactLevel;
                data.HireUpGradeId     = choiceData.upGrade;
                data.HireStar          = choiceData.star;
                //觉醒
                data.HireAwakeLevel = choiceData.isAwake;
                //设置卡片时的特效
                if (isNeedSetFx)
                {
                    EB.Coroutines.Run(SetCardFx());
                }
            }
            m_Card.Fill(data);
        }