Пример #1
0
    //----------------------------副本引导-----------------------------------------------------------------------------------------------------------------------------
    /// <summary>
    /// 副本引导UI
    /// </summary>
    void ShowFBGuideUI()
    {
        ComBatCopyDataManager copyMgr = DataManager.Manager <ComBatCopyDataManager>();

        if (false == copyMgr.IsEnterCopy)
        {
            this.m_widget_copyGuide.gameObject.SetActive(false);
            return;
        }

        CopyDataBase copyDb = GameTableManager.Instance.GetTableItem <CopyDataBase>(copyMgr.EnterCopyID);

        if (copyDb == null)
        {
            return;
        }

        if (true == DataManager.Manager <ComBatCopyDataManager>().m_haveShowCopyGuide)
        {
            return;
        }
        DataManager.Manager <ComBatCopyDataManager>().m_haveShowCopyGuide = true;

        CopyTargetGuideDataBase ctGuideDb = GameTableManager.Instance.GetTableItem <CopyTargetGuideDataBase>(copyDb.guideId);

        if (ctGuideDb == null)
        {
            return;
        }

        this.m_widget_copyGuide.gameObject.SetActive(true);
        m_label_copyGuideDes.text = ctGuideDb.guideStr;
        StartCoroutine(DelayToCloseCopyGuide(ctGuideDb.time));
    }
Пример #2
0
    bool ShowSingleCard()
    {
        if (dataManager.IsSingleShowCard(m_uGotoCopyID))
        {
            m_scrollview_FbScrollView.gameObject.SetActive(false);
            m_widget_Panel.gameObject.SetActive(true);
            m_widget_FBCard.gameObject.SetActive(true);

            FBCard fb = m_widget_FBCard.gameObject.GetComponent <FBCard>();
            if (fb == null)
            {
                fb = m_widget_FBCard.gameObject.AddComponent <FBCard>();
            }
            //fb.DestroyScrollChild();
            CopyDataBase showDb = GameTableManager.Instance.GetTableItem <CopyDataBase>(m_uGotoCopyID);

            if (showDb != null)
            {
                fb.InitByCopyData(showDb);
            }
            UIEventListener.Get(m_widget_FBCard.gameObject).onClick = null;
            return(true);
        }
        return(false);
    }
Пример #3
0
    public CopyTypeTable GetCopyTypeByCopyID(uint copyID)
    {
        CopyDataBase cdb = GameTableManager.Instance.GetTableItem <CopyDataBase>(copyID);

        if (cdb != null)
        {
            if (cdb.copyType == 1)
            {
                return(CopyTypeTable.Normal);
            }
            else if (cdb.copyType == 2)
            {
                return(CopyTypeTable.Arena);
            }
            else if (cdb.copyType == 3)
            {
                return(CopyTypeTable.Camp);
            }
            else if (cdb.copyType == 4)
            {
                return(CopyTypeTable.CityWar);
            }
        }
        return(CopyTypeTable.None);
    }
Пример #4
0
    /// <summary>
    /// 副本借口
    /// </summary>
    /// <param name="copyID"></param>
    /// <returns></returns>
    public ICopy GetCopyByCopyID(uint copyID)
    {
        CopyDataBase cdb = GameTableManager.Instance.GetTableItem <CopyDataBase>(copyID);

        if (cdb != null)
        {
            if (cdb.clientCopyType == 2)
            {
                return(DataManager.Manager <ArenaManager>());
            }
            else if (cdb.clientCopyType == 3)
            {
                return(DataManager.Manager <CampCombatManager>());
            }
            else if (cdb.clientCopyType == 4)
            {
                return(DataManager.Manager <NvWaManager>());
            }
            else if (cdb.clientCopyType == 7)
            {
                return(DataManager.Manager <CityWarManager>());
            }
            else if (cdb.clientCopyType == 10)
            {
                return(DataManager.Manager <JvBaoBossWorldManager>());
            }
            else if (cdb.clientCopyType == 11)
            {
                return(DataManager.Manager <AnswerManager>());
            }
        }

        return(null);
    }
