| | |
| | | [SerializeField] UIEffect m_SoulEffect;
|
| | | [SerializeField] Button m_Active;
|
| | | [SerializeField] Text m_ActiveText;
|
| | | [SerializeField] Button m_GotoRealm;
|
| | |
|
| | | [SerializeField] List<TreasureSoulPattern> m_TreasureSouls;
|
| | |
|
| | |
| | | [SerializeField] RectTransform m_ContainerPreview;
|
| | | [SerializeField] Text m_PreviewTitle;
|
| | | [SerializeField] List<PropertyBehaviour> m_PreviewPropretys;
|
| | |
|
| | | [SerializeField] RectTransform m_ContainerCondition;
|
| | | [SerializeField] ScrollerController m_ConditonControl;
|
| | |
|
| | | TreasureSoulModel m_Model;
|
| | | TreasureSoulModel model
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | AchievementModel achievementModel
|
| | | TreasureModel treasureModel
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<AchievementModel>(); }
|
| | | get { return ModelCenter.Instance.GetModel<TreasureModel>(); }
|
| | | }
|
| | |
|
| | |
|
| | |
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Active.onClick.AddListener(Active);
|
| | | m_GotoRealm.onClick.AddListener(GotoRealm);
|
| | | m_CloseBtn.onClick.AddListener(CloseClick);
|
| | | m_ScollerControl.OnRefreshCell += OnRefreshCell;
|
| | | m_ConditonControl.OnRefreshCell += OnRefreshConditionCell;
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | |
| | | model.treasureSelectSoulChangeEvent += TreasureSelectSoulChangeEvent;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
|
| | | model.treasureSoulEvent += TreasureSoulEvent;
|
| | | achievementModel.achievementCompletedEvent += AchievementCompletedEvent;
|
| | | m_TreasureSoulBtn.state = TitleBtnState.Click;
|
| | | Display();
|
| | | }
|
| | |
| | | model.treasureSelectSoulChangeEvent -= TreasureSelectSoulChangeEvent;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerDataRefreshInfoEvent;
|
| | | model.treasureSoulEvent -= TreasureSoulEvent;
|
| | | achievementModel.achievementCompletedEvent -= AchievementCompletedEvent;
|
| | | for (int i = 0; i < m_TreasureSouls.Count; i++)
|
| | | {
|
| | | m_TreasureSouls[i].Dispose();
|
| | |
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | private void AchievementCompletedEvent(int _id)
|
| | | {
|
| | | List<int> list;
|
| | | if (model.TryGetAchievements(model.selectSoul, out list) && list.Contains(_id))
|
| | | {
|
| | | DisplaySelect();
|
| | | }
|
| | | }
|
| | |
|
| | | private void Display()
|
| | | {
|
| | |
| | |
|
| | | private void Active()
|
| | | {
|
| | | model.ActiveTreasureSoul(model.selectSoul);
|
| | | }
|
| | |
|
| | | private void GotoRealm()
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.RealmFunc1);
|
| | | var config = Config.Instance.Get<TreasurePrivilegeConfig>(model.selectSoul);
|
| | | treasureModel.selectedTreasure = config.treasureId;
|
| | | treasureModel.currentCategory = TreasureCategory.Human;
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.TreasureCollectSoul);
|
| | | }
|
| | |
|
| | | private void DisplaySelect()
|
| | | {
|
| | | TreasureSpecialData special;
|
| | | model.TryGetTreasureSoul(model.selectSoul, out special);
|
| | | m_ContainerCondition.gameObject.SetActive(false);
|
| | | if (special != null)
|
| | | {
|
| | | var config = Config.Instance.Get<TreasurePrivilegeConfig>((int)special.type);
|
| | |
| | | m_SelectSoulImg.material = special.active ? MaterialUtility.GetUIDefaultGraphicMaterial() : MaterialUtility.GetDefaultSpriteGrayMaterial();
|
| | | m_SelectSoulImg.SetNativeSize();
|
| | |
|
| | | if (special.active)
|
| | | {
|
| | | m_Active.gameObject.SetActive(false);
|
| | | m_GotoRealm.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!model.IsCompleteLockAchievement(model.selectSoul))
|
| | | {
|
| | | m_Active.gameObject.SetActive(false);
|
| | | m_GotoRealm.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Active.gameObject.SetActive(true);
|
| | | m_GotoRealm.gameObject.SetActive(false);
|
| | | m_Active.SetInteractable(m_ActiveText, model.IsCompleteAllAchievement(model.selectSoul));
|
| | | m_ContainerCondition.gameObject.SetActive(true);
|
| | | DisplayCondition();
|
| | | }
|
| | | }
|
| | | m_Active.gameObject.SetActive(!special.active);
|
| | |
|
| | | m_ContainerPreview.gameObject.SetActive(!special.active);
|
| | | m_SoulEffect.StopImediatly();
|
| | | if (!special.active)
|
| | |
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | private void DisplayCondition()
|
| | | {
|
| | | m_ContainerCondition.gameObject.SetActive(true);
|
| | | List<int> list;
|
| | | model.TryGetAchievements(model.selectSoul, out list);
|
| | | m_ConditonControl.Refresh();
|
| | | if (list != null)
|
| | | {
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | var config = Config.Instance.Get<SuccessConfig>(list[i]);
|
| | | if (config != null && config.Type == 1)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | m_ConditonControl.AddCell(ScrollerDataType.Header, list[i]);
|
| | | }
|
| | | }
|
| | | m_ConditonControl.Restart();
|
| | | }
|
| | |
|
| | | private void OnRefreshConditionCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | var _cell = cell as TreasureSoulAchievementCell;
|
| | | _cell.Display(cell.index);
|
| | | }
|
| | |
|
| | | int Compare(int x, int y)
|