diff --git a/Assets/Prefabs/Explosion.prefab b/Assets/Prefabs/Explosion.prefab index b1398a8..189eda4 100644 --- a/Assets/Prefabs/Explosion.prefab +++ b/Assets/Prefabs/Explosion.prefab @@ -1,6 +1,6 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1 &7698221246229025840 +--- !u!1 &3527468927952399082 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -8,46 +8,45 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 7698221246229025836} - - component: {fileID: 7698221246229025839} - - component: {fileID: 7698221246229025838} - - component: {fileID: 7698221246229025841} + - component: {fileID: 8302018831448756210} + - component: {fileID: 4021005470752642242} + - component: {fileID: 2520958024087343749} m_Layer: 0 - m_Name: Explosion + m_Name: Mesh m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &7698221246229025836 +--- !u!4 &8302018831448756210 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7698221246229025840} - m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_GameObject: {fileID: 3527468927952399082} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.2, y: 1.72, z: 1.2} + m_LocalScale: {x: 1, y: 1.72, z: 1} m_Children: [] - m_Father: {fileID: 0} + m_Father: {fileID: 7698221246229025836} m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} ---- !u!33 &7698221246229025839 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4021005470752642242 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7698221246229025840} + m_GameObject: {fileID: 3527468927952399082} m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} ---- !u!23 &7698221246229025838 +--- !u!23 &2520958024087343749 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7698221246229025840} + m_GameObject: {fileID: 3527468927952399082} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -80,6 +79,38 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 +--- !u!1 &7698221246229025840 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7698221246229025836} + - component: {fileID: 7698221246229025841} + m_Layer: 0 + m_Name: Explosion + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7698221246229025836 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7698221246229025840} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.2, y: 1, z: 1.2} + m_Children: + - {fileID: 8302018831448756210} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} --- !u!136 &7698221246229025841 CapsuleCollider: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Arena.cs b/Assets/Scripts/Arena.cs index 9f144a0..a0bb856 100644 --- a/Assets/Scripts/Arena.cs +++ b/Assets/Scripts/Arena.cs @@ -16,7 +16,9 @@ public class Arena : MonoBehaviour { var newRotation = Quaternion.Euler(rotation.eulerAngles + Vector3.up * i * 60f); var explosion = Instantiate(explosionPrefab, explosionPos, newRotation); - //TODO multiply explosion.transform.scale.y by strength + + explosion.GetComponent().height = 2f * strength * data.hexHeight; + explosion.transform.GetChild(0).localScale = new Vector3(1f, strength * data.hexHeight, 1f); Destroy(explosion, 1f); } diff --git a/Assets/Scripts/MapData.cs b/Assets/Scripts/MapData.cs index c290a59..37d2186 100644 --- a/Assets/Scripts/MapData.cs +++ b/Assets/Scripts/MapData.cs @@ -33,6 +33,8 @@ public class MapData : ScriptableObject { }*/ public float hexSize = 1f; + //TODO Make hexSize modify hexHeight on set + public float hexHeight = Mathf.Sqrt(3f); //TODO would be nice if I could store a Matrix2x2 public Vector3 AxialToWorld(Vector2 axial) diff --git a/Assets/Scripts/Player.cs b/Assets/Scripts/Player.cs index 350fd1e..18bcfcc 100644 --- a/Assets/Scripts/Player.cs +++ b/Assets/Scripts/Player.cs @@ -7,6 +7,8 @@ public class Player : MonoBehaviour { public GameObject bombPrefab; public Arena arena; + int strength = 1; + void Start() { Transform canvas = GameObject.Find("Canvas").transform; PlayerLabel label = Instantiate(labelPrefab, canvas).GetComponent(); @@ -22,6 +24,6 @@ public class Player : MonoBehaviour { void OnPlace(InputAction.CallbackContext ctx) { var bomb = Instantiate(bombPrefab, arena.GetClosestTilePos(transform.position) - Vector3.up * 0.5f, bombPrefab.transform.rotation); - bomb.GetComponent().Init(1, arena); + bomb.GetComponent().Init(strength, arena); } } \ No newline at end of file