Пример #5
0
    void StartAutoFight()
    {
        if (m_bIsEnterCopy)
        {
            CopyDataBase cdb = GameTableManager.Instance.GetTableItem <CopyDataBase>(m_uEnterCopyID);
            if (cdb != null)
            {
                //进入副本 如果还是组队跟随状态 跟随状态挂起,进入挂机状态
                Client.IControllerSystem cs = Client.ClientGlobal.Instance().GetControllerSystem();
                if (cs != null)
                {
                    Client.ICombatRobot robot = cs.GetCombatRobot();
                    if (robot != null) //&& robot.Status != Client.CombatRobotStatus.STOP)
                    {
                        if (DataManager.Manager <TeamDataManager>().IsJoinTeam&& DataManager.Manager <TeamDataManager>().IsFollow)
                        {
                            robot.StartInCopy(m_uEnterCopyID, LaskSkillWave, LastTransmitWave);
                        }

                        if (cdb.IsAutoFight)
                        {
                            robot.StartInCopy(m_uEnterCopyID, LaskSkillWave, LastTransmitWave);
                        }
                    }
                }
            }
        }
    }
Пример #6
0
    public void OnAskTeamrCopy(stAskTeamrCopyUserCmd_CS cmd)
    {
        m_uEnterCopyID = cmd.copy_base_id;
        m_dicTeammateStatus.Clear();
        TeamDataManager teamData = DataManager.Manager <TeamDataManager>();

        m_dicTeammateStatus.Add(teamData.LeaderId, true);


        CopyDataBase db = GameTableManager.Instance.GetTableItem <CopyDataBase>(cmd.copy_base_id);

        if (db == null)
        {
            return;
        }
        if (!KHttpDown.Instance().SceneFileExists(db.mapId))
        {
            stAnsTeamCopyUserCmd_CS sendCmd = new stAnsTeamCopyUserCmd_CS();
            sendCmd.ans          = false;
            sendCmd.copy_base_id = cmd.copy_base_id;
            NetService.Instance.Send(cmd);
            DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.DownloadPanel);

            //TipsManager.Instance.ShowTips(LocalTextType.Team_Limit_nindedongwurenshuyiman);//您的队伍人数已满
            return;
        }
        else
        {
            DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.FBConfirmPanel);
        }

        m_uCountDown = GameTableManager.Instance.GetGlobalConfig <uint>("EnterCopyCountdown");
        TimerAxis.Instance().KillTimer(m_uCopyAskTeamTimerID, this);
        TimerAxis.Instance().SetTimer(m_uCopyAskTeamTimerID, 1000, this);
    }
Пример #7
0
    public bool IsSingleShowCard(uint copyID)
    {
        CopyDataBase db = GameTableManager.Instance.GetTableItem <CopyDataBase>(copyID);

        if (db != null)
        {
            return(db.bSingleShow);
        }
        return(false);
    }
Пример #8
0
        /// <summary>
        /// 通过[副本ID]二分快速查表
        /// </summary>
        /// <param name="copyId">副本ID</param>
        /// <returns></returns>
        public static CopyDataBase Query(this List <CopyDataBase> sorted, uint copyId)
        {
            var key = new CopyDataBase()
            {
                copyId = copyId
            };
            var comparer = new Comparer1();
            var index    = sorted.BinarySearch(key, comparer);

            return(index >= 0 ? sorted[index] : default(CopyDataBase));
        }
