protected override void OnOpen(object param = null) { mCurPage = mTabs[0]; scrollList[0].ResetPosition(); if (mQuestData.mMainQuest.Count > 0) { mCurPage.mCurShowId = mModule.CurShowIndex = mQuestData.mMainQuest[0].mId; } toggleOne.value = true; if (param != null) { int id = (int)param; Quest quest = mModule.GetQuestById(id); if (quest != null && quest.mType == 2) { mCurPage = mTabs[2]; toggleThree.value = true; toggleOne.value = false; } mCurPage.mCurShowId = mModule.CurShowIndex = id; } IsDirty = true; EventDelegate.Add(toggleOne.onChange, OnTabOne); EventDelegate.Add(toggleTwo.onChange, OnTabTwo); EventDelegate.Add(toggleThree.onChange, OnTabThree); EventDelegate.Add(TodoBtn.onClick, OnTodo); EventDelegate.Add(GoToBtn.onClick, OnTodo); EventSystem.Instance.addEventListener(QuestEvent.QUEST_ACCEPT, OnAccetped); EventSystem.Instance.addEventListener(FinishQuestEvent.QUEST_FINISHED, OnFinshed); EventSystem.Instance.addEventListener(QuestEvent.QUEST_UPDATE, OnUpdateQuest); }
public void OnTabThree() { if (!UIToggle.current.value) { return; } mCurPage = mTabs[2]; IsDirty = true; SoundManager.Instance.Play(5); }