diff --git a/Assets/Scripts/src/Base/UpgradeBase.cs b/Assets/Scripts/src/Base/UpgradeBase.cs index 3bb7281..0c6084b 100644 --- a/Assets/Scripts/src/Base/UpgradeBase.cs +++ b/Assets/Scripts/src/Base/UpgradeBase.cs @@ -8,13 +8,11 @@ namespace src.Base { public class UpgradeBase : GameplayComponent, IUpgrade { - protected GameManager gameManager; private UpgradeManager _upgradeManager; - protected PlayerController _playerToUpgrade; + protected PlayerController PlayerToUpgrade; public void Start() { - gameManager = GameManager.instance; _upgradeManager = UpgradeManager.instance; } @@ -26,7 +24,7 @@ namespace src.Base public void OnTriggerEnter2D(Collider2D other) { if (!other.CompareTag("Player")) return; - _playerToUpgrade = other.GetComponent(); + PlayerToUpgrade = other.GetComponent(); PerformUpgrade(); _upgradeManager.ClaimUpgrade(gameObject); Destroy(gameObject); diff --git a/Assets/Scripts/src/Managers/GameManager.cs b/Assets/Scripts/src/Managers/GameManager.cs index defa782..408849e 100644 --- a/Assets/Scripts/src/Managers/GameManager.cs +++ b/Assets/Scripts/src/Managers/GameManager.cs @@ -9,7 +9,7 @@ namespace src.Managers { public class GameManager : MonoBehaviour { - public static GameManager instance; + public static GameManager Instance; // Inner Components private PlayerController _playerController; @@ -19,11 +19,11 @@ namespace src.Managers public void Awake() { - if (instance == null) + if (Instance == null) { - instance = this; + Instance = this; } - else if (instance != null) + else if (Instance != null) { Destroy(gameObject); } diff --git a/Assets/Scripts/src/Upgrade/BombFlamesUpgrade.cs b/Assets/Scripts/src/Upgrade/BombFlamesUpgrade.cs index f1329ad..3bb38bc 100644 --- a/Assets/Scripts/src/Upgrade/BombFlamesUpgrade.cs +++ b/Assets/Scripts/src/Upgrade/BombFlamesUpgrade.cs @@ -7,7 +7,7 @@ namespace src.Upgrade { public override void PerformUpgrade() { - var bombManager = _playerToUpgrade.GetComponent(); + var bombManager = PlayerToUpgrade.GetComponent(); bombManager.IncreasePower(); } } diff --git a/Assets/Scripts/src/Upgrade/BombPlacementUpgrade.cs b/Assets/Scripts/src/Upgrade/BombPlacementUpgrade.cs index dc48aa8..b3ad476 100644 --- a/Assets/Scripts/src/Upgrade/BombPlacementUpgrade.cs +++ b/Assets/Scripts/src/Upgrade/BombPlacementUpgrade.cs @@ -7,7 +7,7 @@ namespace src.Upgrade { public override void PerformUpgrade() { - var bombManager = _playerToUpgrade.GetComponent(); + var bombManager = PlayerToUpgrade.GetComponent(); bombManager.IncreaseAllowedBombs(); } } diff --git a/Assets/Scripts/src/Upgrade/GoldenBombUpgrade.cs b/Assets/Scripts/src/Upgrade/GoldenBombUpgrade.cs index 104a318..4a60c1d 100644 --- a/Assets/Scripts/src/Upgrade/GoldenBombUpgrade.cs +++ b/Assets/Scripts/src/Upgrade/GoldenBombUpgrade.cs @@ -8,7 +8,7 @@ namespace src.Upgrade { public override void PerformUpgrade() { - var bombManager = _playerToUpgrade.GetComponent(); + var bombManager = PlayerToUpgrade.GetComponent(); bombManager.IncreaseAllowedBombs(); bombManager.IncreasePower(); } diff --git a/Assets/Scripts/src/Upgrade/PlayerSpeedUpgrade.cs b/Assets/Scripts/src/Upgrade/PlayerSpeedUpgrade.cs index 76fc482..3462619 100644 --- a/Assets/Scripts/src/Upgrade/PlayerSpeedUpgrade.cs +++ b/Assets/Scripts/src/Upgrade/PlayerSpeedUpgrade.cs @@ -7,7 +7,7 @@ namespace src.Upgrade { public override void PerformUpgrade() { - var player = _playerToUpgrade.GetComponent(); + var player = PlayerToUpgrade.GetComponent(); player.IncreaseSpeed(.5f); } } diff --git a/Assets/Scripts/src/Wall/DestructibleWall.cs b/Assets/Scripts/src/Wall/DestructibleWall.cs index 5c64c44..fd373e3 100644 --- a/Assets/Scripts/src/Wall/DestructibleWall.cs +++ b/Assets/Scripts/src/Wall/DestructibleWall.cs @@ -16,7 +16,7 @@ namespace src.Wall private void Start() { - _upgradeManager = GameManager.instance.GetUpgradeManager(); + _upgradeManager = GameManager.Instance.GetUpgradeManager(); _explosionPrefab = PrefabAtlas.BombExplosion; _exitDoorPrefab = PrefabAtlas.ExitDoor; } diff --git a/Assets/Scripts/src/Wall/ExitDoor.cs b/Assets/Scripts/src/Wall/ExitDoor.cs index db16603..6eeeade 100644 --- a/Assets/Scripts/src/Wall/ExitDoor.cs +++ b/Assets/Scripts/src/Wall/ExitDoor.cs @@ -12,7 +12,7 @@ namespace src.Wall private void Start() { - _gameManager = GameManager.instance; + _gameManager = GameManager.Instance; } /* Trigger the next level and destroy itself. */