Пример #9
0
    /// <summary>
    /// 由副本id  获取组队活动ID
    /// </summary>
    /// <param name="copyId"></param>
    /// <param name="mainId"></param>
    /// <param name="indexId"></param>
    /// <returns></returns>
    uint GetTeamActivityIdByCopyId(uint copyId)
    {
        uint teamActivityId          = 0;
        List <CopyDataBase> copyList = GameTableManager.Instance.GetTableList <CopyDataBase>();
        CopyDataBase        copyDb   = copyList.Find((d) => { return(d.copyId == copyId); });

        if (copyDb != null)
        {
            teamActivityId = copyDb.TeamActivityID;
        }

        return(teamActivityId);
    }
Пример #10
0
    public CopyInfo GetCopyInfoById(uint copyID)
    {
        CopyDataBase db = GameTableManager.Instance.GetTableItem <CopyDataBase>(copyID);

        if (db == null)
        {
            return(null);
        }
        if (m_dicCopyInfo.ContainsKey(db.staNumType))
        {
            return(m_dicCopyInfo[db.staNumType]);
        }
        return(null);
    }
Пример #11
0
    /// <summary>
    /// 通过副本id获取同类型副本列表
    /// </summary>
    /// <param name="count"></param>
    /// <returns></returns>
    public List <CopyDataBase> GetCopyListByCopyByCopyID(uint copyid)
    {
        CopyDataBase db = GameTableManager.Instance.GetTableItem <CopyDataBase>(copyid);

        if (db != null)
        {
            if (db.staNumType == 0)
            {
                return(new List <CopyDataBase>()
                {
                    db
                });
            }
            return(GetCopyListByCopyStaticCount(db.staNumType));
        }
        return(null);
    }
Пример #12
0
    public void InitByCopyData(CopyDataBase db)
    {
        m_db = db;
        InitControls();

        m_label_enteritemname.text  = "";
        m_label_enterneedcount.text = "";
        m_sprite_itembg.transform.DestroyChildren();

        InitCard();

        if (m_widget_Panel.gameObject.activeSelf)
        {
            m_widget_Panel.transform.localScale = Vector3.one;
            InitPanel();
        }
    }
Пример #13
0
    private void UpdateExchangeBtnVisbile()
    {
        bool visible = true;

        //   if (dataManager.IsSingleShowCard(m_uGotoCopyID))
        {
            CopyDataBase showDb = GameTableManager.Instance.GetTableItem <CopyDataBase>(m_uGotoCopyID);
            if (null == showDb || showDb.copyFlag != (uint)CopyFlag.Juqing)
            {
                visible = false;
            }
        }
        if (null != m_btn_EquipRechange && m_btn_EquipRechange.gameObject.activeSelf != visible)
        {
            m_btn_EquipRechange.gameObject.SetActive(visible);
        }
    }
Пример #14
0
    void OnEvent(int eventID, object param)
    {
        if (eventID == (int)GameEventID.ENTITYSYSTEM_ENTERMAP)
        {
            uint         mapID  = (uint)param;
            CopyDataBase copyBb = GameTableManager.Instance.GetTableItem <CopyDataBase>(this.m_uEnterCopyID);
            if (copyBb == null)
            {
                return;
            }

            //当前题图与副本地图不一样,退出副本了
            if (copyBb.mapId != mapID)
            {
                stExitCopyUserCmd_CS cmd = new stExitCopyUserCmd_CS()
                {
                    copy_base_id = 0
                };
                OnExitCopy(cmd);
            }
        }
        else if (eventID == (int)GameEventID.SYSTEM_LOADSCENECOMPELETE)
        {
            TimerAxis.Instance().SetTimer(m_uAutoStartFightTimerID, 1000, this, 1);
        }
        //else if (eventID == (int)GameEventID.UIEVENT_REFRESHCURRENCYNUM)
        //{
        //    if (false == this.IsEnterCopy)
        //    {
        //        return;//非副本,退出
        //    }

        //    ItemDefine.UpdateCurrecyPassData data = (ItemDefine.UpdateCurrecyPassData)param;
        //    if (data.MoneyType == MoneyType.MoneyType_Gold)
        //    {
        //        AddGoldInCopy(data.ChangeNum);
        //    }
        //}
    }
