예제 #1
0
    public static EXPLORE_TASK_STATE GetExploreTaskState(tanxianinit data)
    {
        switch (data.tanxiantype)
        {
        case 0:            //未开始;

            return(EXPLORE_TASK_STATE.NotStarted);

        case 1:            //进行中;
            int minutes = GetTaskMinuteToEnd(data);

            //判断是否可以领取奖励;
            if (minutes <= 0)
            {
                //可以领奖;
                return(EXPLORE_TASK_STATE.ExploringOver);
            }
            else
            {
                //不可以领奖;
                return(EXPLORE_TASK_STATE.ExploringNotOver);
            }

        case 2:            //已完成;
            return(EXPLORE_TASK_STATE.Over);

        default:
            break;
        }

        return(EXPLORE_TASK_STATE.Over);
    }
예제 #2
0
    public bool[] CheckEveryExploreTeamAward()
    {
        for (int i = 0; i < m_ExploreTeamResultArray.Length; i++)
        {
            m_ExploreTeamResultArray[i] = false;
        }
        Dictionary <int, teamtanxian> teamDatas = ObjectSelf.GetInstance().GetExploreTeamData();

        foreach (var data in teamDatas)
        {
            //空闲小队;
            if (data.Value.team == null || data.Value.team.Count <= 0)
            {
                continue;
            }
            tanxianinit tx = ObjectSelf.GetInstance().GetExploreTaskDataById(data.Value.tanxianid);
            if (tx == null)
            {
                Debug.LogError("探险任务数据为NULL exploreid=" + data.Value.tanxianid);
                continue;
            }

            m_ExploreTeamResultArray[data.Key - 1] = UI_ExploreModule.GetExploreTaskState(tx) == EXPLORE_TASK_STATE.ExploringOver;
        }
        return(m_ExploreTeamResultArray);
    }
예제 #3
0
    public static void OnTimeUpBtnClick(int exploreId)
    {
        //VIP等级不够;
        int openLv = VIPModule.GetExploreAccelerateVipLv();

        if (ObjectSelf.GetInstance().VipLevel < openLv)
        {
            InterfaceControler.GetInst().AddMsgBox(string.Format(GameUtils.getString("explore_bubble15"), openLv), UI_HomeControler.Inst.GetTopTransform());
            return;
        }

        tanxianinit mData   = ObjectSelf.GetInstance().GetExploreTaskDataById(exploreId);
        int         minutes = UI_ExploreModule.GetTaskMinuteToEnd(mData);
        int         cost    = UI_ExploreModule.GetCostByMinutes(minutes);
        //谈确认框;
        UI_RechargeBox box = UI_HomeControler.Inst.AddUI(UI_RechargeBox.UI_ResPath).GetComponent <UI_RechargeBox>();

        if (box == null)
        {
            LogManager.LogError("提示窗is null");
            return;
        }

        UI_RechargeBox.CurOpenType = EM_RECHARGEBOX_OPEN_TYPE.EXPLORE_TIMEUP_HINT;
        UI_RechargeBox.Data        = exploreId;
        box.SetIsNeedDescription(true);
        box.SetMoneyInfoActive(true);
        box.SetDescription_text(GameUtils.getString("explore_bubble7"));
        box.SetLeftBtn_text(GameUtils.getString("common_button_ok"));
        box.SetConNum(cost.ToString());
        box.SetConsume_Image(GameUtils.GetSpriteByResourceType(EM_RESOURCE_TYPE.Gold));
        box.SetMoneyInfo((int)EM_RESOURCE_TYPE.Gold, ObjectSelf.GetInstance().Gold);

        box.SetLeftClick(() =>
        {
            //InterfaceControler.GetInst().AddMsgBox("打开快速充值界面", parent);
            //UI_HomeControler.Inst.AddUI(UI_QuikChargeMgr.UI_ResPath);
            box.OnCloes();
            //已经过时;
            TimeSpan ts = GetTaskTimeToEnd(mData);
            if (ts <= TimeSpan.Zero)
            {
                return;
            }

            //钱不够;

            if (ObjectSelf.GetInstance().Gold < cost)
            {
                InterfaceControler.GetInst().ShowGoldNotEnougth();
                return;
            }

            UI_ExploreModule.SendOtherProtocol(CTanXianOther.END_SPEED, mData.tanxianid);
        });
        box.SetRightBtn_text(GameUtils.getString("common_button_close"));
    }
예제 #4
0
    public static TimeSpan GetTaskTimeToEnd(tanxianinit data)
    {
        DateTime endTime = TimeUtils.ConverMillionSecToDateTime(data.endtime, ObjectSelf.GetInstance().ServerTimeZone);

        return(TimeUtils.GetTimeSpan(endTime, ObjectSelf.GetInstance().ServerDateTime));
    }
예제 #5
0
    public static int GetTaskMinuteToEnd(tanxianinit data)
    {
        TimeSpan ts = GetTaskTimeToEnd(data);

        return(Mathf.CeilToInt((float)ts.TotalMinutes));
    }