示例#1
0
        //结束游戏
        void Lose()
        {
            roundState     = RoundStateType.Unstart;
            lastRoundState = LastRoundStateType.Lose;

            //通知Director,结束当前回合
            (this.gameObject.GetComponent(typeof(Director)) as Director).EndCurrentRound();
        }
示例#2
0
 public void Reset()
 {
     //初始化回合数据
     mySocreController.Reset();
     roundState      = RoundStateType.Unstart;
     level           = 1;
     timeNextDisk    = -1;
     scoreEveryLevel = 100;
 }
示例#3
0
        void ChangeRoundState(RoundStateType state)
        {
            _roundState = state;
            switch (_roundState)
            {
            case RoundStateType.Stop:

                if (fighter1RoundWon >= maxRoundWon ||
                    fighter2RoundWon >= maxRoundWon)
                {
                    GameManager.Instance.LoadTitleScene();
                }

                break;

            case RoundStateType.Intro:

                fighter1.SetupBattleStart(fighterDataList[0], new Vector2(-2f, 0f), true);
                fighter2.SetupBattleStart(fighterDataList[0], new Vector2(2f, 0f), false);

                timer = introStateTime;

                roundUIAnimator.SetTrigger("RoundStart");

                if (GameManager.Instance.isVsCPU)
                {
                    battleAI = new BattleAI(this);
                }

                break;

            case RoundStateType.Fight:

                roundStartTime = Time.fixedTime;
                frameCount     = -1;

                currentRecordingInputIndex = 0;

                break;

            case RoundStateType.KO:

                timer = koStateTime;

                CopyLastRoundInput();

                fighter1.ClearInput();
                fighter2.ClearInput();

                battleAI = null;

                roundUIAnimator.SetTrigger("RoundEnd");

                break;

            case RoundStateType.End:

                timer = endStateTime;

                var deadFighter = _fighters.FindAll((f) => f.isDead);
                if (deadFighter.Count == 1)
                {
                    if (deadFighter[0] == fighter1)
                    {
                        fighter2RoundWon++;
                        fighter2.RequestWinAction();
                    }
                    else if (deadFighter[0] == fighter2)
                    {
                        fighter1RoundWon++;
                        fighter1.RequestWinAction();
                    }
                }

                break;
            }
        }
示例#4
0
 //开始当前等级游戏
 void StartGame()
 {
     roundState = RoundStateType.Start;
     timeLeft   = timeEveryLevel; //游戏计时
     ArrangeNextDisk();
 }
示例#5
0
 //结束当前等级,等待进入下一等级
 void EndThisLevel()
 {
     roundState = RoundStateType.NextLevel;
     mySocreController.Reset();
 }