예제 #1
0
    public void OnGiveUp()
    {
        if (hasClick)
        {
            return;
        }
        hasClick = true;
        ///
        /// 跳过战斗的播放动画
        ///
        Core.Data.temper.SkipBattle    = true;
        BanBattleProcess.Instance.skip = true;
        ///
        /// 保存战斗的速度状态
        ///
        BanBattleManager battleMgr = BanBattleManager.Instance;

        battleMgr.SpeedOrSkipMgr.SpeedUpAndAutoSave();
        battleMgr.attackSideInfo.CancelInvoke();
        ///
        ///战斗暂停已结束
        ///
        TimeMgr.getInstance().WarPause = false;
        TimeMgr.getInstance().setBaseLine(1f);
        StopAllCoroutines();
        AsyncTask.RemoveAllDelayedWork();
        SettleBossBattle();
        updatePlayerLv();

        Core.SM.beforeLoadLevel(SceneName.GAME_BATTLE, SceneName.MAINUI);
        AsyncLoadScene.m_Instance.LoadScene(SceneName.MAINUI);
        Core.Data.temper.WarErrorCode = -1;
    }
예제 #2
0
    /// <summary>
    /// 设定是否需要战斗加速
    /// </summary>
    void SetBattleStatus()
    {
        ///
        /// 计时模块,设定战斗的初始值为1.3F
        ///
        TemporyData temp       = Core.Data.temper;
        bool        featurewar = temp.currentBattleType == TemporyData.BattleType.FightWithFulisa;

        if (!featurewar)
        {
            TimeMgr.getInstance().setBaseLine(ButtonListener.BaseSpeed);
        }

        AccountConfigManager accMgr = Core.Data.AccountMgr;

        if (accMgr.UserConfig.SpeedUp > 0)
        {
            SpeedOrSkipMgr.OnAddSpeedButtonClick();
        }

        if (accMgr.UserConfig.AutoBat > 0)
        {
            SpeedOrSkipMgr.OnAutoButtonClick();
        }
    }
예제 #3
0
 /// <summary>
 /// 继续战斗
 /// </summary>
 public void OnContinue()
 {
     gameObject.SetActive(false);
     ///战斗暂停已结束
     TimeMgr.getInstance().WarPause = false;
     TimeMgr.getInstance().revertToBaseLine();
 }
예제 #4
0
    // Update is called once per frame
    void Update()
    {
        bool click = Input.GetMouseButtonDown(0);

        if (OverSkill_Key)
        {
            if (click)
            {
                if (BattleInfo == null || !BattleInfo.hasLiquidate)
                {
                    if (TimeMgr.getInstance().WarPause == false)                     //暂停的时候不能点击
                    {
                        OverSkill_Add++;
                    }
                }
            }
        }

        if (OverSkill_KeyUI)
        {
            if (click)
            {
                Core.Data.soundManager.BtnPlay(ButtonType.Confirm);
            }
        }

        if (Man_L != null && Man_R != null && Man_L.NowAnimType == CRLuoAnim_Main.Type.Idle && Man_R.NowAnimType == CRLuoAnim_Main.Type.Idle)
        {
            Screen_Brightness_ONOFF(true);
        }
    }
예제 #5
0
 //重置
 public void ResetSpeedUp()
 {
     curLoop = 0;
     SpeedUp.GetComponent <UIButton>().normalSprite = "zhandoujiasu";
     //设定基线
     TimeMgr.getInstance().setBaseLine(1F);
 }
예제 #6
0
    public void beforeLoadLevel(string curLevel, string nextLevel)
    {
        ConsoleEx.DebugLog("BeforeLoadLevel. curlevel = " + curLevel + "   next level = " + nextLevel);

        LastScenesName = curLevel;
        CurScenesName  = nextLevel;

        if (curLevel == SceneName.GAME_BATTLE && nextLevel == SceneName.MAINUI)
        {
            TimeMgr.getInstance().setBaseLine(1.0f);
        }

        switch (nextLevel)
        {
        case SceneName.LOGIN_SCENE:
            Core.Data.soundManager.BGMPlay(SceneBGM.BGM_Login);
            break;

        case SceneName.GAME_BATTLE:
            Core.Data.soundManager.BGMPlay(SceneBGM.BGM_BATTLE);
            break;

        case SceneName.MAINUI:
            Core.Data.soundManager.BGMPlay(SceneBGM.BGM_GAMEUI);
            break;

        case SceneName.GameMovie:
            Core.Data.soundManager.BGMStop();
            break;
        }
    }
예제 #7
0
    /// <summary>
    /// 暂停游戏
    /// </summary>
    public void OnPauseClick()
    {
        pausePanelView.gameObject.SetActive(true);
        pausePanelView.init();

        Time.timeScale = 0f;
        TimeMgr.getInstance().WarPause = true;
    }
예제 #8
0
    void QueueEnd(TimerTask t)
    {
        //回归基线

        ///
        ///如果战斗没有暂停的话,回归
        if (!TimeMgr.getInstance().WarPause)
        {
            TimeMgr.getInstance().revertToBaseLine();
        }
    }