Пример #15
0
    /// <summary>
    /// 进入副本(朝歌山单人)
    /// </summary>
    /// <param name="cmd"></param>
    public void ReqEnterCopy(uint copyId)
    {
        CopyDataBase copyData = GameTableManager.Instance.GetTableItem <CopyDataBase>(copyId);

        if (copyData == null)
        {
            return;
        }

        //地图检查,如果没有,前往下载
        if (!KHttpDown.Instance().SceneFileExists(copyData.mapId))
        {
            //打开下载界面
            DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.DownloadPanel);
            return;
        }

        stRequestEnterCopyUserCmd_C sendCmd = new stRequestEnterCopyUserCmd_C();

        sendCmd.copy_base_id = copyId;
        NetService.Instance.Send(sendCmd);
    }
    /// <summary>
    /// 是否显示左侧副本目标
    /// </summary>
    public MissionAndTeamPanel.BtnStatus GetCopyLeftShowType()
    {
        if (false == m_bIsEnterCopy)
        {
            return(MissionAndTeamPanel.BtnStatus.Mission);
        }

        CopyDataBase copyDb = GameTableManager.Instance.GetTableItem <CopyDataBase>(this.m_uEnterCopyID);

        if (copyDb != null)
        {
            if (copyDb.copyLeftShowType == 0)
            {
                return(MissionAndTeamPanel.BtnStatus.Mission);
            }
            else if (copyDb.copyLeftShowType == 1)
            {
                return(MissionAndTeamPanel.BtnStatus.CopyTarget);
            }
            else if (copyDb.copyLeftShowType == 2)
            {
                return(MissionAndTeamPanel.BtnStatus.CopyBattleInfo);
            }
            else if (copyDb.copyLeftShowType == 3)
            {
                return(MissionAndTeamPanel.BtnStatus.NvWa);
            }
            else if (copyDb.copyLeftShowType == 4)
            {
                return(MissionAndTeamPanel.BtnStatus.Answer);
            }

            return(MissionAndTeamPanel.BtnStatus.Mission);
        }
        else
        {
            return(MissionAndTeamPanel.BtnStatus.Mission);
        }
    }
Пример #17
0
    protected override void OnShow(object data)
    {
        base.OnShow(data);
        m_db = GameTableManager.Instance.GetTableItem <CopyDataBase>(CopyDataManager.EnterCopyID);

        if (m_db == null)
        {
            return;
        }

        m_teamMemberList.Clear();
        List <TeamMemberInfo> tempList = DataManager.Manager <TeamDataManager>().TeamMemberList;

        foreach (var info in tempList)
        {
            if (!DataManager.Manager <TeamDataManager>().IsLeader(info.id))
            {
                m_teamMemberList.Add(info);
            }
            else
            {
                m_teamMemberList.Insert(0, info);
            }
        }
        if (DataManager.Manager <TeamDataManager>().MainPlayerIsLeader())
        {
            m_btn_btn_queding.isEnabled = false;
        }
        else
        {
            m_btn_btn_queding.isEnabled = true;
        }
        m_label_FB_name.text = m_db.copyName;
        RefreshUI();
        bContinue = true;
        m_slider_Countdownslider.value = 1;
    }
