From dd8da33e997b4ff8320edc544158b598eadd11ae Mon Sep 17 00:00:00 2001 From: Andrei Gavra Date: Mon, 5 Aug 2019 21:50:53 +0300 Subject: [PATCH 1/4] Fix enemy spawn position --- Assets/Scripts/src/Level/LevelManager.cs | 6 +++++- Assets/TextMesh Pro.meta | 8 -------- ProjectSettings/ProjectVersion.txt | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 Assets/TextMesh Pro.meta diff --git a/Assets/Scripts/src/Level/LevelManager.cs b/Assets/Scripts/src/Level/LevelManager.cs index dfbc436..48cf65f 100644 --- a/Assets/Scripts/src/Level/LevelManager.cs +++ b/Assets/Scripts/src/Level/LevelManager.cs @@ -12,6 +12,10 @@ namespace src.Level { public class LevelManager : GameplayComponent, IDynamicLevelData { + /** Extracted them here for easy to change reason */ + private const int XMinEnemyPosition = 5; + private const int YMinEnemyPosition = -5; + public Count DestructibleWallCount { get => _destructibleWallCount; @@ -204,13 +208,13 @@ namespace src.Level var numberOfEnemiesToPlace = _enemyCount.RandomIntRange(); _freeGridPositions.ShuffleList(); + _freeGridPositions.RemoveAll(pos => pos.x <= XMinEnemyPosition && pos.y >= YMinEnemyPosition); foreach (var nextPosition in _freeGridPositions) { if (numberOfEnemiesToPlace == 0) { break; } - PlaceEnemy(nextPosition); numberOfEnemiesToPlace -= 1; } diff --git a/Assets/TextMesh Pro.meta b/Assets/TextMesh Pro.meta deleted file mode 100644 index f9da8b5..0000000 --- a/Assets/TextMesh Pro.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f54d1bd14bd3ca042bd867b519fee8cc -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index c19a8ba..90c2f6e 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2018.4.3f1 +m_EditorVersion: 2018.4.5f1 From 7ff62dd5ae93833b87c3c25328e530a742cfaa5a Mon Sep 17 00:00:00 2001 From: Andrei Gavra Date: Mon, 5 Aug 2019 21:50:53 +0300 Subject: [PATCH 2/4] Fix enemy spawn position --- Assets/Scripts/src/Level/LevelManager.cs | 6 +++++- Assets/TextMesh Pro.meta | 8 -------- ProjectSettings/ProjectVersion.txt | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 Assets/TextMesh Pro.meta diff --git a/Assets/Scripts/src/Level/LevelManager.cs b/Assets/Scripts/src/Level/LevelManager.cs index dfbc436..61efa28 100644 --- a/Assets/Scripts/src/Level/LevelManager.cs +++ b/Assets/Scripts/src/Level/LevelManager.cs @@ -12,6 +12,10 @@ namespace src.Level { public class LevelManager : GameplayComponent, IDynamicLevelData { + /** Extracted them here for easy to change reason */ + private const int XMaxEnemyPosition = 5; + private const int YMinEnemyPosition = -5; + public Count DestructibleWallCount { get => _destructibleWallCount; @@ -204,13 +208,13 @@ namespace src.Level var numberOfEnemiesToPlace = _enemyCount.RandomIntRange(); _freeGridPositions.ShuffleList(); + _freeGridPositions.RemoveAll(pos => pos.x <= XMaxEnemyPosition && pos.y >= YMinEnemyPosition); foreach (var nextPosition in _freeGridPositions) { if (numberOfEnemiesToPlace == 0) { break; } - PlaceEnemy(nextPosition); numberOfEnemiesToPlace -= 1; } diff --git a/Assets/TextMesh Pro.meta b/Assets/TextMesh Pro.meta deleted file mode 100644 index f9da8b5..0000000 --- a/Assets/TextMesh Pro.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f54d1bd14bd3ca042bd867b519fee8cc -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index c19a8ba..90c2f6e 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2018.4.3f1 +m_EditorVersion: 2018.4.5f1 From 6e4eafd369da0cbe95dafc8805301bdf5510a6f1 Mon Sep 17 00:00:00 2001 From: Andrei Gavra Date: Tue, 6 Aug 2019 19:48:10 +0300 Subject: [PATCH 3/4] Try --- Assets/Scripts/src/Level/LevelManager.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Assets/Scripts/src/Level/LevelManager.cs b/Assets/Scripts/src/Level/LevelManager.cs index 61efa28..d193772 100644 --- a/Assets/Scripts/src/Level/LevelManager.cs +++ b/Assets/Scripts/src/Level/LevelManager.cs @@ -206,7 +206,6 @@ namespace src.Level private void SetupLevelEnemies() { var numberOfEnemiesToPlace = _enemyCount.RandomIntRange(); - _freeGridPositions.ShuffleList(); _freeGridPositions.RemoveAll(pos => pos.x <= XMaxEnemyPosition && pos.y >= YMinEnemyPosition); foreach (var nextPosition in _freeGridPositions) From 1f4a1f91587f1751b77f2c90cf5f29cad946dd13 Mon Sep 17 00:00:00 2001 From: Andrei Gavra Date: Tue, 6 Aug 2019 19:59:07 +0300 Subject: [PATCH 4/4] Try2 --- Assets/TextMesh Pro.meta | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Assets/TextMesh Pro.meta diff --git a/Assets/TextMesh Pro.meta b/Assets/TextMesh Pro.meta new file mode 100644 index 0000000..f9da8b5 --- /dev/null +++ b/Assets/TextMesh Pro.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f54d1bd14bd3ca042bd867b519fee8cc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: