예제 #1
0
 private void SpawnGroundEnemies(PlatformSection newPlatform)
 {
     Vector3[] enemyPositions = newPlatform.GetEnemySpawnPoints(Random.Range(1, 4));
     if (enemyPositions != null)
     {
         for (int i = 0; i < enemyPositions.Length; i++)
         {
             enemyManager.SpawnGroundEnemy(enemyPositions[i]);
         }
     }
 }
예제 #2
0
    private void ActivateNewPlatform()
    {
        PlatformSection newPlatform = platformSections[currentSections[GameplayConstants.MAXIMUM_SECTIONS - 1]];

        float jumpScalar = GetJumpScalar();

        var oldEndDistance = currentEndDistance;
        var range          = jumpScalar * jumpDistance;

        currentEndDistance = newPlatform.MoveAndActivate(currentEndDistance + range);

        _enemyManager.SpawnAirEnemy(new Vector2(oldEndDistance + range / 2, 8), range, false);
        var spawnPoints = newPlatform.GetEnemySpawnPoints();

        if (spawnPoints != null && spawnPoints.Length > 0)
        {
            _enemyManager.SpawnGroundEnemy(spawnPoints[Random.Range(0, spawnPoints.Length - 1)]);
        }
    }