From 7a11fd1d0bb642d3a492a9a8838223b72130cc42 Mon Sep 17 00:00:00 2001 From: Piegames <14054505+piegamesde@users.noreply.github.com> Date: Tue, 24 Apr 2018 03:19:58 +0200 Subject: [PATCH] FINALLY fixed spawn count --- .gitignore | 4 ++++ Assets/Scripts/Generation/DungeonGenerator.cs | 5 ++++- Assets/Scripts/Room.cs | 2 -- Assets/graphics/textures/car.meta | 8 ++++++++ Assets/graphics/textures/tmp.meta | 8 ++++++++ 5 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 Assets/graphics/textures/car.meta create mode 100644 Assets/graphics/textures/tmp.meta diff --git a/.gitignore b/.gitignore index b3e88a7..c0a4674 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/Assets/Scripts/Generation/DungeonGenerator.cs b/Assets/Scripts/Generation/DungeonGenerator.cs index c5fe8ce..1c5d3fa 100644 --- a/Assets/Scripts/Generation/DungeonGenerator.cs +++ b/Assets/Scripts/Generation/DungeonGenerator.cs @@ -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 lg = new List(); 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 lg = new List(); 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 lg = new List(); 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]); } diff --git a/Assets/Scripts/Room.cs b/Assets/Scripts/Room.cs index 2dd6a95..d3382ac 100644 --- a/Assets/Scripts/Room.cs +++ b/Assets/Scripts/Room.cs @@ -77,8 +77,6 @@ public class Room : MonoBehaviour { foreach ( Transform t in spawnpointRootObject.GetComponentsInChildren() ) { 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); diff --git a/Assets/graphics/textures/car.meta b/Assets/graphics/textures/car.meta new file mode 100644 index 0000000..8504594 --- /dev/null +++ b/Assets/graphics/textures/car.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9ec323b9157704d00a3409f8ea6e46b2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/graphics/textures/tmp.meta b/Assets/graphics/textures/tmp.meta new file mode 100644 index 0000000..7ebab68 --- /dev/null +++ b/Assets/graphics/textures/tmp.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: df6e7833427b5497b92308fb6f54e552 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: