Esempio n. 1
0
    public void TestStageUpdate()
    {
        if (_TestingStage == null)
        {
            return;
        }

        if (!UIFightBox.IsTestMode())
        {
            UIFightBox.SetTest();
        }

        if (UIStageSucess.IsShow() || UIStageFail.IsShow())
        {
            TestStageInfo testInfo = new TestStageInfo();
            if (UIStageSucess.IsShow())
            {
                testInfo._IsWin = true;
            }
            else
            {
                testInfo._IsWin = false;
            }
            testInfo._Round      = BattleField.Instance._BattleRound - 1;
            testInfo._RemainHP   = (int)(((float)BattleField.Instance._RoleMotion._HP / BattleField.Instance._RoleMotion._MaxHP) * 10);
            testInfo._ElimitTrap = BallBox.Instance._ElimitTrapCnt;
            testInfo._ElimitBomb = BallBox.Instance._ElimitBombCnt;

            ++_TestTimes;
            _TestInfos[_TestingStage].Add(testInfo);
            LogicManager.Instance.ExitFight();

            if (_TestTimes >= _DefaultTestTimes)
            {
                _TestTimes = 0;
                //++_CurIdx;
                //if (_CurIdx >= _TargetIdx)
                {
                    _TestingStage = null;
                    WriteRecords();
                }
                //else
                //{
                //    _TestingStage = StageDataPack.Instance._StageItems[_CurIdx];
                //    _TestInfos.Add(_TestingStage, new List<TestStageInfo>());
                //    StageDataPack.Instance._FightingStage = _TestingStage;
                //    LogicManager.Instance.EnterFight(_TestingStage);
                //}
            }
            else
            {
                StageDataPack.Instance._FightingStage = _TestingStage;
                LogicManager.Instance.EnterFight(_TestingStage);
            }
        }
    }
Esempio n. 2
0
    public IEnumerator MonsterSkillShow(List <DamageResult> damageResults)
    {
        ClearDamageShow();
        foreach (var damageResult in damageResults)
        {
            var   monInfo  = _MonsterShowDict[damageResult._TargetMotion];
            float animTime = monInfo._MonsterModel.PlayAttack();

            yield return(new WaitForSeconds(0.2f));

            if (damageResult._UseSkill is SkillDamage)
            {
                PlayerUISound(_ElimitAttackSound, 1);
            }
            else if (damageResult._UseSkill != null)
            {
                PlayerUISound(_ElimitSkillSound, 1);
            }
            yield return(new WaitForSeconds(animTime - 0.2f));

            _DmgTextNormal.transform.position       = _HPBar.transform.position;
            _DmgTextNormal.transform.localPosition += new Vector3(0, 10, 0);
            _DmgTextNormal.gameObject.SetActive(true);
            _DmgTextNormal.text = "-" + damageResult.DamageValue;

            UpdateSelfHPBar(damageResult._AfterHP);

            if (damageResult._SkillBallsResult != null)
            {
                UIFightBox.ShowMonsterBalls(damageResult._SkillBallsResult);
            }

            yield return(new WaitForSeconds(0.3f));

            ClearDamageShow();

            if (damageResult._AfterHP <= 0 && BattleField.Instance._RoleMotion.IsDied)
            {
                UIStageFail.ShowAsyn();
            }

            yield return(new WaitForSeconds(0.2f));
        }
        RefreshMonsterCD();

        GameCore.Instance.EventController.PushEvent(EVENT_TYPE.EVENT_LOGIC_MONSTER_SKILL_FINISH, this, null);
        UIFightBox.HideOptMask();
        RefreshOptRound();
    }
Esempio n. 3
0
    public void StartShowMonsterSkill(List <DamageResult> damageResult)
    {
        if (UIFightBox.IsTestMode())
        {
            if (BattleField.Instance._RoleMotion._HP <= 0 && BattleField.Instance._RoleMotion.IsDied)
            {
                UIStageFail.ShowAsyn();
            }

            UpdateSelfHPBar(BattleField.Instance._RoleMotion._HP);
            GameCore.Instance.EventController.PushEvent(EVENT_TYPE.EVENT_LOGIC_MONSTER_SKILL_FINISH, this, null);
            return;
        }
        StartCoroutine(MonsterSkillShow(damageResult));
    }
Esempio n. 4
0
    public void TestFightUpdate()
    {
        //return;
        if (!_TestMode)
        {
            return;
        }

        if (UIStageFail.IsShow())
        {
            return;
        }

        if (UIStageSucess.IsShow())
        {
            return;
        }

        if (Time.time - _LastOptTime > _OptWait)
        {
            TestBallMove();
            _LastOptTime = Time.time;
        }
    }
Esempio n. 5
0
 private void BattleFail()
 {
     UIStageFail.ShowAsyn();
     Debug.Log("BattleFail");
 }