Пример #18
0
    public void OnEnterCopy(stEntertCopyUserCmd_S cmd)
    {
        m_dicTeammateStatus.Clear();
        m_dicEnterZoneStatus.Clear();
        m_dicSendEnterZoneTime.Clear();

        CopyDataBase cdb = GameTableManager.Instance.GetTableItem <CopyDataBase>(cmd.copy_base_id);

        if (cdb != null)
        {
            m_uEnterCopyID = cmd.copy_base_id;

            uint campCopyId = 4001;   //阵营战
            if (m_uEnterCopyID != campCopyId)
            {
                m_uCopyCountDown = cdb.keepTime - cmd.copy_live_time;
            }

            Client.IMapSystem mapsys = ClientGlobal.Instance().GetMapSystem();
            if (mapsys != null)
            {
                mapsys.SetEnterZoneCallback(OnEnterZone);
            }

            //进入副本时 初始化波数数据
            InitWaveIdListByCopyId();

            //进入副本接口
            ICopy copy = GetCopyByCopyID(m_uEnterCopyID);
            if (copy != null)
            {
                copy.EnterCopy();
            }
            else
            {
                stCopyInfo info = new stCopyInfo();
                info.bShow = true;
                info.bShowBattleInfoBtn = false;

                DataManager.Manager <UIPanelManager>().SendMsg(PanelID.MainPanel, UIMsgID.eShowCopyInfo, info);

                this.CopyCDAndExitData = new CopyCDAndExitInfo {
                    bShow = true, bShowBattleInfoBtn = false
                };
            }

            //副本中关闭消息推送界面
            if (DataManager.Manager <UIPanelManager>().IsShowPanel(PanelID.MessagePushPanel))
            {
                DataManager.Manager <UIPanelManager>().HidePanel(PanelID.MessagePushPanel);
            }

            if (DataManager.Manager <UIPanelManager>().IsShowPanel(PanelID.MissionAndTeamPanel))
            {
                DataManager.Manager <UIPanelManager>().SendMsg(PanelID.MissionAndTeamPanel, UIMsgID.eCopyEnter, null);
            }

            Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.COMBOT_ENTER_EXIT, new Client.stCombotCopy()
            {
                copyid = cmd.copy_base_id, enter = true
            });

            //进入副本标志
            m_bIsEnterCopy = true;
        }
    }
Пример #19
0
    void OnShowItemPanel(string itemName)
    {
        if (string.IsNullOrEmpty(itemName))
        {
            return;
        }
        Transform itemTrans = m_grid_FbGrid.transform.Find(itemName);

        if (itemTrans == null)
        {
            return;
        }
        GameObject go    = itemTrans.gameObject;
        int        index = 0;

        if (int.TryParse(itemName, out index))
        {
            m_nItemIndex = index;
        }

        if (IsTweening)
        {
            return;
        }
        IsTweening = true;

        List <CopyDataBase> copyList = dataManager.GetCopyListByCopyByCopyID(m_uGotoCopyID);

        if (index < copyList.Count)
        {
            CopyDataBase db = copyList[index];
            if (db != null)
            {
                FBCard fb = go.GetComponent <FBCard>();
                if (fb == null)
                {
                    fb = m_widget_FBCard.gameObject.AddComponent <FBCard>();
                }

                fb.InitByCopyData(db);
            }
        }
        UIDragScrollView drag = go.GetComponent <UIDragScrollView>();

        InitCopyNum();
        Transform subPanel = go.transform.Find("Panel");

        if (!bShowInfo)
        {
            drag.enabled = false;

            subPanel.DOScaleX(0, 0);
            m_endPos = GetScrollItemPosOnParent(go.transform.localPosition, index);
            subPanel.DOScaleX(1, m_fbackTime).OnComplete(() =>
            {
                bShowInfo  = true;
                IsTweening = false;
            });
            Log.LogGroup("ZDY", " pos is {0}", m_endPos);
            for (int i = 0; i <= index; i++)
            {
                string    itemname = string.Format("{0:D2}", i);
                Transform item     = m_grid_FbGrid.transform.Find(itemname);
                if (item != null)
                {
                    float offset = item.localPosition.x - m_endPos.x;
                    item.DOLocalMoveX(offset, m_fbackTime);
                }
            }
            int totoalCount = m_grid_FbGrid.transform.childCount;
            for (int j = index + 1; j < totoalCount; j++)
            {
                string    itemname = string.Format("{0:D2}", j);
                Transform item     = m_grid_FbGrid.transform.Find(itemname);
                if (item != null)
                {
                    float offset = item.localPosition.x + ((3 * (itemWidth + 12)) - m_endPos.x);
                    item.DOLocalMoveX(offset, m_fbackTime);
                }
            }
        }
        else
        {
            subPanel.DOScaleX(0, m_fbackTime).OnComplete(() =>
            {
                bShowInfo    = false;
                IsTweening   = false;
                drag.enabled = true;
            });
            for (int i = 0; i <= index; i++)
            {
                string    itemname = string.Format("{0:D2}", i);
                Transform item     = m_grid_FbGrid.transform.Find(itemname);
                if (item != null)
                {
                    float offset = item.localPosition.x + m_endPos.x;
                    item.DOLocalMoveX(offset, m_fbackTime);
                }
            }
            int totoalCount = m_grid_FbGrid.transform.childCount;
            for (int j = index + 1; j < totoalCount; j++)
            {
                string    itemname = string.Format("{0:D2}", j);
                Transform item     = m_grid_FbGrid.transform.Find(itemname);
                if (item != null)
                {
                    float offset = item.localPosition.x - ((3 * (12 + itemWidth)) - m_endPos.x);
                    item.DOLocalMoveX(offset, m_fbackTime);
                }
            }
        }
    }
