-
-
Save Xiaoy312/f600c48d814982bccac1ed80586efbff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region fix #1 | |
// ObstacleSpawnerBase: change IEnumerable<WaitForSeconds> to IEnumerable | |
protected abstract IEnumerable SpawnObstaclesImpl(); | |
#endregion | |
#region fix #2 | |
// ObstacleSpawnerBase: change IEnumerable<WaitForSeconds> to IEnumerator | |
protected abstract IEnumerator SpawnObstaclesImpl(); | |
// ObstacleSpawnerBase.SpawnObstacles: | |
IEnumerator SpawnObstacles() | |
{ | |
yield return new WaitForSeconds(obstacle.startGameWait); | |
while (true) | |
{ | |
var etor = SpawnObstaclesImpl(); | |
while (etor.MoveNext()) | |
yield return new WaitForSeconds(obstacle.spawnWait); | |
yield return new WaitForSeconds(obstacle.waveSpawnWait); | |
} | |
} | |
// in the "core implementation": change IEnumerable to IEnumerator | |
#endregion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry I was out of town today and didn't have my computer on me. So for clarification, the classes in the ObstacleSpawnerBase script do NOT have to be abstract? And the image under your sentence "So either group them under a single file:", the C# script name would be entitled "ObstacleSpawners"? And what do the "{ /.../ }" mean? Sorry I keep dragging this on I just want to learn as much as possible :) @Xiaoy312