예제 #1
0
    /// <summary>
    /// 设置战役胜负
    /// </summary>
    private void SetStageWin(bool outcome, int star)
    {
        bool            boss      = false;
        CounterPartInfo countInfo = StageM.GetCounterPartInfo(StageDC.GetCompaignStageID());

        if (countInfo != null)
        {
            boss = countInfo.isboss == 1;
        }
        if (outcome)
        {
            MyHead.succ.gameObject.SetActive(true);
            MyHead.fail.gameObject.SetActive(false);
            SetStageStar(star, boss);
            GatePassInfo Info = new GatePassInfo();
            Info.star    = star;
            Info.times   = 1;
            Info.stageid = StageDC.GetCompaignStageID();
            StageDC.UpdataStageScheduler(Info);
        }
        else
        {
            MyHead.succ.gameObject.SetActive(false);
            MyHead.fail.gameObject.SetActive(true);
            MyHead.PvpPveFail.SetActive(true);
            MyHead.Datatable.gameObject.SetActive(false);
            //			MyHead.PvpPveFail.transform.FindChild("PvpFailText").gameObject.SetActive(false);
            MyHead.Rewardtable.transform.parent.gameObject.SetActive(false);
        }
    }
예제 #2
0
    /// <summary>
    /// 加入战役战斗,填充战役相关数据。
    /// </summary>
    public static bool JoinCompaignBattle()
    {
        m_CounterPartPutSoldier.Clear();
        m_CounterPartEnemys.Clear();
        m_CounterPartPutBulid.Clear();
        m_CounterPartInfo = StageM.GetCounterPartInfo(m_stageid);
        if (m_CounterPartInfo != null)
        {
            SetStageReward(m_stageid);
            //战斗模式
            if (m_CounterPartInfo.mode == 0)
            {
                m_CounterPartMap = StageM.GetCounterPartMap(m_CounterPartInfo.countershipcanvasid);
                StageM.GetCounterPartShipPut(m_stageid, ref m_CounterPartPutSoldier, ref m_CounterPartPutBulid);
                //加入战斗
                CmCarbon.ReadyCombat();
                CmCarbon.SetDefenseMap(m_CounterPartMap);
                CmCarbon.SetDefenseBuild(m_CounterPartPutBulid);
                CmCarbon.SetPVEMonisterSoldier(m_CounterPartPutSoldier);
                CmCarbon.SetDefenseFloor(m_CounterPartInfo.decklevel);
                CmCarbon.SetDefenseUserInfo(m_CounterPartInfo, m_CounterPartPutBulid);
            }
            else     //防守模式
            //StageM.GetCounterPartShipPut(m_stageid , ref m_CounterPartPutSoldier , ref m_CounterPartPutBulid);
            {
                StageM.GetCounterPartShipPut(m_stageid, ref m_CounterPartEnemys, ref m_CounterPartPutBulid);
                //加入战斗
                CmCarbon.ReadyCombat();
                CmCarbon.SetAttackSoldier(m_CounterPartEnemys);
            }

            if (GetPassStageStar(m_type, m_stageid) == 0 /*&& GetPassStageTimes (m_type ,m_stageid) == 0*/)
            {
                CmCarbon.SetStartTalk(m_CounterPartInfo.m_StageStartTalk);
                CmCarbon.SetEndTalk(m_CounterPartInfo.m_StageEndTalk);
            }
            return(true);
        }
        return(false);
    }