Пример #20
0
    void InitFbScroll()
    {
        UpdateExchangeBtnVisbile();
        if (ShowSingleCard())
        {
            return;
        }
        m_grid_FbGrid.transform.DestroyChildren();
        m_scrollview_FbScrollView.gameObject.SetActive(true);
        float y = m_scrollview_FbScrollView.transform.localPosition.y;

        m_scrollview_FbScrollView.transform.localPosition = new Vector3(m_fScrollInitX, y, 0);
        m_scrollview_FbScrollView.panel.clipOffset        = Vector2.zero;

        List <CopyDataBase> copyList = dataManager.GetCopyListByCopyByCopyID(m_uGotoCopyID);

        if (copyList == null)
        {
            return;
        }
        int chidlCount = m_grid_FbGrid.transform.childCount;

        if (chidlCount > copyList.Count)
        {
            for (int i = copyList.Count; i < chidlCount; i++)
            {
                string name = string.Format("{0:D2}", i);

                Transform itemTrans = m_grid_FbGrid.transform.Find(name);
                if (itemTrans != null)
                {
                    itemTrans.gameObject.SetActive(false);
                }
            }
        }
        for (int i = 0; i < copyList.Count; i++)
        {
            string     name = string.Format("{0:D2}", i);
            GameObject item = null;

            Transform itemTrans = m_grid_FbGrid.transform.Find(name);
            if (itemTrans == null)
            {
                item = NGUITools.AddChild(m_grid_FbGrid.gameObject, m_widget_FBCard.gameObject);
                item.SetActive(true);
                item.name = name;
                Vector3 localPos = new Vector3(i * itemWidth, 0, 0);
                item.transform.localPosition = localPos;
            }
            else
            {
                item = itemTrans.gameObject;
            }
            item.gameObject.SetActive(true);
            Transform subPanel = item.transform.Find("Panel");
            if (subPanel != null)
            {
                subPanel.gameObject.SetActive(true);
                subPanel.DOScaleX(0, 0);
            }
            CopyDataBase cdb = copyList[i];
            FBCard       fb  = item.GetComponent <FBCard>();
            if (fb == null)
            {
                fb = item.AddComponent <FBCard>();
            }
            fb.DestroyScrollChild();
            fb.InitByCopyData(cdb);

            UIEventListener.Get(item).onClick = OnItemClick;
        }

        m_grid_FbGrid.Reposition();
    }
