| | |
| | |
|
| | | [SerializeField] float m_AutoSelectOffset = 62f;
|
| | | [SerializeField] ScrollRect m_Scroller;
|
| | | [SerializeField] TalentSkillBehaviour[] m_TalentSkills;
|
| | | [SerializeField] Image[] m_Arrows;
|
| | | [SerializeField] List<TalentSkillBehaviour> m_TalentSkills;
|
| | | [SerializeField] List<Image> m_Arrows;
|
| | |
|
| | | [SerializeField] RectTransform m_ContainerSelectSkill;
|
| | | [SerializeField] Image m_SelectSkillIcon;
|
| | |
| | | #if UNITY_EDITOR
|
| | | [SerializeField] TalentTreeScriptable m_EditorScriptable;
|
| | | [SerializeField] bool m_EditorMode;
|
| | | [SerializeField] string m_StraightArrowName;
|
| | | [SerializeField] string m_TurnArrowName;
|
| | | #endif
|
| | |
|
| | | TalentModel model { get { return ModelCenter.Instance.GetModel<TalentModel>(); } }
|
| | |
| | | {
|
| | | m_TalentSeries[i].Dispose();
|
| | | }
|
| | | for (int i = 0; i < m_TalentSkills.Length; i++)
|
| | | for (int i = 0; i < m_TalentSkills.Count; i++)
|
| | | {
|
| | | m_TalentSkills[i].Dispose();
|
| | | }
|
| | |
| | | var skillRect = m_TalentSkills[0].transform as RectTransform;
|
| | | m_Scroller.verticalNormalizedPosition = selectScriptable.GetPercentBySkillElement(index, rect.sizeDelta.y, m_AutoSelectOffset);
|
| | | }
|
| | | for (int i = 0; i < m_TalentSkills.Length; i++)
|
| | | for (int i = 0; i < m_TalentSkills.Count; i++)
|
| | | {
|
| | | if (talents != null && i < talents.Count)
|
| | | {
|
| | |
| | | void DisplayTalentLayout(TalentTreeScriptable config)
|
| | | {
|
| | | m_Scroller.content.sizeDelta = config.contentSizeDelta;
|
| | | for (int i = 0; i < m_TalentSkills.Length; i++)
|
| | | for (int i = 0; i < config.skillCount; i++)
|
| | | {
|
| | | var element = config.GetTalentElement(i);
|
| | | m_TalentSkills[i].transform.localPosition = element.position;
|
| | | }
|
| | | if (m_Arrows != null)
|
| | | {
|
| | | for (int i = 0; i < m_Arrows.Length; i++)
|
| | | if (i < m_TalentSkills.Count)
|
| | | {
|
| | | var element = config.GetArrowElement(i);
|
| | | m_Arrows[i].transform.localPosition = element.position;
|
| | | m_Arrows[i].rectTransform.sizeDelta = element.sizeDelta;
|
| | | m_TalentSkills[i].transform.localPosition = element.position;
|
| | | }
|
| | | }
|
| | | var index = 0;
|
| | | for (int i = 0; i < config.arrowCount; i++)
|
| | | {
|
| | | var element = config.GetArrowElement(i);
|
| | | if (i < m_Arrows.Count)
|
| | | {
|
| | | var arrow = m_Arrows[i];
|
| | | arrow.gameObject.SetActive(true);
|
| | | arrow.transform.localPosition = element.position;
|
| | | arrow.transform.localEulerAngles = element.rotation;
|
| | | arrow.rectTransform.sizeDelta = element.sizeDelta;
|
| | | arrow.SetSprite(element.iconKey);
|
| | | index++;
|
| | | }
|
| | | }
|
| | | for (int i = index; i < m_Arrows.Count; i++)
|
| | | {
|
| | | m_Arrows[i].gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | | var count = 0;
|
| | | for (int i = 0; i < m_TalentSkills.Length; i++)
|
| | | for (int i = 0; i < m_TalentSkills.Count; i++)
|
| | | {
|
| | | if (m_TalentSkills[i].gameObject.activeSelf)
|
| | | {
|
| | |
| | | count = 0;
|
| | | if (m_Arrows != null)
|
| | | {
|
| | | for (int i = 0; i < m_Arrows.Length; i++)
|
| | | for (int i = 0; i < m_Arrows.Count; i++)
|
| | | {
|
| | | if (m_Arrows[i].gameObject.activeSelf)
|
| | | {
|
| | | m_EditorScriptable.ApplyArrowElement(count, m_Arrows[i].transform.localPosition,
|
| | | m_Arrows[i].rectTransform.sizeDelta);
|
| | | m_Arrows[i].rectTransform.sizeDelta, m_Arrows[i].transform.localEulerAngles,
|
| | | m_Arrows[i].sprite.name.Equals(m_StraightArrowName) ? "Talent_StraightArrow" : "Talent_TurnArrow");
|
| | | count++;
|
| | | }
|
| | | }
|