| | |
| | | [SerializeField] Button m_Button;
|
| | | [SerializeField] UIEffect m_PotentialSfx;
|
| | | [SerializeField] Image m_Select;
|
| | | [SerializeField] Image m_Icon;
|
| | | //[SerializeField] ScaleTween m_SelectScale;
|
| | |
|
| | | public TreasurePotential potential { get; private set; }
|
| | |
| | | }
|
| | | m_Level.text = _unlock ? StringUtility.Contact(_potential.level, "/", maxLevel) : string.Empty;
|
| | | m_Level.transform.localScale = Vector3.one;
|
| | | m_PotentialName.text = config.SkillName;// _unlock ? config.SkillName : string.Empty;
|
| | |
|
| | | DisplayName(_unlock, config);
|
| | |
|
| | | model.potentialLevelChangeEvent -= OnPotentialLevelUp;
|
| | | model.potentialLevelChangeEvent += OnPotentialLevelUp;
|
| | |
| | | bool _unlock = potential != null && model.IsPotentialUnlock(model.selectedTreasure, potential.id);
|
| | | m_Level.text = _unlock ? StringUtility.Contact(potential.level, "/", maxLevel) : string.Empty;
|
| | | m_Level.transform.localScale = Vector3.one;
|
| | | m_PotentialName.text = config.SkillName;// _unlock ? config.SkillName : string.Empty;
|
| | | DisplayName(_unlock, config);
|
| | | }
|
| | |
|
| | | void DisplayName(bool unlock, SkillConfig config)
|
| | | {
|
| | | m_PotentialName.text = config.SkillName;
|
| | | m_PotentialName.color = UIHelper.GetUIColor(TextColType.LightYellow);
|
| | | if (!unlock)
|
| | | {
|
| | | var requirement = string.Empty;
|
| | | if (config.LearnSkillReq > 0 && config.LearnSkillLV > 0)
|
| | | {
|
| | | var preskillConfig = Config.Instance.Get<SkillConfig>(config.LearnSkillReq);
|
| | | requirement = Language.Get("Hallows_NeedSkillLVStart", preskillConfig.SkillName, config.LearnSkillLV);
|
| | | m_PotentialName.text = requirement;
|
| | | m_PotentialName.color = UIHelper.GetUIColor(TextColType.Red);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void OnPotentialSelected(int _potentialId)
|
| | | {
|
| | | //m_SelectScale.SetEndState();
|
| | | m_Select.gameObject.SetActive(_potentialId == potential.id);
|
| | | }
|
| | |
|
| | | //public void DisplaySelectSfxScale()
|
| | | //{
|
| | | // m_SelectScale.Play();
|
| | | //}
|
| | |
|
| | | private void OnPotentialLevelUp(int _treasureId, int _potential)
|
| | | {
|
| | |
| | | m_PotentialSfx.loop = true;
|
| | | m_DeadPotentailTween.enabled = false;
|
| | | m_DeadPotentailTween.SetStartState();
|
| | | m_Icon.material = MaterialUtility.GetUIDefaultGraphicMaterial();
|
| | | switch (_state)
|
| | | {
|
| | | case 0:
|
| | | m_DeadPotentailTween.enabled = true;
|
| | | m_Icon.material = MaterialUtility.GetDefaultSpriteGrayMaterial();
|
| | | break;
|
| | | case 1:
|
| | | m_PotentialSfx.effect = 5128;
|