Пример #21
0
 void EnterCopy()
 {
     if (m_db != null)
     {
         ComBatCopyDataManager copyData       = DataManager.Manager <ComBatCopyDataManager>();
         TeamDataManager       teamData       = DataManager.Manager <TeamDataManager>();
         List <TeamMemberInfo> teamMemberList = teamData.TeamMemberList;
         int count = teamMemberList.Count;
         copyData.CPFlag = (CopyFlag)m_db.copyFlag;
         if (copyData.CPFlag == CopyFlag.Danren)
         {
             DataManager.Manager <ComBatCopyDataManager>().ReqEnterCopy(m_db.copyId);
         }
         else if (copyData.CPFlag == CopyFlag.Juqing)
         {
             if (count > 1)
             {
                 if (teamData.MainPlayerIsLeader())
                 {
                     DataManager.Manager <CampCombatManager>().ReqAskTeamrCopy(m_db.copyId);
                 }
                 else
                 {
                     TipsManager.Instance.ShowTips(LocalTextType.Copy_Commond_zhiyouduizhangcainengjinfubeno);
                 }
             }
             else
             {
                 if (m_db.copyId != 4001)
                 {
                     DataManager.Manager <ComBatCopyDataManager>().ReqEnterCopy(m_db.copyId);
                 }
             }
         }
         else if (copyData.CPFlag == CopyFlag.Zudui)
         {
             CopyDataBase db = GameTableManager.Instance.GetTableItem <CopyDataBase>(m_db.copyId);
             if (db != null)
             {
                 if (MainPlayerHelper.GetPlayerLevel() < db.openLv)
                 {
                     TipsManager.Instance.ShowTipsById(21);
                     return;
                 }
             }
             stAskTeamrCopyUserCmd_CS cmd = new stAskTeamrCopyUserCmd_CS();
             cmd.copy_base_id = m_db.copyId;
             NetService.Instance.Send(cmd);
         }
         else if (copyData.CPFlag == CopyFlag.Huodong)
         {
             if (m_db.copyType == 3)//阵营战
             {
                 DataManager.Manager <CampCombatManager>().GetSignCampInfo(0);
                 DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.CampWarPanel);
             }
         }
         else if (copyData.CPFlag == CopyFlag.DaTi)
         {
             DataManager.Manager <AnswerManager>().ReqEnterAnswerCopy();
         }
         else
         {
             stAskTeamrCopyUserCmd_CS cmd = new stAskTeamrCopyUserCmd_CS();
             cmd.copy_base_id = m_db.copyId;
             NetService.Instance.Send(cmd);
         }
     }
 }
Пример #22
0
    void InitCopyNum()
    {
        List <CopyDataBase> copyList = dataManager.GetCopyListByCopyByCopyID(m_uGotoCopyID);

        if (copyList == null)
        {
            m_label_frequency_Plot.text = "";
            return;
        }
        string frequenceLabel = "今日已完成次数:";

        if (copyList.Count == 1)
        {
            CopyDataBase db   = copyList[0];
            CopyInfo     info = dataManager.GetCopyInfoById(db.copyId);

            uint useNum;
            uint maxNum;
            if (DataManager.Manager <ComBatCopyDataManager>().IsCampCopy(db.copyId))
            {
                useNum = DataManager.Manager <CampCombatManager>().EnterCampTimes;
                maxNum = DataManager.Manager <CampCombatManager>().CampCopyMaxNum;
            }
            else
            {
                if (info != null)
                {
                    useNum = info.CopyUseNum;
                    maxNum = info.MaxCopyNum;
                }
                else
                {
                    useNum = 0;
                    maxNum = db.numMax;
                }
            }

            string desStr = useNum + "/" + maxNum;
            m_label_frequency_Plot.text = desStr;

            //if (info != null)
            //{
            //    uint num = info.CopyUseNum;
            //    string str = num + "/" + info.MaxCopyNum;
            //    m_label_frequency_Plot.text = str;
            //}
            //else
            //{
            //    m_label_frequency_Plot.text = 0 + "/" + db.numMax;
            //}
            if (db.forbitWhat == 1)
            {
                frequenceLabel = "今日已收益次数:";
            }
        }
        if (copyList.Count > 1)
        {
            CopyDataBase temp = copyList[0];
            if (temp == null)
            {
                return;
            }
            int num    = 0;
            int maxNum = (int)temp.numMax;
            for (int i = 0; i < copyList.Count; i++)
            {
                CopyDataBase db       = copyList[i];
                CopyInfo     copyInfo = dataManager.GetCopyInfoById(db.copyId);
                if (copyInfo != null)
                {
                    num    = (int)copyInfo.CopyUseNum;
                    maxNum = (int)copyInfo.MaxCopyNum;
                    if (db.forbitWhat == 1)
                    {
                        frequenceLabel = "今日已收益次数:";
                    }
                    break;
                }
            }
            string str = num + "/" + maxNum;
            m_label_frequency_Plot.text = str;
        }
        m_label_frequency_label.text = frequenceLabel;
    }
