private void ActivateNewPlatform() { //Debug.Log("ActivateNewPlatform"); PlatformSection newPlatform = platformSections[currentSections[GameplayConstants.MAXIMUM_SECTIONS - 1]]; float jumpScalar = GetJumpScalar(); currentEndDistance = newPlatform.MoveAndActivate(currentEndDistance + jumpScalar * jumpDistance); }
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)]); } }