예제 #9
0
    void QueueNormal(TimerTask t)
    {
        AsyncTask.QueueOnMainThread(() => {
            if (timer <= 0)
            {
                if (Time.timeScale < TimeMgr.getInstance().getExtLine(BanTimeCenter.Scale_Down_To))
                {
                    TimeMgr.getInstance().setExtLine(BanTimeCenter.Scale_Down_To);
                }
            }
            else
            {
                TimeMgr.getInstance().setExtLine(BanTimeCenter.Scale_Down_Slow);
            }

            timer = 0;
        });
    }
예제 #10
0
    private void startTimer()
    {
        ///
        /// --- 如果是自动战斗,则不让时间流逝的变慢 ----
        ///
        AccountConfigManager accMgr = Core.Data.AccountMgr;
        bool makeTimeQucik          = accMgr.UserConfig.AutoBat == (short)1;

        if (makeTimeQucik == false)
        {
            TimeMgr.getInstance().setExtLine(BanTimeCenter.Scale_Down_Slow);
        }

        long      now  = Core.TimerEng.curTime;
        long      end  = now + 8;
        TimerTask task = new TimerTask(now, end, 1, ThreadType.MainThread);

        if (makeTimeQucik == false)
        {
            task.onEvent = QueueNormal;
        }
        task.onEventEnd = QueueEnd;
        task.DispatchToRealHandler();
    }
예제 #11
0
    void SpeedUpClick()
    {
        if (OpenSpeedUp)
        {
            //当前的速度
            float curFactor = 1.0f;
            if (curLoop == 0)
            {
                curFactor = BaseSpeed + deltaSpeed;
                curLoop   = 1;
            }
            else
            {
                curFactor = BaseSpeed;
                curLoop   = 0;
            }

            if (curLoop == 0)
            {
                SpeedUp.GetComponent <UIButton>().normalSprite = "zhandoujiasu";
            }
            else
            {
                SpeedUp.GetComponent <UIButton>().normalSprite = "zhandoujiasu2";
            }

            //设定基线
            TimeMgr.getInstance().setBaseLine(curFactor);

            StartCoroutine(FadeIn());
        }
        else
        {
            StartCoroutine(VipOpenSpeedUp());
        }
    }
예제 #12
0
    void Awake()
    {
        Instance = this;
        CityFloorData.Instance.isCanClick = true;

        TemporyData temp = Core.Data.temper;

        float ratio = Screen.width / (Screen.height * 1.0f);

        if (Mathf.Approximately(ratio, Consts._16Bi9))
        {
            go_WinOrLosePos.transform.localPosition = new Vector3(0f, 20f, 0f);
        }
        else if (Mathf.Approximately(ratio, Consts._4Bi3))
        {
            go_WinOrLosePos.transform.localPosition = new Vector3(0f, 110f, 0f);
        }
        else
        {
            go_WinOrLosePos.transform.localPosition = new Vector3(0f, 30f, 0f);
        }


        ///
        ///  --- 跳过功能和暂停功能 ---
        ///  PVE 只能有暂停功能
        ///  PVP 只能有跳过功能
        ///

        //初始化战斗数据
        if (KindOfWar == AnyWar.PVE)
        {
            //新手引导的时候不出现暂停按钮
            if (Core.Data.guideManger.isGuiding)
            {
                PauseGo.SetActive(false);
                SpeedUpGo.SetActive(false);
                AutoGo.SetActive(false);
            }
            else
            {
                PauseGo.SetActive(true);
                SpeedUpGo.SetActive(true);
                AutoGo.SetActive(true);
            }

            if (temp.currentBattleType == TemporyData.BattleType.FightWithFulisa)
            {
                PauseGo.SetActive(false);
                SpeedUpGo.SetActive(false);
                AutoGo.SetActive(false);
            }

            SkipGo.SetActive(false);

            if (temp.clientDataResp != null && temp.clientDataResp.data != null && temp.clientDataResp.data.warInfo != null)
            {
                War = new BT_Logical(temp.clientDataResp.data.warInfo);
                if (War.LocalMode)
                {
                    if (War.StepMode)
                    {
                        War.startWarOfWarBegin();

                        War.RegisterLogicalCmp(ReadFromLocal);
                    }
                    else
                    {
                        War.startWar();
                        War.EndWar();
                    }
                }
            }
        }
        else             // is a PVP war

        {
            PauseGo.SetActive(false);
            SpeedUpGo.SetActive(false);
            AutoGo.SetActive(false);
            //新手引导不应该有跳过
            if (Core.Data.guideManger.isGuiding)
            {
                SkipGo.SetActive(false);
            }
            else
            {
                SkipGo.SetActive(true);
            }

            //世界战斗 也应该出现怒气技能释放的按钮
            if (temp.currentBattleType == TemporyData.BattleType.WorldBossWar)
            {
                attackSideInfo.PlayerAngryBtn.gameObject.SetActive(false);
            }
        }

        //展示3D场景
        show3DScene();

        //一场战斗连击数的统计
        temp.hasLiquidate         = false;
        temp.SkipBattle           = false;
        temp.GiveUpBattle         = false;
        temp.ForceWriteCombo      = 0;
        main3DManager.NotifyCombo = (combo) => { hitCCMgr.RecordCombo(combo); };

        KilledEnemyArray = new List <int>();

        AutoJustice();

        //重置时间的管理器
        TimeMgr.getInstance().Reset();
    }