Beispiel #1
0
    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);
            }
        }
    }
Beispiel #2
0
    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);
    }
Beispiel #3
0
    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);
    }
Beispiel #4
0
    void OnScrollEndDrag(PointerEventData eventData, UI_Event ev)
    {
        Transform Obj = ev.GetData <Transform>("T");

        Obj.GetComponentInChildren <ScrollRect>().OnEndDrag(eventData);
        StartCoroutine(DelayResetBtn(0.8f, ev));
    }
Beispiel #5
0
    void OnScrollBeginDrag(PointerEventData eventData, UI_Event ev)
    {
        Transform Obj = ev.GetData <Transform>("T");

        Obj.GetComponentInChildren <ScrollRect>().OnBeginDrag(eventData);
        ev.DisableClick = true;
    }
Beispiel #6
0
    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);
    }
Beispiel #7
0
    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);
    }
Beispiel #8
0
    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);
    }
Beispiel #9
0
    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);
    }
Beispiel #10
0
    ///////////////// button
    void BtnItemOnBeginDrag(PointerEventData eventData, UI_Event ev)
    {
        mScrollRect.OnBeginDrag(eventData);
        int drag = ev.GetData <int>("drag");

        if (drag <= 0)
        {
            return;
        }

        mDragDownPosition = eventData.position;
    }
Beispiel #11
0
    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);
    }
Beispiel #12
0
    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);
    }