Beispiel #1
0
        private IEnumerator RunTest()
        {
            //创建战斗(数据)
            singleBattle = BattleFieldCreator.Instance.Create(
                mapSize.x, mapSize.y,
                obstacleCount, obstacleGap, buffCount, itemCount,
                teamA, teamB);

            for (int i = 0; i < battleTestCount; ++i)
            {
#if UNITY_EDITOR
                UnityEditor.EditorUtility.DisplayProgressBar("战斗计算", string.Format("战斗场次计算进度 {0}/{1}", i + 1, battleTestCount), (i + 1) * 1f / battleTestCount);
#endif

                singleBattle.ResetBattle();

                singleBattle.Run();

                //如果运算出现问题,播放一下有问题的场
                if (singleBattle.battleState == BattleState.Exception)
                {
                    singleBattle.ConnectRenderer(BattleFieldRenderer.Instance);
                    BattleFieldRenderer.Instance.PlayBattle(null);
                    yield return(EGameConstL.WaitForTouchScreen);
                }

                yield return(null);
            }
#if UNITY_EDITOR
            UnityEditor.EditorUtility.ClearProgressBar();
#endif
        }
Beispiel #2
0
 public void ResetBattleField()
 {
     StopAllCoroutines();
     battleField.ResetBattle();
     currentActionIndex = 0;
     SetCircularRangeRenderStateActive(false, GridRenderType.SkillEffectRange);
     SetGridsRenderStateActive(false);
     battleField.Run();
 }