Пример #23
0
    public void OnCompeleteCopy(stCompleteCopyUserCmd_S cmd)
    {
        m_uCopyCountDown       = cmd.close_time;
        m_uCopyFinishCountDown = cmd.close_time;
        CopyDataBase cdb = GameTableManager.Instance.GetTableItem <CopyDataBase>(m_uEnterCopyID);

        if (cdb != null)
        {
            if (cdb.IsShowFinish)
            {
                UIPanelManager upMger = DataManager.Manager <UIPanelManager>();
                upMger.ShowPanel(PanelID.FBResult);
                TimerAxis.Instance().SetTimer(m_uCopyFinishTimerID, 1000, this, cmd.close_time);
                //延迟两秒显示副本奖励
                CoroutineMgr.Instance.DelayInvokeMethod(2f, () =>
                {
                    if (upMger.IsShowPanel(PanelID.FBResult))
                    {
                        upMger.HidePanel(PanelID.FBResult);
                    }
                    if (cdb.havePassReward != 0 && !string.IsNullOrEmpty(cdb.rewardList))
                    {
                        string[] rewardListStr           = cdb.rewardList.Split(new char[] { ';' });
                        List <CommonAwardData> cmADDAtas = null;
                        CommonAwardData tempcmAD         = null;
                        string[] tempRewardArray         = null;
                        uint tempItemID = 0;
                        uint tempNum    = 0;
                        if (null != rewardListStr && rewardListStr.Length > 0)
                        {
                            for (int i = 0, max = rewardListStr.Length; i < max; i++)
                            {
                                if (string.IsNullOrEmpty(rewardListStr[i]))
                                {
                                    continue;
                                }
                                tempRewardArray = rewardListStr[i].Split(new char[] { '_' });
                                if (null == tempRewardArray || tempRewardArray.Length != 2)
                                {
                                    continue;
                                }
                                if (!string.IsNullOrEmpty(tempRewardArray[0]) && uint.TryParse(tempRewardArray[0].Trim(), out tempItemID) &&
                                    !string.IsNullOrEmpty(tempRewardArray[1]) && uint.TryParse(tempRewardArray[1].Trim(), out tempNum)
                                    )
                                {
                                    tempcmAD = new CommonAwardData(tempItemID, tempNum);
                                    if (null == cmADDAtas)
                                    {
                                        cmADDAtas = new List <CommonAwardData>();
                                    }
                                    CopyInfo info = GetCopyInfoById(m_uEnterCopyID);
                                    if (!info.IsFinished)
                                    {
                                        cmADDAtas.Add(tempcmAD);
                                    }
                                }
                            }
                            //超过收益次数  还是显示奖励界面但是没有奖励道具
                            if (null != cmADDAtas)
                            {
                                upMger.ShowPanel(PanelID.FBPassAwardPanel, data: cmADDAtas);
                            }
                        }
                    }
                });
            }
        }
    }