void BtnItemOnEndDrag(PointerEventData eventData, UI_Event ev) { mScrollRect.OnEndDrag(eventData); int drag = ev.GetData <int>("drag"); if (drag <= 0) { return; } Mission mis = ev.GetData <Mission>("d"); Vector2 drag_dis = eventData.position - mDragDownPosition; if (Mathf.Abs(drag_dis.x) > EDIT_DRAG_DISTANCE && Mathf.Abs(drag_dis.x) > Mathf.Abs(drag_dis.y)) { if (drag_dis.x < 0) { OpenEditButton(mis); } else { CloseEditButton(mis); } } }
void BtnMissionCancelOnClick(PointerEventData eventData, UI_Event ev) { int type = ev.GetData <int>("t"); Mission mis = ev.GetData <Mission>("d"); if (type == 1) { mis.mDateTime = TimeConvert.GetNow(); } else if (type == 3) { mis.mDateTime = TimeConvert.GetNow(); mis.mFinished = 0; mis.mCount--; StatisticsManager.instance.RemoveLog(mis.mLog); StatisticsManager.instance.Save(); mis.mLog = null; } MissionManager.instance.Save(); List <Mission> lst_mis = MissionManager.instance.GetDailyMission(); float _pos = mContent.transform.localPosition.y; ShowMission(lst_mis); MoveScrollTo(_pos); }
void BtnMissionFinishOnClick(PointerEventData eventData, UI_Event ev) { int type = ev.GetData <int>("t"); Mission mis = ev.GetData <Mission>("d"); if (type == 1) { mis.mDateTime = TimeConvert.GetNow(); mis.mCount++; } else if (type == 2) { mis.mDateTime = TimeConvert.GetTommorrow(); mis.mFinished = TimeConvert.NowDay(); mis.mCount++; } mis.mLog = StatisticsManager.instance.AddLog(mis.mId, mis.mDesc); StatisticsManager.instance.Save(); MissionManager.instance.Save(); List <Mission> lst_mis = MissionManager.instance.GetDailyMission(); float _pos = mContent.transform.localPosition.y; ShowMission(lst_mis); MoveScrollTo(_pos); }
void OnScrollEndDrag(PointerEventData eventData, UI_Event ev) { Transform Obj = ev.GetData <Transform>("T"); Obj.GetComponentInChildren <ScrollRect>().OnEndDrag(eventData); StartCoroutine(DelayResetBtn(0.8f, ev)); }
void OnScrollBeginDrag(PointerEventData eventData, UI_Event ev) { Transform Obj = ev.GetData <Transform>("T"); Obj.GetComponentInChildren <ScrollRect>().OnBeginDrag(eventData); ev.DisableClick = true; }
void BtnMissionCancelOnClick(PointerEventData eventData, UI_Event ev) { int type = ev.GetData <int>("t"); Mission mis = ev.GetData <Mission>("d"); if (type == 1) { mis.mDateTime = TimeConvert.GetNow(); } else if (type == 3) { mis.mFinished = 0; } List <Mission> lst_mis = MissionManager.instance.GetDailyMission(); ShowMission(lst_mis); }
void BtnMissionEditorOnClick(PointerEventData eventData, UI_Event ev) { Mission mis = ev.GetData <Mission>("d"); UIMissionEditor ui_editor = MenuManager.instance.CreateMenu <UIMissionEditor>(); ui_editor.OpenScreen(); ui_editor.mIsEdit = true; ui_editor.SetEditMission(mis); }
void BtnMissionDeleteOnClick(PointerEventData eventData, UI_Event ev) { Mission mis = ev.GetData <Mission>("d"); MissionManager.instance.RemoveMission(mis); List <Mission> lst_mis = MissionManager.instance.GetDailyMission(); ShowMission(lst_mis); }
void BtnMissionFinishOnClick(PointerEventData eventData, UI_Event ev) { Mission mis = ev.GetData <Mission>("d"); //mis.mDateTime = DateTime.Now; mis.mFinished = TimeConvert.NowDay(); List <Mission> lst_mis = MissionManager.instance.GetDailyMission(); ShowMission(lst_mis); }
///////////////// button void BtnItemOnBeginDrag(PointerEventData eventData, UI_Event ev) { mScrollRect.OnBeginDrag(eventData); int drag = ev.GetData <int>("drag"); if (drag <= 0) { return; } mDragDownPosition = eventData.position; }
void BtnMissionDeleteOnClick(PointerEventData eventData, UI_Event ev) { Mission mis = ev.GetData <Mission>("d"); MissionManager.instance.RemoveMission(mis); MissionManager.instance.Save(); List <Mission> lst_mis = MissionManager.instance.GetDailyMission(); float _pos = mContent.transform.localPosition.y; ShowMission(lst_mis); MoveScrollTo(_pos); }
void BtnSelectOnClick(PointerEventData eventData, UI_Event ev) { Mission mis = ev.GetData <Mission>("d"); Mission select_mission = new Mission(); if (mIsEdit) { select_mission.mId = mMission.mId; } else { select_mission.mId = MissionManager.instance.MaxID++; } select_mission.mTextureName = mis.mTextureName; select_mission.mDesc = mis.mDesc; SetEditMission(select_mission); }