private void OnClickSkillIcon(bool bActiveSkill) { if (petData == null) { return; } skillData = bActiveSkill ? petData.GetActiveSkill() : petData.GetPassiveSkill(); if (skillData == null) { return; } SoundManager.GetInstance().PlaySound(Define.SoundType.Click); SkillInfoPopup popup = PopupSystem.GetPopup <SkillInfoPopup>(Define.PopupType.SkillInfo); popup.SetData(petData, skillData, UpgradeSkill); PopupSystem.OpenPopup(Define.PopupType.SkillInfo); }
public override void BeforeOpen() { characterImage.spriteName = petData.GetOnGameImage(); characterOutline.spriteName = petData.GetPopupOutline(); characterImage.MakePixelPerfect(); characterOutline.MakePixelPerfect(); bool bActiveSkill = (petData.activeSkillType == skillData.skillType); Define.SkillType skillType = bActiveSkill ? petData.activeSkillType : petData.passiveSkillType; int skillLv = bActiveSkill ? petData.aSkillLv : petData.pSkillLv; bool noCooltime = !bActiveSkill; bool noValue = bActiveSkill ? petData.GetActiveSkill().GetSkillValue(skillLv) == Define.nullValue : petData.GetPassiveSkill().GetSkillValue(skillLv) == Define.nullValue; skillIcon.spriteName = skillData.skillIcon; skillInfoLable.text = SkillManager.GetInstance().GetSkillInfo(skillType, skillLv); //구매하기 전의 동물의 스킬. // if (!DataManager.GetInstance().IsInHasPetDataList(petData.unqIdx)) { maxLevelPanel.SetActive(true); notMaxLevelPanel.SetActive(false); bottomGuideLabel.text = DataManager.GetText(TextTable.adoptLevelKey); SettingUI(maxSkill, noCooltime, noValue, skillLv); } //최대 레벨. // else if (skillData.IsMaxLevel(skillLv)) { maxLevelPanel.SetActive(true); notMaxLevelPanel.SetActive(false); bottomGuideLabel.text = DataManager.GetText(TextTable.maxLevelKey); SettingUI(maxSkill, noCooltime, noValue, skillLv); } //스킬 업그레이드 불가. // else if (skillLv >= petData.level) { maxLevelPanel.SetActive(false); notMaxLevelPanel.SetActive(true); SettingUI(nowSkill, noCooltime, noValue, skillLv); SettingUI(nextSkill, noCooltime, noValue, skillLv + 1); notUpgradePanel.SetActive(true); upgradeBtn.SetActive(false); notUpgradeLabel.text = string.Format(DataManager.GetText(TextTable.cantUpgradeKey), petData.GetName(), skillLv + 2); Vector3 pos = coinLabelBody.localPosition; pos.x = 32 - coinLabel.width; coinLabelBody.localPosition = pos; pos = coinIcon.localPosition; pos.x = 24 - coinLabel.width; coinIcon.localPosition = pos; } //스킬 업그레이드 가능. // else { maxLevelPanel.SetActive(false); notMaxLevelPanel.SetActive(true); SettingUI(nowSkill, noCooltime, noValue, skillLv); SettingUI(nextSkill, noCooltime, noValue, skillLv + 1); notUpgradePanel.SetActive(false); upgradeBtn.SetActive(true); upgradeLabel.text = DataManager.GetText(TextTable.upgradeBtnKey); coinLabel.text = skillData.GetSkillCost(skillLv).ToString(); Vector3 pos = coinLabelBody.localPosition; pos.x = 32 - coinLabel.width; coinLabelBody.localPosition = pos; pos = coinIcon.localPosition; pos.x = 24 - coinLabel.width; coinIcon.localPosition = pos; } }