FINALLY fixed spawn count
This commit is contained in:
parent
3b5a9288e7
commit
7a11fd1d0b
5 changed files with 24 additions and 3 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -101,3 +101,7 @@ $RECYCLE.BIN/
|
|||
|
||||
|
||||
# End of https://www.gitignore.io/api/macos,linux,windows
|
||||
|
||||
Assets/graphics/textures/car\.meta
|
||||
|
||||
Assets/graphics/textures/tmp\.meta
|
||||
|
|
|
@ -444,7 +444,7 @@ public class DungeonGenerator {
|
|||
}
|
||||
}
|
||||
}
|
||||
//Debug.Log(r.GetCenter() + " " + r.spawnpoints.Count + " spawn points.");
|
||||
Debug.Log(r.GetCenter() + " " + r.spawnpoints.Count + " spawn points.");
|
||||
}
|
||||
|
||||
public static void GenerateObjective(Room r) {
|
||||
|
@ -458,6 +458,7 @@ public class DungeonGenerator {
|
|||
// Scorpion Attack!!!!:
|
||||
List<GameObject> lg = new List<GameObject>();
|
||||
int count = Math.Min(UnityEngine.Random.Range(1, ( int ) Mathf.Floor(r.GetSpawnpoints().Count)), 5);
|
||||
Debug.Log(count + " scorpions (of " + r.GetSpawnpoints().Count);
|
||||
for ( int c = 0; c < count; c++ ) {
|
||||
lg.Add(enemyPrefabs[Entity.Entities.SCORPION]);
|
||||
}
|
||||
|
@ -469,6 +470,7 @@ public class DungeonGenerator {
|
|||
// Bug Attack!!!!:
|
||||
List<GameObject> lg = new List<GameObject>();
|
||||
int count = Math.Min(UnityEngine.Random.Range(1, ( int ) Mathf.Floor(r.GetSpawnpoints().Count)), 10);
|
||||
Debug.Log(count + " bugs (of " + r.GetSpawnpoints().Count);
|
||||
for ( int c = 0; c < count; c++ ) {
|
||||
lg.Add(enemyPrefabs[Entity.Entities.BUG]);
|
||||
}
|
||||
|
@ -480,6 +482,7 @@ public class DungeonGenerator {
|
|||
// Coins!!!!:
|
||||
List<GameObject> lg = new List<GameObject>();
|
||||
int count = Math.Min(UnityEngine.Random.Range(1, (int) Mathf.Floor(r.GetSpawnpoints().Count)), 20);
|
||||
Debug.Log(count + " coins (of " + r.GetSpawnpoints().Count);
|
||||
for ( int c = 0; c < count; c++ ) {
|
||||
lg.Add(enemyPrefabs[Entity.Entities.COIN]);
|
||||
}
|
||||
|
|
|
@ -77,8 +77,6 @@ public class Room : MonoBehaviour {
|
|||
foreach ( Transform t in spawnpointRootObject.GetComponentsInChildren<Transform>() ) {
|
||||
if ( t.gameObject != spawnpointRootObject ) {
|
||||
spawnpoints.Add(t);
|
||||
if (spawnpoints.Count >= 5)
|
||||
break; // TODO make this depend on the objective
|
||||
}
|
||||
}
|
||||
//Debug.Log("[ROOMS] Spawnpoints: " + spawnpoints.Count);
|
||||
|
|
8
Assets/graphics/textures/car.meta
Normal file
8
Assets/graphics/textures/car.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9ec323b9157704d00a3409f8ea6e46b2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/graphics/textures/tmp.meta
Normal file
8
Assets/graphics/textures/tmp.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: df6e7833427b5497b92308fb6f54e552
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Reference in a new issue