| | |
| | | [SerializeField] Button m_TalentTypeSelect;
|
| | | [SerializeField] Text m_TalentType;
|
| | |
|
| | | [SerializeField] ScrollRect m_Scroller;
|
| | | [SerializeField] TalentSkillBehaviour[] m_TalentSkills;
|
| | | [SerializeField] Image[] m_Arrows;
|
| | |
|
| | |
| | | [SerializeField] Button m_AddPoint;
|
| | | [SerializeField] Text m_AddPointBtnText;
|
| | | [SerializeField] Text m_SurplusPoint;
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | [SerializeField] TalentTreeScriptable m_EditorScriptable;
|
| | | #endif
|
| | |
|
| | | TalentModel model { get { return ModelCenter.Instance.GetModel<TalentModel>(); } }
|
| | | #region Built-in
|
| | |
| | | {
|
| | | m_TalentSeries[i].Dispose();
|
| | | }
|
| | |
|
| | | #if UNITY_EDITOR
|
| | | if (m_EditorScriptable != null)
|
| | | {
|
| | | m_EditorScriptable = null;
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | |
|
| | | protected override void LateUpdate()
|
| | | {
|
| | | base.LateUpdate();
|
| | | #if UNITY_EDITOR
|
| | | if (m_EditorScriptable != null)
|
| | | {
|
| | | DisplayTalentLayout(m_EditorScriptable);
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | | void Display()
|
| | | {
|
| | |
| | | var skillConfig = Config.Instance.Get<SkillConfig>(talent.skillId + talent.level);
|
| | | if (talentConfig != null)
|
| | | {
|
| | | if (talentConfig.property != 0 && index < m_SelectConditions.Length)
|
| | | {
|
| | | var propertyConfig = Config.Instance.Get<PlayerPropertyConfig>(talentConfig.property);
|
| | | m_SelectConditions[index].gameObject.SetActive(true);
|
| | | m_SelectConditions[index].text = StringUtility.Contact(
|
| | | string.Format("需要{0}点:", propertyConfig.Name),
|
| | | UIHelper.GetPropertyMapPlayerData((AttrEnum)talentConfig.property),
|
| | | "/", talentConfig.propertyValue
|
| | | );
|
| | | index++;
|
| | | }
|
| | | if (talentConfig.seriesCondition != 0 && index < m_SelectConditions.Length)
|
| | | if (talentConfig.requireSeriesPoint != 0 && index < m_SelectConditions.Length)
|
| | | {
|
| | | m_SelectConditions[index].gameObject.SetActive(true);
|
| | | m_SelectConditions[index].text = StringUtility.Contact(0, "/", talentConfig.point);
|
| | | m_SelectConditions[index].text = StringUtility.Contact(0, "/", talentConfig.requireSeriesPoint);
|
| | | index++;
|
| | | }
|
| | | }
|
| | |
| | | m_ContainerSelectSkill.gameObject.SetActive(true);
|
| | | var config = Config.Instance.Get<SkillConfig>(talent.skillId + talent.level);
|
| | | m_SelectSkillIcon.SetSprite(config.IconName);
|
| | | m_SelectSkillLevel.text = StringUtility.Contact(talent.level, "/", talent.max);
|
| | | m_SelectSkillLevel.text = StringUtility.Contact(talent.level, "/", talent.maxLevel);
|
| | | m_SelectSkillName.text = config.SkillName;
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | var config = Config.Instance.Get<SkillConfig>(talent.skillId + talent.level);
|
| | | m_SelectSkillEffect.text = config.Description;
|
| | | m_ContainerNextEffect.gameObject.SetActive(talent.level < talent.max);
|
| | | if (talent.level < talent.max)
|
| | | m_ContainerNextEffect.gameObject.SetActive(talent.level < talent.maxLevel);
|
| | | if (talent.level < talent.maxLevel)
|
| | | {
|
| | | var nextConfig = Config.Instance.Get<SkillConfig>(talent.skillId + talent.level + 1);
|
| | | m_SelectNextEffect.text = nextConfig.Description;
|
| | |
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | void DisplayTalentLayout(TalentTreeScriptable config)
|
| | | {
|
| | | m_Scroller.content.sizeDelta = config.contentSizeDelta;
|
| | | for (int i = 0; i < m_TalentSkills.Length; i++)
|
| | | {
|
| | | var element = config.GetTalentElement(i);
|
| | | m_TalentSkills[i].transform.localPosition = element.position;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|