diff --git a/.gitignore b/.gitignore index 8076a78..9036222 100644 --- a/.gitignore +++ b/.gitignore @@ -534,7 +534,7 @@ MigrationBackup/ ![Aa]ssets/**/*.meta # Ignore editor plugins -Assets/Plugins/Editor/* +Assets/Plugins/Editor* [Aa]ssets/Plugins/Editor/JetBrains/* # End of https://www.gitignore.io/api/unity,rider,jetbrains,visualstudio,visualstudiocode \ No newline at end of file diff --git a/Assets/Animations/Ammo/Explosion.controller b/Assets/Animations/Ammo/Explosion.controller index aa3fdbd..3a149bb 100644 --- a/Assets/Animations/Ammo/Explosion.controller +++ b/Assets/Animations/Ammo/Explosion.controller @@ -59,7 +59,7 @@ AnimatorStateMachine: m_ChildStates: - serializedVersion: 1 m_State: {fileID: 1102162894460579672} - m_Position: {x: 200, y: 0, z: 0} + m_Position: {x: 240, y: 48, z: 0} m_ChildStateMachines: [] m_AnyStateTransitions: [] m_EntryTransitions: [] diff --git a/Assets/DevMocks/bman_wall.png b/Assets/DevMocks/bman_wall.png deleted file mode 100644 index c62a6c0..0000000 Binary files a/Assets/DevMocks/bman_wall.png and /dev/null differ diff --git a/Assets/DevMocks/bman_wall.prefab b/Assets/DevMocks/exitDoorPrefab.prefab similarity index 50% rename from Assets/DevMocks/bman_wall.prefab rename to Assets/DevMocks/exitDoorPrefab.prefab index a10ea61..702df4e 100644 --- a/Assets/DevMocks/bman_wall.prefab +++ b/Assets/DevMocks/exitDoorPrefab.prefab @@ -1,6 +1,6 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1 &5959564480851182330 +--- !u!1 &1538214466168189615 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -8,38 +8,36 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 5959564480851182334} - - component: {fileID: 5959564480851182333} - - component: {fileID: 5959564480851182332} - - component: {fileID: 5959564480851182331} - m_Layer: 8 - m_Name: bman_wall + - component: {fileID: 3243993883904879596} + - component: {fileID: 3212428174306319952} + m_Layer: 0 + m_Name: exitDoorPrefab m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &5959564480851182334 +--- !u!4 &3243993883904879596 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5959564480851182330} + m_GameObject: {fileID: 1538214466168189615} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 5, y: 0, z: 0} + m_LocalPosition: {x: 10.299996, y: -4.6040254, z: -0.13553935} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!212 &5959564480851182333 +--- !u!212 &3212428174306319952 SpriteRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5959564480851182330} + m_GameObject: {fileID: 1538214466168189615} m_Enabled: 1 m_CastShadows: 0 m_ReceiveShadows: 0 @@ -69,62 +67,15 @@ SpriteRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: 9 - m_Sprite: {fileID: 21300000, guid: 96d3693302b284c92ba9c394bb4f72c1, type: 3} + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: ac1b266a61f9d43feb33de3a91647f99, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 m_FlipY: 0 m_DrawMode: 0 - m_Size: {x: 1, y: 1} + m_Size: {x: 0.32, y: 0.32} m_AdaptiveModeThreshold: 0.5 m_SpriteTileMode: 0 m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!50 &5959564480851182332 -Rigidbody2D: - serializedVersion: 4 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5959564480851182330} - m_BodyType: 2 - m_Simulated: 1 - m_UseFullKinematicContacts: 0 - m_UseAutoMass: 0 - m_Mass: 1 - m_LinearDrag: 0 - m_AngularDrag: 0.05 - m_GravityScale: 0 - m_Material: {fileID: 0} - m_Interpolate: 0 - m_SleepingMode: 1 - m_CollisionDetection: 0 - m_Constraints: 0 ---- !u!61 &5959564480851182331 -BoxCollider2D: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5959564480851182330} - m_Enabled: 1 - m_Density: 1 - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_UsedByEffector: 0 - m_UsedByComposite: 0 - m_Offset: {x: 0.5, y: 0.5} - m_SpriteTilingProperty: - border: {x: 0, y: 0, z: 0, w: 0} - pivot: {x: 0, y: 0} - oldSize: {x: 1, y: 1} - newSize: {x: 1, y: 1} - adaptiveTilingThreshold: 0.5 - drawMode: 0 - adaptiveTiling: 0 - m_AutoTiling: 0 - serializedVersion: 2 - m_Size: {x: 1, y: 1} - m_EdgeRadius: 0 diff --git a/Assets/DevMocks/bman_wall.prefab.meta b/Assets/DevMocks/exitDoorPrefab.prefab.meta similarity index 74% rename from Assets/DevMocks/bman_wall.prefab.meta rename to Assets/DevMocks/exitDoorPrefab.prefab.meta index 3357e82..b98ec03 100644 --- a/Assets/DevMocks/bman_wall.prefab.meta +++ b/Assets/DevMocks/exitDoorPrefab.prefab.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: dd25aabed7c6c491eb405f1e5c5f4d99 +guid: 519235375d069406f909265766078ad0 PrefabImporter: externalObjects: {} userData: diff --git a/Assets/DevMocks/old_door.png b/Assets/DevMocks/old_door.png new file mode 100644 index 0000000..0d7b159 Binary files /dev/null and b/Assets/DevMocks/old_door.png differ diff --git a/Assets/DevMocks/bman_wall.png.meta b/Assets/DevMocks/old_door.png.meta similarity index 96% rename from Assets/DevMocks/bman_wall.png.meta rename to Assets/DevMocks/old_door.png.meta index 8674a7d..c2c003a 100644 --- a/Assets/DevMocks/bman_wall.png.meta +++ b/Assets/DevMocks/old_door.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 96d3693302b284c92ba9c394bb4f72c1 +guid: ac1b266a61f9d43feb33de3a91647f99 TextureImporter: fileIDToRecycleName: {} externalObjects: {} @@ -97,7 +97,7 @@ TextureImporter: outline: [] physicsShape: [] bones: [] - spriteID: 860cb4d89fb584a81bab705ec5b1d21f + spriteID: fa0375da4ccc24a1a804016419fbf262 vertices: [] indices: edges: [] diff --git a/Assets/Prefabs/Managers.meta b/Assets/Prefabs/Managers.meta new file mode 100644 index 0000000..1961c9b --- /dev/null +++ b/Assets/Prefabs/Managers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 56431c4abf09947ed9b3f37ac715caca +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Managers/GameManager.prefab b/Assets/Prefabs/Managers/GameManager.prefab new file mode 100644 index 0000000..a4b6b7d --- /dev/null +++ b/Assets/Prefabs/Managers/GameManager.prefab @@ -0,0 +1,65 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &158905820630581597 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 158905820630581587} + - component: {fileID: 158905820630581586} + - component: {fileID: 158905820630581596} + m_Layer: 0 + m_Name: GameManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &158905820630581587 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 158905820630581597} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 7.2735596, y: -6.5702896, z: -10.295408} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &158905820630581586 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 158905820630581597} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 697f5ae5656c74dcd8d7f5d619adb0ac, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &158905820630581596 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 158905820630581597} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 308dfc6b26c3b422faf1717231fc888b, type: 3} + m_Name: + m_EditorClassIdentifier: + boardHolder: {fileID: 0} + startPosition: {fileID: 0} + indestructibleWallPrefab: {fileID: 5996206011854593075, guid: 84b92ac1e96d940bda97d1b1125887d7, + type: 3} + destructibleWallPrefabs: + - {fileID: 4177940729222266681, guid: da559e681f8d34d58bb5f3457045664a, type: 3} + - {fileID: 8729402555587492036, guid: 7e54504f1e1de4334be2e6a115b838c2, type: 3} diff --git a/Assets/Prefabs/Managers/GameManager.prefab.meta b/Assets/Prefabs/Managers/GameManager.prefab.meta new file mode 100644 index 0000000..4b6c023 --- /dev/null +++ b/Assets/Prefabs/Managers/GameManager.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fdaa7451ab31b477b930076bbc888bab +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Player.prefab b/Assets/Prefabs/Player.prefab index 5db1f5f..f8fbbe4 100644 --- a/Assets/Prefabs/Player.prefab +++ b/Assets/Prefabs/Player.prefab @@ -71,7 +71,7 @@ SpriteRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: 1 + m_SortingOrder: 0 m_Sprite: {fileID: 21300000, guid: 69237087e6b0b42ac8d25d0035b2e01b, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 @@ -97,8 +97,6 @@ MonoBehaviour: m_EditorClassIdentifier: movementSpeed: 4 respawnPosition: {fileID: 0} - bombPrefab: {fileID: 5909392949477884267, guid: 28467e0d65b5d3844bf1862ac0c49ad9, - type: 3} --- !u!50 &6843575828445418653 Rigidbody2D: serializedVersion: 4 diff --git a/Assets/Prefabs/Walls/bman_destructible_wall1.prefab b/Assets/Prefabs/Walls/bman_destructible_wall1.prefab index 529e726..0a8544a 100644 --- a/Assets/Prefabs/Walls/bman_destructible_wall1.prefab +++ b/Assets/Prefabs/Walls/bman_destructible_wall1.prefab @@ -12,6 +12,7 @@ GameObject: - component: {fileID: 4177940729222266823} - component: {fileID: 4177940729222266822} - component: {fileID: 2823577682722293689} + - component: {fileID: 4525879622828546227} m_Layer: 8 m_Name: bman_destructible_wall1 m_TagString: Untagged @@ -50,7 +51,7 @@ Rigidbody2D: m_LinearDrag: 0 m_AngularDrag: 0.05 m_GravityScale: 1 - m_Material: {fileID: 0} + m_Material: {fileID: 6200000, guid: dc8eb6133faaf45f6820487d0d28b47f, type: 2} m_Interpolate: 0 m_SleepingMode: 1 m_CollisionDetection: 0 @@ -93,6 +94,22 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b30e7124fcdf4e1f92fc7dd42d8c7298, type: 3} m_Name: m_EditorClassIdentifier: + explosionPrefab: {fileID: 2086996798441195857, guid: 13213ac562d960e4e8c33d53d40a516c, + type: 3} + exitDoorPrefab: {fileID: 1538214466168189615, guid: 519235375d069406f909265766078ad0, + type: 3} +--- !u!114 &4525879622828546227 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4177940729222266681} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f76d22fdcb894023bd111d6b5bc1da5e, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &5688352134163068791 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/Walls/bman_destructible_wall2.prefab b/Assets/Prefabs/Walls/bman_destructible_wall2.prefab index 8b1c9fa..41c4aa2 100644 --- a/Assets/Prefabs/Walls/bman_destructible_wall2.prefab +++ b/Assets/Prefabs/Walls/bman_destructible_wall2.prefab @@ -91,6 +91,7 @@ GameObject: - component: {fileID: 8360026854687715433} - component: {fileID: 1860172021824364478} - component: {fileID: 3937551180478767488} + - component: {fileID: 2850266447828806432} m_Layer: 8 m_Name: bman_destructible_wall2 m_TagString: Untagged @@ -129,7 +130,7 @@ Rigidbody2D: m_LinearDrag: 0 m_AngularDrag: 0.05 m_GravityScale: 1 - m_Material: {fileID: 0} + m_Material: {fileID: 6200000, guid: dc8eb6133faaf45f6820487d0d28b47f, type: 2} m_Interpolate: 0 m_SleepingMode: 1 m_CollisionDetection: 0 @@ -172,3 +173,19 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b30e7124fcdf4e1f92fc7dd42d8c7298, type: 3} m_Name: m_EditorClassIdentifier: + explosionPrefab: {fileID: 2086996798441195857, guid: 13213ac562d960e4e8c33d53d40a516c, + type: 3} + exitDoorPrefab: {fileID: 1538214466168189615, guid: 519235375d069406f909265766078ad0, + type: 3} +--- !u!114 &2850266447828806432 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8729402555587492036} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f76d22fdcb894023bd111d6b5bc1da5e, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/Prefabs/Walls/bman_indestructible_wall1.prefab b/Assets/Prefabs/Walls/bman_indestructible_wall1.prefab index 35bc431..ae3649a 100644 --- a/Assets/Prefabs/Walls/bman_indestructible_wall1.prefab +++ b/Assets/Prefabs/Walls/bman_indestructible_wall1.prefab @@ -11,6 +11,7 @@ GameObject: - component: {fileID: 3400997238130971262} - component: {fileID: 3305047832243218078} - component: {fileID: 7808374684255412738} + - component: {fileID: 9150705305556807559} m_Layer: 8 m_Name: bman_indestructible_wall1 m_TagString: Untagged @@ -49,7 +50,7 @@ Rigidbody2D: m_LinearDrag: 0 m_AngularDrag: 0.05 m_GravityScale: 1 - m_Material: {fileID: 0} + m_Material: {fileID: 6200000, guid: dc8eb6133faaf45f6820487d0d28b47f, type: 2} m_Interpolate: 0 m_SleepingMode: 1 m_CollisionDetection: 0 @@ -80,6 +81,18 @@ BoxCollider2D: serializedVersion: 2 m_Size: {x: 1, y: 1} m_EdgeRadius: 0 +--- !u!114 &9150705305556807559 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5996206011854593075} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f76d22fdcb894023bd111d6b5bc1da5e, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &6716060611887421146 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index b905c2e..ee10182 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -7781,7 +7781,7 @@ CompositeCollider2D: m_GameObject: {fileID: 69346940} m_Enabled: 1 m_Density: 1 - m_Material: {fileID: 6200000, guid: dc8eb6133faaf45f6820487d0d28b47f, type: 2} + m_Material: {fileID: 0} m_IsTrigger: 0 m_UsedByEffector: 0 m_UsedByComposite: 0 @@ -7835,7 +7835,7 @@ Rigidbody2D: m_LinearDrag: 0 m_AngularDrag: 0.05 m_GravityScale: 1 - m_Material: {fileID: 0} + m_Material: {fileID: 6200000, guid: 09a32766a59c24bef94b71414d0ccda5, type: 2} m_Interpolate: 0 m_SleepingMode: 1 m_CollisionDetection: 0 @@ -8018,7 +8018,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 266944714} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -2.7893844} + m_LocalPosition: {x: 0, y: 0, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 97386695} @@ -8156,7 +8156,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 519420028} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 7.7688866, y: -4.0430503, z: -2.7893844} + m_LocalPosition: {x: 10.590895, y: -4.0430503, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -8206,69 +8206,6 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &840487110 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 840487112} - - component: {fileID: 840487113} - - component: {fileID: 840487111} - m_Layer: 0 - m_Name: GameManager - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &840487111 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 840487110} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 308dfc6b26c3b422faf1717231fc888b, type: 3} - m_Name: - m_EditorClassIdentifier: - boardHolder: {fileID: 585332173} - startPosition: {fileID: 185746015} - indestructibleWallPrefab: {fileID: 5996206011854593075, guid: 84b92ac1e96d940bda97d1b1125887d7, - type: 3} - destructibleWallPrefabs: - - {fileID: 4177940729222266681, guid: da559e681f8d34d58bb5f3457045664a, type: 3} - - {fileID: 8729402555587492036, guid: 7e54504f1e1de4334be2e6a115b838c2, type: 3} ---- !u!4 &840487112 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 840487110} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 7.2735596, y: -6.5702896, z: -10.295408} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &840487113 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 840487110} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 697f5ae5656c74dcd8d7f5d619adb0ac, type: 3} - m_Name: - m_EditorClassIdentifier: --- !u!1 &1135949884 GameObject: m_ObjectHideFlags: 0 @@ -8408,6 +8345,85 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: c9b7903151183144dbf30c9b2ab371b2, type: 3} +--- !u!1001 &158905819792232859 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 158905820630581597, guid: fdaa7451ab31b477b930076bbc888bab, + type: 3} + propertyPath: m_Name + value: GameManager + objectReference: {fileID: 0} + - target: {fileID: 158905820630581587, guid: fdaa7451ab31b477b930076bbc888bab, + type: 3} + propertyPath: m_LocalPosition.x + value: 7.2735596 + objectReference: {fileID: 0} + - target: {fileID: 158905820630581587, guid: fdaa7451ab31b477b930076bbc888bab, + type: 3} + propertyPath: m_LocalPosition.y + value: -6.5702896 + objectReference: {fileID: 0} + - target: {fileID: 158905820630581587, guid: fdaa7451ab31b477b930076bbc888bab, + type: 3} + propertyPath: m_LocalPosition.z + value: -10.295408 + objectReference: {fileID: 0} + - target: {fileID: 158905820630581587, guid: fdaa7451ab31b477b930076bbc888bab, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 158905820630581587, guid: fdaa7451ab31b477b930076bbc888bab, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 158905820630581587, guid: fdaa7451ab31b477b930076bbc888bab, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 158905820630581587, guid: fdaa7451ab31b477b930076bbc888bab, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 158905820630581587, guid: fdaa7451ab31b477b930076bbc888bab, + type: 3} + propertyPath: m_RootOrder + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 158905820630581587, guid: fdaa7451ab31b477b930076bbc888bab, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 158905820630581587, guid: fdaa7451ab31b477b930076bbc888bab, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 158905820630581587, guid: fdaa7451ab31b477b930076bbc888bab, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 158905820630581596, guid: fdaa7451ab31b477b930076bbc888bab, + type: 3} + propertyPath: boardHolder + value: + objectReference: {fileID: 585332173} + - target: {fileID: 158905820630581596, guid: fdaa7451ab31b477b930076bbc888bab, + type: 3} + propertyPath: startPosition + value: + objectReference: {fileID: 185746015} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: fdaa7451ab31b477b930076bbc888bab, type: 3} --- !u!1001 &6843575829779162303 PrefabInstance: m_ObjectHideFlags: 0 @@ -8420,6 +8436,11 @@ PrefabInstance: propertyPath: m_Name value: Player objectReference: {fileID: 0} + - target: {fileID: 6843575828445418657, guid: d3055091a17dc4aa1accf2e33ccef144, + type: 3} + propertyPath: m_Layer + value: 15 + objectReference: {fileID: 0} - target: {fileID: 6843575828445418654, guid: d3055091a17dc4aa1accf2e33ccef144, type: 3} propertyPath: m_LocalPosition.x @@ -8433,7 +8454,7 @@ PrefabInstance: - target: {fileID: 6843575828445418654, guid: d3055091a17dc4aa1accf2e33ccef144, type: 3} propertyPath: m_LocalPosition.z - value: 7.2106156 + value: 0 objectReference: {fileID: 0} - target: {fileID: 6843575828445418654, guid: d3055091a17dc4aa1accf2e33ccef144, type: 3} @@ -8480,10 +8501,5 @@ PrefabInstance: propertyPath: respawnPosition value: objectReference: {fileID: 185746015} - - target: {fileID: 6843575828445418655, guid: d3055091a17dc4aa1accf2e33ccef144, - type: 3} - propertyPath: m_SortingOrder - value: 0 - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: d3055091a17dc4aa1accf2e33ccef144, type: 3} diff --git a/Assets/Scripts/src/Helpers/DebugHelper.cs b/Assets/Scripts/src/Helpers/DebugHelper.cs new file mode 100644 index 0000000..d23b438 --- /dev/null +++ b/Assets/Scripts/src/Helpers/DebugHelper.cs @@ -0,0 +1,59 @@ +using System; +using UnityEngine; +// ReSharper disable UnusedMember.Global +// ReSharper disable UnusedMember.Local +// ReSharper disable ArrangeTypeMemberModifiers + +namespace src.Helpers +{ + public static class DebugHelper + { + public static void LogInfo(string message) + { + if (Debug.isDebugBuild) + { + Debug.Log(message); + } + } + + public static void LogWarning(string message) + { + if (Debug.isDebugBuild) + { + Debug.LogWarning(message); + } + } + + public static void LogError(string message) + { + if (Debug.isDebugBuild) + { + Debug.LogError(message); + } + } + + public static void LogException(Exception ex) + { + if (Debug.isDebugBuild) + { + Debug.LogException(ex); + } + } + + public static void DrawRay(Vector3 position, Vector3 direction, Color color) + { + if (Debug.isDebugBuild) + { + Debug.DrawRay(position, direction, color); + } + } + + public static void DrawLine(Vector3 position, Vector3 direction, Color color) + { + if (Debug.isDebugBuild) + { + Debug.DrawLine(position, direction, color); + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/src/Helpers/DebugHelper.cs.meta b/Assets/Scripts/src/Helpers/DebugHelper.cs.meta new file mode 100644 index 0000000..653b2f7 --- /dev/null +++ b/Assets/Scripts/src/Helpers/DebugHelper.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 36a93a2c984d44bd8d65a9a3ad28894e +timeCreated: 1560272684 \ No newline at end of file diff --git a/Assets/Scripts/src/Wall/DestructibleWall.cs b/Assets/Scripts/src/Wall/DestructibleWall.cs index 0422379..fc3dfe0 100644 --- a/Assets/Scripts/src/Wall/DestructibleWall.cs +++ b/Assets/Scripts/src/Wall/DestructibleWall.cs @@ -8,6 +8,8 @@ namespace src.Wall { private bool _spawnExit; private bool _spawnUpgrade; + public GameObject explosionPrefab; + public GameObject exitDoorPrefab; public void SpawnsExit() { @@ -22,22 +24,28 @@ namespace src.Wall public float XCoordinate => transform.position.x; public float YCoordinate => transform.position.y; - public void OnDestroy() + private void BeforeDestroy() { + var currentPosition = transform.position; + Destroy(GetComponent()); + Instantiate(explosionPrefab, currentPosition, Quaternion.identity); if (_spawnExit) { - // TODO Spawn an exit + Debug.Log($"Destructible spawned exit {transform.position}"); + Instantiate(exitDoorPrefab, currentPosition, Quaternion.identity); } else if (_spawnUpgrade) { - // TODO Spawn an upgrade, use composition to UpgradeManager - // to get random / desired upgrade + Debug.Log($"Destructible spawned upgrade {transform.position}"); + // TODO: Get and instantiate upgrade from manager } } public void onExplosion() { - Debug.Log("Destructible wall hitted by explosion"); + Debug.Log($"Destructible wall hit by explosion {transform.position}"); + BeforeDestroy(); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/Assets/Scripts/src/Wall/WallTransparency.cs b/Assets/Scripts/src/Wall/WallTransparency.cs new file mode 100644 index 0000000..7522112 --- /dev/null +++ b/Assets/Scripts/src/Wall/WallTransparency.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using src.Base; +using src.Helpers; +using UnityEngine; + +namespace src.Wall +{ + public class WallTransparency : GameplayComponent + { + private SpriteRenderer _spriteRenderer; + private Color _originalSpriteColor; + private bool _isTransparent; + + private void Start() + { + _spriteRenderer = GetComponentInChildren(); + _originalSpriteColor = _spriteRenderer.color; + } + + private void Update() + { + var position = transform.position; + /* RayCast from the center of the tile up one distance and set layerMask to Player only! */ + var hit = Physics2D.Raycast(new Vector2(position.x + .5f, position.y + 0.5f), + Vector2.up, 1f, 1 << 15); + if (hit.collider) + { + BecomeTransparent(); + } + else + { + BecomeOpaque(); + } + } + + private void ChangeSpriteAlpha(float alpha) + { + _spriteRenderer.color = + new Color(_originalSpriteColor.r, _originalSpriteColor.g, _originalSpriteColor.b, alpha); + } + + private void BecomeTransparent() + { + if (_isTransparent) + { + return; + } + + _isTransparent = true; + ChangeSpriteAlpha(0.5f); + } + + private void BecomeOpaque() + { + if (!_isTransparent) + { + return; + } + + _isTransparent = false; + ChangeSpriteAlpha(1f); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/src/Wall/WallTransparency.cs.meta b/Assets/Scripts/src/Wall/WallTransparency.cs.meta new file mode 100644 index 0000000..c84e78e --- /dev/null +++ b/Assets/Scripts/src/Wall/WallTransparency.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f76d22fdcb894023bd111d6b5bc1da5e +timeCreated: 1560273099 \ No newline at end of file diff --git a/ProjectSettings/Physics2DSettings.asset b/ProjectSettings/Physics2DSettings.asset index cecfb1f..30eede9 100644 --- a/ProjectSettings/Physics2DSettings.asset +++ b/ProjectSettings/Physics2DSettings.asset @@ -53,4 +53,4 @@ Physics2DSettings: m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} - m_LayerCollisionMatrix: fffbfffffffbfffffffbfffffffffffffffbfffffffbfffffffffffffffffffffffbffffffffffffc8faffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + m_LayerCollisionMatrix: fffbffffff7bffffff7bffffffffffffff7bfffffffbfffffffffffffffffffffffbffffffffffffc87affffffffffffffffffffffffffffffffffffe9fbffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 4d4eaab..c1f14aa 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -22,7 +22,7 @@ TagManager: - - - - - + - Player - - -