コード例 #1
0
        public void AutoSelectSkill(Combat.CombatCharacterSyncData character_data)
        {
            CharacterData = character_data;
            Hide();
            int skillID = 0;

            if (character_data != null && LTCombatHudController.Instance != null && LTCombatHudController.Instance.AutoCombatItems != null)
            {
                AutoCombatItem autoCombatItem = LTCombatHudController.Instance.AutoCombatItems.Find(item => item != null && item.ItemCharSyncData != null && item.ItemCharSyncData.ID == character_data.ID);

                if (autoCombatItem != null && autoCombatItem.IsNormalSkill)
                {
                    skillID = character_data.GetCanUseSkill(autoCombatItem.IsNormalSkill);
                }
            }

            if (_convergeTarget != null && _convergeTarget.GetHP() <= 0)
            {
                SetConvergeTarget(null);
            }

            if (character_data != null)
            {
                CombatManager.Instance.SetSkill(character_data.ID, 0, Combat.CombatSyncData.Instance.CombatId, _myTeam,
                                                CharacterData.IngameId,
                                                skillID == 0 ? -2 : GetSkillIndex(character_data, skillID),
                                                _convergeTarget != null ? _convergeTarget.Data.IngameId : -2);
            }
        }
コード例 #2
0
        public void ShowSkill(Combat.CombatCharacterSyncData character_data)
        {
            isShow = true;
            if (character_data.Uid != LoginManager.Instance.LocalUserId.Value)
            {
                return;
            }
            CharacterData = character_data;
            int realSkillCount = 0;
            var emr            = character_data.SkillDataList.Values.GetEnumerator();

            while (emr.MoveNext())
            {
                Combat.CombatCharacterSyncData.SkillData skilldata = emr.Current;
                if (skilldata.SkillType != (int)Data.eSkillType.NORMAL && skilldata.SkillType != (int)Data.eSkillType.PASSIVE && skilldata.SkillType != (int)Data.eSkillType.ACTIVE)
                {
                    continue;
                }
                realSkillCount++;
                int             skillDataIndex = skilldata.Index;
                CombatSkillItem skillItem      = null;
                if (skillDataIndex < mDMono.transform.childCount)
                {
                    skillItem = mDMono.transform.GetChild(skillDataIndex).GetMonoILRComponent <CombatSkillItem>();
                }
                if (skillItem == null)
                {
                    var go = GameObject.Instantiate(SkillItemTemplate.mDMono.gameObject) as GameObject;
                    go.name = "Clone";
                    go.transform.SetParent(mDMono.transform, false);
                    go.SetActive(true);
                    skillItem = go.GetMonoILRComponent <CombatSkillItem>();
                }
                if (skilldata != null)
                {
                    skillItem.mDMono.name = ((Data.eSkillType)skilldata.SkillType).ToString() + skillDataIndex;
                    skillItem.Fill(skilldata, skilldata.SkillType == (int)Data.eSkillType.NORMAL);
                }
                else
                {
                    EB.Debug.LogError("skillData is null");
                }
            }
            if (SceneLogic.BattleType == eBattleType.ChallengeCampaign || SceneLogic.BattleType == eBattleType.AlienMazeBattle)
            {
                realSkillCount++;
                if (!_hasSetBagSpace)
                {
                    _hasSetBagSpace = true;
                    mDMono.transform.localPosition -= new Vector3(SkillItemGrid.cellWidth, 0, 0);
                }
                BagBtn.gameObject.CustomSetActive(true);
                BagShadow.gameObject.CustomSetActive(CharacterData.ScrollTimes > 0);
            }
            SkillBGSprite.width = (779 - (4 - realSkillCount) * 162);
            SkillBGSprite.gameObject.CustomSetActive(true);

            for (int excessIndex = realSkillCount; ++excessIndex < mDMono.transform.childCount; ++excessIndex)
            {
                mDMono.transform.GetChild(excessIndex).gameObject.CustomSetActive(false);
            }
            SkillItemGrid.Reposition();

            if (character_data.NormalSkillData != null)
            {
                SetTargetingInfo(character_data.NormalSkillData.ID, _COMMON_TYPE);
            }
            else
            {
                EB.Debug.LogError("Not Found NormalSkill For Character:" + character_data);
            }
        }