// 回调函数
    public void SSEventAction(SSAction source, SSActionEventType events = SSActionEventType.COMPLETED,
                              int intParam = 0, string strParam = null, Object objParam = null)
    {
        if (events == SSActionEventType.COMPLETED)
        // 落到y轴以下
        {
            isLose = true;
            sumNum--;
        }
        else
        {
            sumNum--;
        }

        if (sumNum == 0)
        // 如果本回合结束
        {
            SceneController scene = Singleton <SceneController> .Instance;
            if (isLose)
            {
                centerText.text = "LOSE";
                scene.nowState  = Status.OVER;
            }
            else
            {
                RoundController round = Singleton <RoundController> .Instance;
                round.NextRound();
                scene.nowState = Status.WATING;
            }
        }
    }
    void LateUpdate()
    {
        if (roundStart)
        {
            totalEnemies = enemyModifier * round;
            StartCoroutine(SpawnEnemies());
            roundStart = false;
        }

        int aliveEnemies = 0;

        foreach (ZombieEnemy_DamageReceiver enemy in enemyContainer.GetComponentsInChildren <ZombieEnemy_DamageReceiver>())
        {
            if (enemy.Dead == false)
            {
                aliveEnemies++;
            }
        }

        if (aliveEnemies == 0 && spawnedEnemies == totalEnemies)
        {
            roundController.NextRound();
        }
    }
Exemple #3
0
 public void NextRound()
 {
     roundController.NextRound();
 }