| | |
| | | [SerializeField] Text m_SkillName;
|
| | | [SerializeField] Image m_ReikiIcon;
|
| | | [SerializeField] Text m_ReikiPoint;
|
| | | [SerializeField] Transform m_ContainerReikiIcon;
|
| | | [SerializeField] Image[] m_ReikiIcons;
|
| | | [SerializeField] FunctionUnlockFlyObjectTarget m_FlyTarget;
|
| | | [SerializeField] Image m_SkillIconSelect;
|
| | | [SerializeField] ExpertSkillCyclicScroll m_CyclicScroll;
|
| | | [SerializeField] LayoutElement m_LayoutElement;
|
| | | [SerializeField] Button m_Active;
|
| | | [SerializeField] Text m_ActiveLabel;
|
| | | [SerializeField] UIEffect m_ActiveEffect;
|
| | | [SerializeField] Button m_Select;
|
| | | [SerializeField] UIEffect m_SelectEffect;
|
| | | //[SerializeField] Button m_Select;
|
| | | //[SerializeField] UIEffect m_SelectEffect;
|
| | | [SerializeField] Button m_Close1;
|
| | | [SerializeField] Button m_Close2;
|
| | |
|
| | |
| | |
|
| | | List<int> datas = new List<int>();
|
| | |
|
| | | FunctionUnlockFlyObject flyObject = null;
|
| | |
|
| | | bool flying = false;
|
| | |
|
| | | TreasureSkillModel model { get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | |
| | | protected override void AddListeners()
|
| | | {
|
| | | //m_Controller.OnRefreshCell += OnRefreshCell;
|
| | | m_Select.AddListener(OnSelect);
|
| | | //m_Select.AddListener(OnSelect);
|
| | | m_Close1.AddListener(CloseClick);
|
| | | m_Close2.AddListener(CloseClick);
|
| | | m_Active.AddListener(OnActiveSkill);
|
| | |
| | |
|
| | | m_CyclicScroll.enabled = false;
|
| | |
|
| | | if (flyObject != null)
|
| | | {
|
| | | GameObject.Destroy(flyObject);
|
| | | flyObject = null;
|
| | | }
|
| | |
|
| | | flying = false;
|
| | |
|
| | | Display();
|
| | |
|
| | | model.expertActiveRefresh += ExpertActiveRefresh;
|
| | | model.expertSkillRefresh += ExpertSkillRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | StopAllCoroutines();
|
| | |
|
| | | model.expertActiveRefresh -= ExpertActiveRefresh;
|
| | | model.expertSkillRefresh -= ExpertSkillRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | DisplayExperts();
|
| | | DisplaySelect();
|
| | | DisplayDetail();
|
| | | DisplaySelectReiki();
|
| | | }
|
| | |
|
| | | void SetDefaultSelect()
|
| | |
| | |
|
| | | var used = selectExpertSkill == selectExpert;
|
| | |
|
| | | m_SelectEffect.StopImediatly();
|
| | | //m_SelectEffect.StopImediatly();
|
| | |
|
| | | TreasurePotential expert;
|
| | | if (model.TryGetPotential(selectExpert, out expert))
|
| | |
| | | var satisfyActive = model.SatisfyActiveExpert(selectExpert, out error);
|
| | | var activeLevel = 0;
|
| | | model.TryGetExpertActiveLevel(selectExpert, out activeLevel);
|
| | | m_Select.gameObject.SetActive(activeLevel > 0 && !satisfyActive && !used);
|
| | | //m_Select.gameObject.SetActive(activeLevel > 0 && !satisfyActive && !used);
|
| | | m_Active.gameObject.SetActive(satisfyActive || error == 3);
|
| | |
|
| | | if (m_Select.gameObject.activeSelf)
|
| | | {
|
| | | if (selectExpertSkill == 0)
|
| | | {
|
| | | m_SelectEffect.Play();
|
| | | }
|
| | | }
|
| | | //if (m_Select.gameObject.activeSelf)
|
| | | //{
|
| | | // if (selectExpertSkill == 0)
|
| | | // {
|
| | | // m_SelectEffect.Play();
|
| | | // }
|
| | | //}
|
| | |
|
| | | //m_Active.SetColorful(m_ActiveLabel, satisfyActive);
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | void DisplaySelectReiki()
|
| | | {
|
| | | var selectExpertSkill = 0;
|
| | | model.TryGetExpertSkill(selectSkillId, out selectExpertSkill);
|
| | |
|
| | | m_ContainerReikiIcon.gameObject.SetActive(selectExpertSkill != 0);
|
| | | m_SkillIconSelect.gameObject.SetActive(selectExpertSkill != 0);
|
| | | if (selectExpertSkill != 0)
|
| | | {
|
| | | var skillConfig = SkillConfig.Get(selectExpertSkill);
|
| | |
|
| | | m_SkillIconSelect.SetSprite(skillConfig.IconName);
|
| | |
|
| | | var property = skillConfig.RequireProperty();
|
| | |
|
| | | m_ReikiIcons[0].gameObject.SetActive(property == (int)PropertyType.Mater);
|
| | | m_ReikiIcons[1].gameObject.SetActive(property == (int)PropertyType.Wood);
|
| | | m_ReikiIcons[2].gameObject.SetActive(property == (int)PropertyType.Water);
|
| | | m_ReikiIcons[3].gameObject.SetActive(property == (int)PropertyType.Fire);
|
| | | m_ReikiIcons[4].gameObject.SetActive(property == (int)PropertyType.Earth);
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayAnimation()
|
| | | {
|
| | | m_PositionTween.Play();
|
| | |
| | | {
|
| | | var pak = new CA516_tagCMSelectSkillElement();
|
| | | pak.SkillTypeID = (uint)selectExpert;
|
| | | pak.DoType = 1;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | CloseImmediately();
|
| | |
| | | }
|
| | | var pak = new CA516_tagCMSelectSkillElement();
|
| | | pak.SkillTypeID = (uint)selectExpert;
|
| | | pak.DoType = 0;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | |
|
| | | private void OnSelect(int skillId)
|
| | | {
|
| | | if (m_CyclicScroll.IsPlaying)
|
| | | if (m_CyclicScroll.IsPlaying || flying)
|
| | | {
|
| | | return;
|
| | | }
|
| | | selectExpert = skillId;
|
| | |
|
| | | var level = 0;
|
| | | var selectExpertSkill = 0;
|
| | | if (model.TryGetExpertSkill(selectSkillId, out selectExpertSkill)
|
| | | && selectExpertSkill != selectExpert && model.TryGetExpertActiveLevel(selectExpert, out level)
|
| | | && level > 0)
|
| | | {
|
| | | var pak = new CA516_tagCMSelectSkillElement();
|
| | | pak.SkillTypeID = (uint)selectExpert;
|
| | | pak.DoType = 1;
|
| | | GameNetSystem.Instance.SendInfo(pak);
|
| | | }
|
| | | }
|
| | |
|
| | | private void ExpertActiveRefresh(int id)
|
| | |
| | | {
|
| | | if (level > selectActiveLevel && level > 1)
|
| | | {
|
| | | m_CyclicScroll.DisplayAnimation(()=> |
| | | m_CyclicScroll.DisplayAnimation(() =>
|
| | | {
|
| | | DisplayDetail(true);
|
| | | });
|
| | |
| | | }
|
| | | DisplayButtonState();
|
| | | DisplayExperts();
|
| | | }
|
| | | }
|
| | |
|
| | | private void ExpertSkillRefresh()
|
| | | {
|
| | | var selectExpertSkill = 0;
|
| | | if (model.serverInited && model.TryGetExpertSkill(selectSkillId, out selectExpertSkill)
|
| | | && selectExpertSkill == selectExpert)
|
| | | {
|
| | | if (flyObject != null)
|
| | | {
|
| | | GameObject.Destroy(flyObject);
|
| | | flyObject = null;
|
| | | }
|
| | |
|
| | | Transform parent = null;
|
| | | for (int i = 0; i < m_SkillExperts.Length; i++)
|
| | | {
|
| | | if (m_SkillExperts[i].skillId == selectExpert)
|
| | | {
|
| | | parent = m_SkillExperts[i].flyContainer;
|
| | | }
|
| | | }
|
| | |
|
| | | m_FlyTarget.IdList = new int[1] { selectExpert };
|
| | | FunctionUnlockFlyObjectTargetCenter.Register(FunctionUnlockType.Skill, new int[] { selectExpert }, m_FlyTarget);
|
| | | var instance = UIUtility.CreateWidget("SkillUnlockFlyObject", "SkillUnlockFlyObject");
|
| | | instance.transform.SetParentEx(parent, Vector3.zero, Quaternion.identity, Vector3.one);
|
| | | flyObject = instance.GetComponent<FunctionUnlockFlyObject>();
|
| | | flyObject.SetContent(FunctionUnlockType.Skill, selectExpert);
|
| | |
|
| | | flying = true;
|
| | | flyObject.Begin(() =>
|
| | | {
|
| | | flying = false;
|
| | | DisplaySelectReiki();
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public int skillId { get; private set; }
|
| | |
|
| | | public Transform flyContainer
|
| | | {
|
| | | get { return m_Icon.transform; }
|
| | | }
|
| | |
|
| | | TreasureSkillModel model { get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); } }
|
| | |
|
| | | public void Display(int skillId, bool unlock, Action<int> func)
|