diff --git a/Assets/Prefabs/Bomb.prefab b/Assets/DevMocks/Bomb.prefab similarity index 98% rename from Assets/Prefabs/Bomb.prefab rename to Assets/DevMocks/Bomb.prefab index c20d4d6..57a469e 100644 --- a/Assets/Prefabs/Bomb.prefab +++ b/Assets/DevMocks/Bomb.prefab @@ -161,7 +161,7 @@ BoxCollider2D: m_IsTrigger: 1 m_UsedByEffector: 0 m_UsedByComposite: 0 - m_Offset: {x: 0.009168625, y: 0.045985222} + m_Offset: {x: 0.5, y: 0.5} m_SpriteTilingProperty: border: {x: 0, y: 0, z: 0, w: 0} pivot: {x: 0, y: 0} @@ -172,5 +172,5 @@ BoxCollider2D: adaptiveTiling: 0 m_AutoTiling: 0 serializedVersion: 2 - m_Size: {x: 1.1100235, y: 0.90802956} + m_Size: {x: 1, y: 1} m_EdgeRadius: 0 diff --git a/Assets/Prefabs/Bomb.prefab.meta b/Assets/DevMocks/Bomb.prefab.meta similarity index 100% rename from Assets/Prefabs/Bomb.prefab.meta rename to Assets/DevMocks/Bomb.prefab.meta diff --git a/Assets/Prefabs/Explosion.prefab b/Assets/DevMocks/Explosion.prefab similarity index 100% rename from Assets/Prefabs/Explosion.prefab rename to Assets/DevMocks/Explosion.prefab diff --git a/Assets/Prefabs/Explosion.prefab.meta b/Assets/DevMocks/Explosion.prefab.meta similarity index 100% rename from Assets/Prefabs/Explosion.prefab.meta rename to Assets/DevMocks/Explosion.prefab.meta diff --git a/Assets/DevMocks/ParticleSpriteAtlas.png.meta b/Assets/DevMocks/ParticleSpriteAtlas.png.meta index 0083172..15e418c 100644 --- a/Assets/DevMocks/ParticleSpriteAtlas.png.meta +++ b/Assets/DevMocks/ParticleSpriteAtlas.png.meta @@ -137,8 +137,8 @@ TextureImporter: y: 253 width: 128 height: 131 - alignment: 9 - pivot: {x: -0.005050569, y: 0.49665892} + alignment: 6 + pivot: {x: 0, y: 0} border: {x: 0, y: 0, z: 0, w: 0} outline: [] physicsShape: [] diff --git a/Assets/DevMocks/bomb1.png.meta b/Assets/DevMocks/bomb1.png.meta index 82da64c..3a79d29 100644 --- a/Assets/DevMocks/bomb1.png.meta +++ b/Assets/DevMocks/bomb1.png.meta @@ -43,7 +43,7 @@ TextureImporter: spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 - alignment: 4 + alignment: 6 spritePivot: {x: 0.5, y: 0.5} spritePixelsToUnits: 32 spriteBorder: {x: 0, y: 0, z: 0, w: 0} diff --git a/Assets/Scenes/BombScene.unity b/Assets/Scenes/BombScene.unity index bca7137..7b8d3dc 100644 --- a/Assets/Scenes/BombScene.unity +++ b/Assets/Scenes/BombScene.unity @@ -492,7 +492,7 @@ GameObject: - component: {fileID: 1057764287} - component: {fileID: 1057764286} - component: {fileID: 1057764285} - m_Layer: 0 + m_Layer: 8 m_Name: Tilemap m_TagString: Untagged m_Icon: {fileID: 0} diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 11c56ac..ea97fe5 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -141,7 +141,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 69346940} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.5, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 585332173} diff --git a/Assets/Scripts/src/Ammo/BombController.cs b/Assets/Scripts/src/Ammo/BombController.cs index 53d8f55..0c516be 100644 --- a/Assets/Scripts/src/Ammo/BombController.cs +++ b/Assets/Scripts/src/Ammo/BombController.cs @@ -6,7 +6,7 @@ public class BombController : MonoBehaviour, IExplosable { public GameObject explosionPrefab; - BombStatsUtil bombStatsUtil = BombStatsUtil.Instance; + BombStatsManager bombStatsUtil = BombStatsManager.Instance; bool exploded = false; // Start is called before the first frame update @@ -29,10 +29,6 @@ public class BombController : MonoBehaviour, IExplosable exploded = true; Destroy(gameObject, 0.3f); - //GameObject bombObject = Instantiate(explosionPrefab, transform.position, Quaternion.identity); - //bombObject.GetComponent().Explode(transform.position); - - Destroy(gameObject); } private IEnumerator CreateExplosions(Vector3 direction) @@ -46,7 +42,6 @@ public class BombController : MonoBehaviour, IExplosable } else { - Debug.Log("Collided with something"); break; } diff --git a/Assets/Scripts/src/Ammo/Explosion.cs b/Assets/Scripts/src/Ammo/Explosion.cs index 4746de8..ca22366 100644 --- a/Assets/Scripts/src/Ammo/Explosion.cs +++ b/Assets/Scripts/src/Ammo/Explosion.cs @@ -4,7 +4,7 @@ using UnityEngine; public class Explosion : MonoBehaviour { - BombStatsUtil bombUtil = BombStatsUtil.Instance; + BombStatsManager bombUtil = BombStatsManager.Instance; public void Start() { diff --git a/Assets/Scripts/src/Base/PlayerBase.cs b/Assets/Scripts/src/Base/PlayerBase.cs index fb97ef8..99d68b0 100644 --- a/Assets/Scripts/src/Base/PlayerBase.cs +++ b/Assets/Scripts/src/Base/PlayerBase.cs @@ -25,7 +25,7 @@ namespace src.Base public void onExplosion() { - Debug.Log("Player hit by explosion"); + // Debug.Log("Player hit by explosion"); } } } \ No newline at end of file diff --git a/Assets/Scripts/src/Util/BombStatsUtil.cs b/Assets/Scripts/src/Managers/BombStatsManager.cs similarity index 70% rename from Assets/Scripts/src/Util/BombStatsUtil.cs rename to Assets/Scripts/src/Managers/BombStatsManager.cs index 2f77143..b6af6d1 100644 --- a/Assets/Scripts/src/Util/BombStatsUtil.cs +++ b/Assets/Scripts/src/Managers/BombStatsManager.cs @@ -1,10 +1,10 @@ using System.Collections; using System.Collections.Generic; -public sealed class BombStatsUtil +public sealed class BombStatsManager { - private static readonly BombStatsUtil instance = new BombStatsUtil(); + private static readonly BombStatsManager instance = new BombStatsManager(); const int MAX_POWER = 7; public int Power { get; private set; } = 3; @@ -13,11 +13,11 @@ public sealed class BombStatsUtil public float ExplosionDuration { get; } = 0.55f; - private BombStatsUtil() + private BombStatsManager() { } - public static BombStatsUtil Instance + public static BombStatsManager Instance { get { diff --git a/Assets/Scripts/src/Util/BombStatsUtil.cs.meta b/Assets/Scripts/src/Managers/BombStatsManager.cs.meta similarity index 100% rename from Assets/Scripts/src/Util/BombStatsUtil.cs.meta rename to Assets/Scripts/src/Managers/BombStatsManager.cs.meta diff --git a/Assets/Scripts/src/Player/PlayerController.cs b/Assets/Scripts/src/Player/PlayerController.cs index 230bef2..171bb2a 100644 --- a/Assets/Scripts/src/Player/PlayerController.cs +++ b/Assets/Scripts/src/Player/PlayerController.cs @@ -11,8 +11,6 @@ namespace src.Player public GameObject bombPrefab; - public Tilemap tilemap; - protected new void Start() { base.Start(); @@ -59,10 +57,9 @@ namespace src.Player private void PlaceBomb() { - Vector3Int cell = tilemap.WorldToCell(transform.position); - Vector3 cellCenterPos = tilemap.GetCellCenterWorld(cell); - - Instantiate(bombPrefab, cellCenterPos, Quaternion.identity); + var absX = Mathf.RoundToInt(transform.position.x); + var absY = Mathf.RoundToInt(transform.position.y); + Instantiate(bombPrefab, new Vector3(absX, absY, 0), Quaternion.identity); } private void HandleBomb()