From c7eff9ff6119f5babf1bdc2dc3d9459dd499e07c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Nu=C8=9Biu?= Date: Sun, 9 Jun 2019 23:28:05 +0300 Subject: [PATCH 1/2] Import Sprites for Walls --- .gitignore | 7 +- Assets/Animations.meta | 8 + Assets/Animations/Player.meta | 8 + .../Player/PlayerAnimator.controller | 0 .../Player/PlayerAnimator.controller.meta | 0 .../Player/PlayerRunning.anim | 0 .../Player/PlayerRunning.anim.meta | 0 .../bman_destructible_wall_overlap.prefab | 174 ++++++++++++++++++ ...bman_destructible_wall_overlap.prefab.meta | 7 + Assets/Materials.meta | 8 + .../Materials/FloorMaterial.physicsMaterial2D | 11 ++ .../FloorMaterial.physicsMaterial2D.meta | 8 + .../Materials/WallMaterial.physicsMaterial2D | 11 ++ .../WallMaterial.physicsMaterial2D.meta | 8 + Assets/Prefabs/Walls.meta | 8 + .../Walls/bman_destructible_wall1.prefab} | 139 ++++++++------ .../bman_destructible_wall1.prefab.meta} | 0 .../Walls/bman_destructible_wall2.prefab | 174 ++++++++++++++++++ .../Walls/bman_destructible_wall2.prefab.meta | 7 + .../Walls/bman_indestructible_wall1.prefab | 161 ++++++++++++++++ .../bman_indestructible_wall1.prefab.meta | 7 + Assets/Scenes/SampleScene.unity | 14 +- Assets/Scripts/src/Helpers/ArrayExtensions.cs | 14 ++ .../src/Helpers/ArrayExtensions.cs.meta | 3 + Assets/Scripts/src/Managers/LevelManager.cs | 5 +- Assets/Sprites/Walls.meta | 8 + .../Walls/bman_sprite_crate_v01-01.png | Bin 0 -> 17555 bytes .../Walls/bman_sprite_crate_v01-01.png.meta | 110 +++++++++++ .../Walls/bman_sprite_snowmound_v01.png | Bin 0 -> 18005 bytes .../Walls/bman_sprite_snowmound_v01.png.meta | 110 +++++++++++ .../Walls/bman_sprite_snowmound_v02.png | Bin 0 -> 17962 bytes .../Walls/bman_sprite_snowmound_v02.png.meta | 110 +++++++++++ ProjectSettings/GraphicsSettings.asset | 114 ++++++------ 33 files changed, 1114 insertions(+), 120 deletions(-) create mode 100644 Assets/Animations.meta create mode 100644 Assets/Animations/Player.meta rename Assets/{Sprites => Animations}/Player/PlayerAnimator.controller (100%) rename Assets/{Sprites => Animations}/Player/PlayerAnimator.controller.meta (100%) rename Assets/{Sprites => Animations}/Player/PlayerRunning.anim (100%) rename Assets/{Sprites => Animations}/Player/PlayerRunning.anim.meta (100%) create mode 100644 Assets/DevMocks/bman_destructible_wall_overlap.prefab create mode 100644 Assets/DevMocks/bman_destructible_wall_overlap.prefab.meta create mode 100644 Assets/Materials.meta create mode 100644 Assets/Materials/FloorMaterial.physicsMaterial2D create mode 100644 Assets/Materials/FloorMaterial.physicsMaterial2D.meta create mode 100644 Assets/Materials/WallMaterial.physicsMaterial2D create mode 100644 Assets/Materials/WallMaterial.physicsMaterial2D.meta create mode 100644 Assets/Prefabs/Walls.meta rename Assets/{DevMocks/bman_destructible_wall.prefab => Prefabs/Walls/bman_destructible_wall1.prefab} (73%) rename Assets/{DevMocks/bman_destructible_wall.prefab.meta => Prefabs/Walls/bman_destructible_wall1.prefab.meta} (100%) create mode 100644 Assets/Prefabs/Walls/bman_destructible_wall2.prefab create mode 100644 Assets/Prefabs/Walls/bman_destructible_wall2.prefab.meta create mode 100644 Assets/Prefabs/Walls/bman_indestructible_wall1.prefab create mode 100644 Assets/Prefabs/Walls/bman_indestructible_wall1.prefab.meta create mode 100644 Assets/Scripts/src/Helpers/ArrayExtensions.cs create mode 100644 Assets/Scripts/src/Helpers/ArrayExtensions.cs.meta create mode 100644 Assets/Sprites/Walls.meta create mode 100644 Assets/Sprites/Walls/bman_sprite_crate_v01-01.png create mode 100644 Assets/Sprites/Walls/bman_sprite_crate_v01-01.png.meta create mode 100644 Assets/Sprites/Walls/bman_sprite_snowmound_v01.png create mode 100644 Assets/Sprites/Walls/bman_sprite_snowmound_v01.png.meta create mode 100644 Assets/Sprites/Walls/bman_sprite_snowmound_v02.png create mode 100644 Assets/Sprites/Walls/bman_sprite_snowmound_v02.png.meta diff --git a/.gitignore b/.gitignore index 985a6d2..8076a78 100644 --- a/.gitignore +++ b/.gitignore @@ -140,8 +140,6 @@ fabric.properties # Uncomment this line if you wish to ignore the asset store tools plugin # [Aa]ssets/AssetStoreTools* -# Ignore Rider Plugin -[Aa]ssets/Plugins/Editor/JetBrains/* # TextMesh Pro files [Aa]ssets/TextMesh*Pro/ @@ -534,6 +532,9 @@ MigrationBackup/ # Never ignore Asset meta data ![Aa]ssets/**/*.meta -Assets/Plugins/Editor/JetBrains.meta + +# Ignore editor plugins +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.meta b/Assets/Animations.meta new file mode 100644 index 0000000..a43ef5a --- /dev/null +++ b/Assets/Animations.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cc3f4fe91c476447aa5cdef2e5664819 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Animations/Player.meta b/Assets/Animations/Player.meta new file mode 100644 index 0000000..a10f11d --- /dev/null +++ b/Assets/Animations/Player.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4b50a917333ea46908da25b3e26fa63e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sprites/Player/PlayerAnimator.controller b/Assets/Animations/Player/PlayerAnimator.controller similarity index 100% rename from Assets/Sprites/Player/PlayerAnimator.controller rename to Assets/Animations/Player/PlayerAnimator.controller diff --git a/Assets/Sprites/Player/PlayerAnimator.controller.meta b/Assets/Animations/Player/PlayerAnimator.controller.meta similarity index 100% rename from Assets/Sprites/Player/PlayerAnimator.controller.meta rename to Assets/Animations/Player/PlayerAnimator.controller.meta diff --git a/Assets/Sprites/Player/PlayerRunning.anim b/Assets/Animations/Player/PlayerRunning.anim similarity index 100% rename from Assets/Sprites/Player/PlayerRunning.anim rename to Assets/Animations/Player/PlayerRunning.anim diff --git a/Assets/Sprites/Player/PlayerRunning.anim.meta b/Assets/Animations/Player/PlayerRunning.anim.meta similarity index 100% rename from Assets/Sprites/Player/PlayerRunning.anim.meta rename to Assets/Animations/Player/PlayerRunning.anim.meta diff --git a/Assets/DevMocks/bman_destructible_wall_overlap.prefab b/Assets/DevMocks/bman_destructible_wall_overlap.prefab new file mode 100644 index 0000000..2384564 --- /dev/null +++ b/Assets/DevMocks/bman_destructible_wall_overlap.prefab @@ -0,0 +1,174 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2899889047683555164 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6637306046394798484} + - component: {fileID: 2675033481556760561} + - component: {fileID: 5245497846486186022} + - component: {fileID: 7475857772367562264} + m_Layer: 8 + m_Name: bman_destructible_wall2exp + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6637306046394798484 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2899889047683555164} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 3.96, y: -1.07, z: 0} + m_LocalScale: {x: 1, y: 1, z: 0} + m_Children: + - {fileID: 1878121175747991472} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!50 &2675033481556760561 +Rigidbody2D: + serializedVersion: 4 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2899889047683555164} + m_BodyType: 2 + m_Simulated: 1 + m_UseFullKinematicContacts: 0 + m_UseAutoMass: 0 + m_Mass: 1 + m_LinearDrag: 0 + m_AngularDrag: 0.05 + m_GravityScale: 1 + m_Material: {fileID: 0} + m_Interpolate: 0 + m_SleepingMode: 1 + m_CollisionDetection: 0 + m_Constraints: 0 +--- !u!61 &5245497846486186022 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2899889047683555164} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 6200000, guid: dc8eb6133faaf45f6820487d0d28b47f, type: 2} + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0.51631534, y: 0.55982304} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0, y: 0} + oldSize: {x: 0, y: 0} + newSize: {x: 0, y: 0} + adaptiveTilingThreshold: 0 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 0.9673693, y: 0.98912334} + m_EdgeRadius: 0 +--- !u!114 &7475857772367562264 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2899889047683555164} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b30e7124fcdf4e1f92fc7dd42d8c7298, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &5530905156088972342 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1878121175747991472} + - component: {fileID: 2525467942923604880} + m_Layer: 0 + m_Name: Sprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1878121175747991472 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5530905156088972342} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.34, y: -0.15, z: 0} + m_LocalScale: {x: 1.724866, y: 1.7598268, z: 1} + m_Children: [] + m_Father: {fileID: 6637306046394798484} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &2525467942923604880 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5530905156088972342} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 2c89c5592e07249fd8d1f49c0e5a125e, 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_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 diff --git a/Assets/DevMocks/bman_destructible_wall_overlap.prefab.meta b/Assets/DevMocks/bman_destructible_wall_overlap.prefab.meta new file mode 100644 index 0000000..457104a --- /dev/null +++ b/Assets/DevMocks/bman_destructible_wall_overlap.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b7e3d2e65cd1840089ccdb548a440e87 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Materials.meta b/Assets/Materials.meta new file mode 100644 index 0000000..6c2af9a --- /dev/null +++ b/Assets/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8a1cc3a2271dc416e930fa23f722e094 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Materials/FloorMaterial.physicsMaterial2D b/Assets/Materials/FloorMaterial.physicsMaterial2D new file mode 100644 index 0000000..904ae3d --- /dev/null +++ b/Assets/Materials/FloorMaterial.physicsMaterial2D @@ -0,0 +1,11 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!62 &6200000 +PhysicsMaterial2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: FloorMaterial + friction: 0 + bounciness: 0 diff --git a/Assets/Materials/FloorMaterial.physicsMaterial2D.meta b/Assets/Materials/FloorMaterial.physicsMaterial2D.meta new file mode 100644 index 0000000..dc346e3 --- /dev/null +++ b/Assets/Materials/FloorMaterial.physicsMaterial2D.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 09a32766a59c24bef94b71414d0ccda5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 6200000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Materials/WallMaterial.physicsMaterial2D b/Assets/Materials/WallMaterial.physicsMaterial2D new file mode 100644 index 0000000..4874c23 --- /dev/null +++ b/Assets/Materials/WallMaterial.physicsMaterial2D @@ -0,0 +1,11 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!62 &6200000 +PhysicsMaterial2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: WallMaterial + friction: 0 + bounciness: 0 diff --git a/Assets/Materials/WallMaterial.physicsMaterial2D.meta b/Assets/Materials/WallMaterial.physicsMaterial2D.meta new file mode 100644 index 0000000..5f8878e --- /dev/null +++ b/Assets/Materials/WallMaterial.physicsMaterial2D.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dc8eb6133faaf45f6820487d0d28b47f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 6200000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Walls.meta b/Assets/Prefabs/Walls.meta new file mode 100644 index 0000000..d8f08a9 --- /dev/null +++ b/Assets/Prefabs/Walls.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 14920c513ed724eed956a5adeba30990 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/DevMocks/bman_destructible_wall.prefab b/Assets/Prefabs/Walls/bman_destructible_wall1.prefab similarity index 73% rename from Assets/DevMocks/bman_destructible_wall.prefab rename to Assets/Prefabs/Walls/bman_destructible_wall1.prefab index 5de6cab..529e726 100644 --- a/Assets/DevMocks/bman_destructible_wall.prefab +++ b/Assets/Prefabs/Walls/bman_destructible_wall1.prefab @@ -9,12 +9,11 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 4177940729222266821} - - component: {fileID: 4177940729222266820} - component: {fileID: 4177940729222266823} - component: {fileID: 4177940729222266822} - component: {fileID: 2823577682722293689} m_Layer: 8 - m_Name: bman_destructible_wall + m_Name: bman_destructible_wall1 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -28,60 +27,13 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4177940729222266681} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 2.95, y: -17.53, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 0} + m_Children: + - {fileID: 8553251917334281199} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!212 &4177940729222266820 -SpriteRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4177940729222266681} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_Sprite: {fileID: 21300000, guid: 96d3693302b284c92ba9c394bb4f72c1, type: 3} - m_Color: {r: 0.9622642, g: 0.53884333, b: 0.22241013, a: 1} - m_FlipX: 0 - m_FlipY: 0 - m_DrawMode: 0 - m_Size: {x: 1, y: 1} - m_AdaptiveModeThreshold: 0.5 - m_SpriteTileMode: 0 - m_WasSpriteAssigned: 1 - m_MaskInteraction: 0 - m_SpriteSortPoint: 0 --- !u!50 &4177940729222266823 Rigidbody2D: serializedVersion: 4 @@ -112,7 +64,7 @@ BoxCollider2D: m_GameObject: {fileID: 4177940729222266681} m_Enabled: 1 m_Density: 1 - m_Material: {fileID: 0} + m_Material: {fileID: 6200000, guid: dc8eb6133faaf45f6820487d0d28b47f, type: 2} m_IsTrigger: 0 m_UsedByEffector: 0 m_UsedByComposite: 0 @@ -141,3 +93,82 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b30e7124fcdf4e1f92fc7dd42d8c7298, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1 &5688352134163068791 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8553251917334281199} + - component: {fileID: 2562328647522734305} + m_Layer: 8 + m_Name: Sprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8553251917334281199 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5688352134163068791} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4177940729222266821} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &2562328647522734305 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5688352134163068791} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 8f9176eb354da424795fcd8d93e4c02f, 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_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 diff --git a/Assets/DevMocks/bman_destructible_wall.prefab.meta b/Assets/Prefabs/Walls/bman_destructible_wall1.prefab.meta similarity index 100% rename from Assets/DevMocks/bman_destructible_wall.prefab.meta rename to Assets/Prefabs/Walls/bman_destructible_wall1.prefab.meta diff --git a/Assets/Prefabs/Walls/bman_destructible_wall2.prefab b/Assets/Prefabs/Walls/bman_destructible_wall2.prefab new file mode 100644 index 0000000..8b1c9fa --- /dev/null +++ b/Assets/Prefabs/Walls/bman_destructible_wall2.prefab @@ -0,0 +1,174 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2151260512302392238 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5407421983573782568} + - component: {fileID: 8221087269156402184} + m_Layer: 0 + m_Name: Sprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5407421983573782568 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2151260512302392238} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 938747944624895500} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &8221087269156402184 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2151260512302392238} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 2c89c5592e07249fd8d1f49c0e5a125e, 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_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &8729402555587492036 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 938747944624895500} + - component: {fileID: 8360026854687715433} + - component: {fileID: 1860172021824364478} + - component: {fileID: 3937551180478767488} + m_Layer: 8 + m_Name: bman_destructible_wall2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &938747944624895500 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8729402555587492036} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 0} + m_Children: + - {fileID: 5407421983573782568} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!50 &8360026854687715433 +Rigidbody2D: + serializedVersion: 4 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8729402555587492036} + m_BodyType: 2 + m_Simulated: 1 + m_UseFullKinematicContacts: 0 + m_UseAutoMass: 0 + m_Mass: 1 + m_LinearDrag: 0 + m_AngularDrag: 0.05 + m_GravityScale: 1 + m_Material: {fileID: 0} + m_Interpolate: 0 + m_SleepingMode: 1 + m_CollisionDetection: 0 + m_Constraints: 0 +--- !u!61 &1860172021824364478 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8729402555587492036} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 6200000, guid: dc8eb6133faaf45f6820487d0d28b47f, type: 2} + 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: 0, y: 0} + newSize: {x: 0, y: 0} + adaptiveTilingThreshold: 0 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 1, y: 1} + m_EdgeRadius: 0 +--- !u!114 &3937551180478767488 +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: b30e7124fcdf4e1f92fc7dd42d8c7298, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/Prefabs/Walls/bman_destructible_wall2.prefab.meta b/Assets/Prefabs/Walls/bman_destructible_wall2.prefab.meta new file mode 100644 index 0000000..23bd2e8 --- /dev/null +++ b/Assets/Prefabs/Walls/bman_destructible_wall2.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7e54504f1e1de4334be2e6a115b838c2 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Walls/bman_indestructible_wall1.prefab b/Assets/Prefabs/Walls/bman_indestructible_wall1.prefab new file mode 100644 index 0000000..35bc431 --- /dev/null +++ b/Assets/Prefabs/Walls/bman_indestructible_wall1.prefab @@ -0,0 +1,161 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &5996206011854593075 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3400997238130971262} + - component: {fileID: 3305047832243218078} + - component: {fileID: 7808374684255412738} + m_Layer: 8 + m_Name: bman_indestructible_wall1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3400997238130971262 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5996206011854593075} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 0} + m_Children: + - {fileID: 3720188136488802877} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!50 &3305047832243218078 +Rigidbody2D: + serializedVersion: 4 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5996206011854593075} + m_BodyType: 2 + m_Simulated: 1 + m_UseFullKinematicContacts: 0 + m_UseAutoMass: 0 + m_Mass: 1 + m_LinearDrag: 0 + m_AngularDrag: 0.05 + m_GravityScale: 1 + m_Material: {fileID: 0} + m_Interpolate: 0 + m_SleepingMode: 1 + m_CollisionDetection: 0 + m_Constraints: 0 +--- !u!61 &7808374684255412738 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5996206011854593075} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 6200000, guid: dc8eb6133faaf45f6820487d0d28b47f, type: 2} + 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: 0, y: 0} + newSize: {x: 0, y: 0} + adaptiveTilingThreshold: 0 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 1, y: 1} + m_EdgeRadius: 0 +--- !u!1 &6716060611887421146 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3720188136488802877} + - component: {fileID: 1068051329575336004} + m_Layer: 0 + m_Name: Sprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3720188136488802877 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6716060611887421146} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3400997238130971262} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1068051329575336004 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6716060611887421146} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 51730a754c8c94ac9aaf4a998edcf5e4, 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_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 diff --git a/Assets/Prefabs/Walls/bman_indestructible_wall1.prefab.meta b/Assets/Prefabs/Walls/bman_indestructible_wall1.prefab.meta new file mode 100644 index 0000000..e4c7cd4 --- /dev/null +++ b/Assets/Prefabs/Walls/bman_indestructible_wall1.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 84b92ac1e96d940bda97d1b1125887d7 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 16b3263..8ce728d 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: 0} + m_Material: {fileID: 6200000, guid: dc8eb6133faaf45f6820487d0d28b47f, type: 2} m_IsTrigger: 0 m_UsedByEffector: 0 m_UsedByComposite: 0 @@ -8238,10 +8238,11 @@ MonoBehaviour: m_EditorClassIdentifier: boardHolder: {fileID: 585332173} startPosition: {fileID: 185746015} - indestructibleWallPrefab: {fileID: 5959564480851182330, guid: dd25aabed7c6c491eb405f1e5c5f4d99, - type: 3} - destructibleWallPrefab: {fileID: 4177940729222266681, guid: da559e681f8d34d58bb5f3457045664a, + 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 @@ -8410,5 +8411,10 @@ 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/ArrayExtensions.cs b/Assets/Scripts/src/Helpers/ArrayExtensions.cs new file mode 100644 index 0000000..3de4912 --- /dev/null +++ b/Assets/Scripts/src/Helpers/ArrayExtensions.cs @@ -0,0 +1,14 @@ +using UnityEngine; +using Random = UnityEngine.Random; + +namespace src.Helpers +{ + public static class ArrayExtensions + { + public static T ChoseRandom(this T[] arr) + { + var randomIndex = Mathf.FloorToInt(Random.Range(0, arr.Length)); + return arr[randomIndex]; + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/src/Helpers/ArrayExtensions.cs.meta b/Assets/Scripts/src/Helpers/ArrayExtensions.cs.meta new file mode 100644 index 0000000..65a7271 --- /dev/null +++ b/Assets/Scripts/src/Helpers/ArrayExtensions.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ade3c3b932ce48faba7da48a4662226e +timeCreated: 1560109505 \ No newline at end of file diff --git a/Assets/Scripts/src/Managers/LevelManager.cs b/Assets/Scripts/src/Managers/LevelManager.cs index 211d64b..4889f54 100644 --- a/Assets/Scripts/src/Managers/LevelManager.cs +++ b/Assets/Scripts/src/Managers/LevelManager.cs @@ -51,7 +51,7 @@ namespace src.Managers /* Holds the starting position of the player */ public Transform startPosition; public GameObject indestructibleWallPrefab; - public GameObject destructibleWallPrefab; + public GameObject[] destructibleWallPrefabs; /* Specifies how many objects we want per level. */ private Count _destructibleWallCount = new Count(150, 350); @@ -160,7 +160,8 @@ namespace src.Managers private void PlaceDestructibleTile(Vector3 position) { Debug.Log($"PlaceDestructibleTile: x:{position.x} y:{position.y}"); - var instance = Instantiate(destructibleWallPrefab, position, Quaternion.identity); + var randomWall = destructibleWallPrefabs.ChoseRandom(); + var instance = Instantiate(randomWall, position, Quaternion.identity); _destructibleWalls.Add(instance); instance.transform.SetParent(boardHolder); } diff --git a/Assets/Sprites/Walls.meta b/Assets/Sprites/Walls.meta new file mode 100644 index 0000000..ed07f6f --- /dev/null +++ b/Assets/Sprites/Walls.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ddc18e25516ed49a4a38bb31b2338c6c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sprites/Walls/bman_sprite_crate_v01-01.png b/Assets/Sprites/Walls/bman_sprite_crate_v01-01.png new file mode 100644 index 0000000000000000000000000000000000000000..8581ef6bd80790f002e16968ae51ba4ee50a7a2b GIT binary patch literal 17555 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 literal 0 HcmV?d00001 diff --git a/Assets/Sprites/Walls/bman_sprite_snowmound_v01.png.meta b/Assets/Sprites/Walls/bman_sprite_snowmound_v01.png.meta new file mode 100644 index 0000000..24a9086 --- /dev/null +++ b/Assets/Sprites/Walls/bman_sprite_snowmound_v01.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 2c89c5592e07249fd8d1f49c0e5a125e +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 6 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 64 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: a52906a715291443bb83ed96d864bcf6 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sprites/Walls/bman_sprite_snowmound_v02.png b/Assets/Sprites/Walls/bman_sprite_snowmound_v02.png new file mode 100644 index 0000000000000000000000000000000000000000..43d4e613cf8109d22578a0419d3c65f68bdc4791 GIT binary patch literal 17962 zcmeI4eT)=m9mfaIQXx`S^uG2Q{JGz|;}rgS zUuoTzfMJ%djNS{FZ++*343k~$4Go9Gx!WzrFLVIt+o)rzP{KzuOnS{!2{>aYWNkF! z6+2U}AALH-dayIKSe9kx1CqhVOGcz$wnvSU*2@XI5-XqqN3NW3I*_y{hT zE{0%=D+V`LMd~_P6gXwC6ncJl&#=uZY8OY>w%bK*4BP!@zJ zgCk8&&^W;uk_1aOEk*u#G{c3MNcBiUBZn6e1RX1$}B*qn|wls%jZK|Xd&bS)5fh7?ma3;;OXk;bW}0y)z)4NiqP zqq&9wWksrY(L!cUSL?h0&%5c^e8jV|lI#Z29kW~Oj=Wb%S|v~pP_(8yQ}spN$a0M& z7R6L@g9V%@-DR9;qDQ!AwKh+y5m^iK<__ol5LESJ;qCjF97RRiLa9nsj%qIw_-;4} z%BXt;&ye}7;i~HFFj79vN4JN(_a7LD08CunFz5<|vMfrRs5=U0LPh6*3N=oVY}c`o zE!rkdGFLYYie|}1J=6T}hM_r&ol#I6K`_JDudLqiZW=k$l^xqQY)*$rW2Fw`z`Q zHr@65xEt5|Q5hS=#G`w5G_q^K$n4g-16Ng2x89xY75lPlWl_|G9z#}oOhcDtt-D9; z?p=Gi@~h1@KsPl}(lx|Epd!w76`M01LFQzniYkyCL3i<0(kr_*(uQs5lI9>zQ)S30 zreboy)-}!)BvUnA*KtMX3Z+eC+d7bB&QO3@omv1Qn=?!Siny}=&{i#ehWfTAPSf!bxyvo5AP zG8FN!b5L?2Cm<|l+W6^>sz`#N8ZN@s(7eSAyrDFqs&clVDVzZn#9^d5rx`YsO^CbD z_10q5*4a}vz7A*;Jsmxau<%|F?>j1mK}JmTbJ}9-r{Wuq_H6m_%AQP@1pMN~=(83Y zcax!8=%H~p8QP58RP@3O-lpOMNdqs$zc#bB}5rbRb@5Jlg(trMsEt`hqE5u ztq0MrQ^WOaC5Cjg4BXN#Fy^QQRtGNjJg<^#s;&5GA%0NFH=b0^Nkfgj?mPLTc}4G} zDxsBhLI9zg2`)Mx!kgeCfY8kZ7o88`O>hxF=w^b8&WG?OxCkJ0Gr>jYLwFNh1Q5EJ z;G**(ya_G>2;EF@(fJVG1Q!8>ZYH?sdUVIv>KD;39y~%>);n58+L45kTl>f{V_F z@FutjAas+8Yf1CJKTr|>;m0KYXOF(o{2BbOAgr@)AjdE>s~P65oeXpF68?UbVa5f9 z`O7wjv34`ejs63l|79P;EZEVX?H-ysdG_04ac9?x-jVNr=4aPGaNXC!%$GL2bn8d@ zU%T_f-VI&fT($6?uk;*PD!u=}hmZewj6bP=b@ekhJona~KRtUu_`}xU{Pff4bm&$x$w@%8uUdlo%1bJzZJ z6BqWKKKkZcgJb+FXBM4KA0PbVmMuFDp1O?&%U~R@edxqZdm-+vWXo> zetTr1?;q9;*DTKeZo$I?4Ka}B==Uz%792nE)U$)^?{5+|PoF+`-=cxwICy@& zbMAKGkvF!U`Q#wG`~+OS@yly6_x4_R;;|>sU3>KCvQ=-q8~DK-#fi(#g7*6 zUbFYL`=2}Z*;AW7Cttewcn5#@`sLfLwDaOv?@b$~AN|0g{g;kBee7u8s^fR=eCWn1 eCidkgu45K{@f-K4`~GZ4P5r&=vj^91yZhfiTeMIB literal 0 HcmV?d00001 diff --git a/Assets/Sprites/Walls/bman_sprite_snowmound_v02.png.meta b/Assets/Sprites/Walls/bman_sprite_snowmound_v02.png.meta new file mode 100644 index 0000000..9f5e8da --- /dev/null +++ b/Assets/Sprites/Walls/bman_sprite_snowmound_v02.png.meta @@ -0,0 +1,110 @@ +fileFormatVersion: 2 +guid: 8f9176eb354da424795fcd8d93e4c02f +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 6 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 64 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 800b2849763ca47ecb0c4a57d3e60146 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/GraphicsSettings.asset b/ProjectSettings/GraphicsSettings.asset index c4c9a12..44f1158 100644 --- a/ProjectSettings/GraphicsSettings.asset +++ b/ProjectSettings/GraphicsSettings.asset @@ -1,58 +1,58 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!30 &1 -GraphicsSettings: - m_ObjectHideFlags: 0 - serializedVersion: 12 - m_Deferred: - m_Mode: 1 - m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} - m_DeferredReflections: - m_Mode: 1 - m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} - m_ScreenSpaceShadows: - m_Mode: 1 - m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} - m_LegacyDeferred: - m_Mode: 1 - m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} - m_DepthNormals: - m_Mode: 1 - m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} - m_MotionVectors: - m_Mode: 1 - m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} - m_LightHalo: - m_Mode: 1 - m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} - m_LensFlare: - m_Mode: 1 - m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} - m_AlwaysIncludedShaders: - - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!30 &1 +GraphicsSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_Deferred: + m_Mode: 1 + m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} + m_DeferredReflections: + m_Mode: 1 + m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} + m_ScreenSpaceShadows: + m_Mode: 1 + m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} + m_LegacyDeferred: + m_Mode: 1 + m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} + m_DepthNormals: + m_Mode: 1 + m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} + m_MotionVectors: + m_Mode: 1 + m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} + m_LightHalo: + m_Mode: 1 + m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} + m_LensFlare: + m_Mode: 1 + m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} + m_AlwaysIncludedShaders: + - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} - m_PreloadedShaders: [] - m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, - type: 0} - m_CustomRenderPipeline: {fileID: 0} - m_TransparencySortMode: 0 - m_TransparencySortAxis: {x: 0, y: 0, z: 1} - m_DefaultRenderingPath: 1 - m_DefaultMobileRenderingPath: 1 - m_TierSettings: [] - m_LightmapStripping: 0 - m_FogStripping: 0 - m_InstancingStripping: 0 - m_LightmapKeepPlain: 1 - m_LightmapKeepDirCombined: 1 - m_LightmapKeepDynamicPlain: 1 - m_LightmapKeepDynamicDirCombined: 1 - m_LightmapKeepShadowMask: 1 - m_LightmapKeepSubtractive: 1 - m_FogKeepLinear: 1 - m_FogKeepExp: 1 - m_FogKeepExp2: 1 - m_AlbedoSwatchInfos: [] - m_LightsUseLinearIntensity: 0 - m_LightsUseColorTemperature: 0 + - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} + m_PreloadedShaders: [] + m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, + type: 0} + m_CustomRenderPipeline: {fileID: 0} + m_TransparencySortMode: 3 + m_TransparencySortAxis: {x: 0, y: 1, z: 0} + m_DefaultRenderingPath: 1 + m_DefaultMobileRenderingPath: 1 + m_TierSettings: [] + m_LightmapStripping: 0 + m_FogStripping: 0 + m_InstancingStripping: 0 + m_LightmapKeepPlain: 1 + m_LightmapKeepDirCombined: 1 + m_LightmapKeepDynamicPlain: 1 + m_LightmapKeepDynamicDirCombined: 1 + m_LightmapKeepShadowMask: 1 + m_LightmapKeepSubtractive: 1 + m_FogKeepLinear: 1 + m_FogKeepExp: 1 + m_FogKeepExp2: 1 + m_AlbedoSwatchInfos: [] + m_LightsUseLinearIntensity: 0 + m_LightsUseColorTemperature: 0 From 00e2abf8e3d7061d84b7ea6d08d52db3fb68c0e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Nu=C8=9Biu?= Date: Sun, 9 Jun 2019 23:33:48 +0300 Subject: [PATCH 2/2] Reformat Bomb Code --- Assets/Scripts/src/Ammo/BombController.cs | 114 +++++++++--------- Assets/Scripts/src/Ammo/Explosion.cs | 5 +- .../Scripts/src/Managers/BombStatsManager.cs | 51 ++++---- 3 files changed, 83 insertions(+), 87 deletions(-) diff --git a/Assets/Scripts/src/Ammo/BombController.cs b/Assets/Scripts/src/Ammo/BombController.cs index 0c516be..b59cb9e 100644 --- a/Assets/Scripts/src/Ammo/BombController.cs +++ b/Assets/Scripts/src/Ammo/BombController.cs @@ -1,68 +1,72 @@ using System.Collections; -using System.Collections.Generic; +using src.Managers; using UnityEngine; -public class BombController : MonoBehaviour, IExplosable +namespace src.Ammo { - public GameObject explosionPrefab; - - BombStatsManager bombStatsUtil = BombStatsManager.Instance; - bool exploded = false; - - // Start is called before the first frame update - void Start() + public class BombController : MonoBehaviour, IExplosable { - Invoke("Explode", bombStatsUtil.Timer); - } + public GameObject explosionPrefab; - void Explode() - { - Instantiate(explosionPrefab, transform.position, Quaternion.identity); + private readonly BombStatsManager _bombStatsUtil = BombStatsManager.Instance; + private bool _exploded; - GetComponent().enabled = false; - transform.Find("2DCollider").gameObject.SetActive(false); - - StartCoroutine(CreateExplosions(Vector3.down)); - StartCoroutine(CreateExplosions(Vector3.left)); - StartCoroutine(CreateExplosions(Vector3.up)); - StartCoroutine(CreateExplosions(Vector3.right)); - - exploded = true; - Destroy(gameObject, 0.3f); - } - - private IEnumerator CreateExplosions(Vector3 direction) - { - for (int i = 1; i < bombStatsUtil.Power; i++) + // Start is called before the first frame update + void Start() { - RaycastHit2D hit = Physics2D.Raycast(new Vector2(transform.position.x, transform.position.y), direction, i, 1 << 8); - if (!hit.collider) - { - Instantiate(explosionPrefab, transform.position + (i * direction), explosionPrefab.transform.rotation); - } - else - { - break; - } - + Invoke(nameof(Explode), _bombStatsUtil.Timer); } - yield return new WaitForSeconds(0.05f); - - } - - public void OnTriggerEnter2D(Collider2D other) - { - if (!exploded && other.CompareTag("Explosion")) + void Explode() { - onExplosion(); + Instantiate(explosionPrefab, transform.position, Quaternion.identity); + + GetComponent().enabled = false; + transform.Find("2DCollider").gameObject.SetActive(false); + + StartCoroutine(CreateExplosions(Vector3.down)); + StartCoroutine(CreateExplosions(Vector3.left)); + StartCoroutine(CreateExplosions(Vector3.up)); + StartCoroutine(CreateExplosions(Vector3.right)); + + _exploded = true; + Destroy(gameObject, 0.3f); + } + + private IEnumerator CreateExplosions(Vector3 direction) + { + for (int i = 1; i < _bombStatsUtil.Power; i++) + { + RaycastHit2D hit = Physics2D.Raycast(transform.position, direction, i, + 1 << 8); + if (!hit.collider) + { + Instantiate(explosionPrefab, transform.position + i * direction, + explosionPrefab.transform.rotation); + } + else + { + break; + } + } + + yield return new WaitForSeconds(0.05f); + } + + public void OnTriggerEnter2D(Collider2D other) + { + if (!_exploded && other.CompareTag("Explosion")) + { + onExplosion(); + } + } + + public void onExplosion() + { + // In caz ca o bomba loveste bomba, dam cancel la explozie + // sa nu explodeze twice si o explodam automagic + CancelInvoke(nameof(Explode)); + Explode(); } } - - public void onExplosion() - { - //In caz ca o bomba loveste bomba, dam cancel la explozie sa nu explodeze twice si o explodam automagic - CancelInvoke("Explode"); - Explode(); - } -} +} \ No newline at end of file diff --git a/Assets/Scripts/src/Ammo/Explosion.cs b/Assets/Scripts/src/Ammo/Explosion.cs index ca22366..b453fd1 100644 --- a/Assets/Scripts/src/Ammo/Explosion.cs +++ b/Assets/Scripts/src/Ammo/Explosion.cs @@ -1,13 +1,14 @@ using System.Collections; using System.Collections.Generic; +using src.Managers; using UnityEngine; public class Explosion : MonoBehaviour { - BombStatsManager bombUtil = BombStatsManager.Instance; + private readonly BombStatsManager _bombUtil = BombStatsManager.Instance; public void Start() { - Destroy(gameObject, bombUtil.ExplosionDuration); + Destroy(gameObject, _bombUtil.ExplosionDuration); } } diff --git a/Assets/Scripts/src/Managers/BombStatsManager.cs b/Assets/Scripts/src/Managers/BombStatsManager.cs index b6af6d1..d30f1ee 100644 --- a/Assets/Scripts/src/Managers/BombStatsManager.cs +++ b/Assets/Scripts/src/Managers/BombStatsManager.cs @@ -1,36 +1,27 @@ -using System.Collections; -using System.Collections.Generic; - -public sealed class BombStatsManager +namespace src.Managers { - - private static readonly BombStatsManager instance = new BombStatsManager(); - const int MAX_POWER = 7; - - public int Power { get; private set; } = 3; - - public float Timer { get; } = 3.0f; - - public float ExplosionDuration { get; } = 0.55f; - - private BombStatsManager() + public sealed class BombStatsManager { - } + private const int MaxPower = 7; - public static BombStatsManager Instance - { - get + public int Power { get; private set; } = 3; + + public float Timer { get; } = 3.0f; + + public float ExplosionDuration { get; } = 0.55f; + + private BombStatsManager() { - return instance; + } + + public static BombStatsManager Instance { get; } = new BombStatsManager(); + + public void IncreasePower() + { + if (Power <= MaxPower) + { + Power++; + } } } - - public void increasePower() - { - if(Power <= MAX_POWER) - { - Power++; - } - } - -} +} \ No newline at end of file