diff --git a/Assets/Béton-Menu.psd b/Assets/Béton-Menu.psd new file mode 100644 index 0000000..cbdf5ad Binary files /dev/null and b/Assets/Béton-Menu.psd differ diff --git a/Assets/Béton-Menu.psd.meta b/Assets/Béton-Menu.psd.meta new file mode 100644 index 0000000..717e8e5 --- /dev/null +++ b/Assets/Béton-Menu.psd.meta @@ -0,0 +1,99 @@ +fileFormatVersion: 2 +guid: d47c27af7df20204f862e9c56b79c149 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 7 + 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: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + 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: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Player.prefab b/Assets/Prefabs/Player.prefab index e420f68..70c66fb 100644 --- a/Assets/Prefabs/Player.prefab +++ b/Assets/Prefabs/Player.prefab @@ -56,7 +56,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1295779273530774} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -4.862474, y: -0.615, z: 0} + m_LocalPosition: {x: -10.441891, y: 0.8572689, z: 0} m_LocalScale: {x: 3.5722172, y: 3.5545542, z: 3.2728415} m_Children: - {fileID: 4963255545268272} @@ -90,7 +90,7 @@ Rigidbody2D: m_Mass: 1 m_LinearDrag: 0 m_AngularDrag: 0.05 - m_GravityScale: 2 + m_GravityScale: 3 m_Material: {fileID: 6200000, guid: 082e03d7d0d0c5640afa7f05f0e6e8ce, type: 2} m_Interpolate: 1 m_SleepingMode: 0 @@ -266,7 +266,7 @@ MonoBehaviour: TakeKey: 0 setuped: 0 sensiX: 140 - sensiY: 7 + sensiY: 8.52 DownDetector: 0.5 SideMargin: 0.6 layerMask: 512 @@ -4956,7 +4956,7 @@ SpriteRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_Sprite: {fileID: 10901, guid: 0000000000000000f000000000000000, type: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Color: {r: 0.6901961, g: 0.6666667, b: 0.627451, a: 1} m_FlipX: 0 m_FlipY: 0 m_DrawMode: 0 diff --git a/Assets/Scenes/Level 1.unity b/Assets/Scenes/Level 1.unity index be5b628..11f6a72 100644 --- a/Assets/Scenes/Level 1.unity +++ b/Assets/Scenes/Level 1.unity @@ -177,7 +177,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} --- !u!1 &403186791 GameObject: @@ -224,7 +224,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 5 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!82 &403186794 AudioSource: @@ -3184,7 +3184,7 @@ TilemapCollider2D: m_Material: {fileID: 0} m_IsTrigger: 0 m_UsedByEffector: 0 - m_UsedByComposite: 1 + m_UsedByComposite: 0 m_Offset: {x: 0, y: 0} --- !u!66 &489446564 CompositeCollider2D: @@ -3202,95 +3202,9 @@ CompositeCollider2D: m_GeometryType: 1 m_GenerationType: 0 m_EdgeRadius: 0 - m_ColliderPaths: - - m_Collider: {fileID: 489446563} - m_ColliderPaths: - - - X: 90000000 - Y: 50150004 - - X: 80048840 - Y: 50150004 - - X: 80048840 - Y: 50218568 - - X: -60029296 - Y: 50218568 - - X: -60029296 - Y: 40129796 - - X: -49990236 - Y: 40129796 - - X: -49990236 - Y: 30060616 - - X: -40000000 - Y: 30060616 - - X: -40000000 - Y: 10020212 - - X: -10029297 - Y: 10020212 - - X: -10029297 - Y: -10000615 - - X: -79843752 - Y: -10000615 - - X: -79843752 - Y: 10020212 - - X: -59912108 - Y: 10020212 - - X: -59912108 - Y: 20108982 - - X: -69951168 - Y: 20108982 - - X: -69951168 - Y: 30178154 - - X: -79843752 - Y: 30178154 - - X: -79843752 - Y: 50218568 - - X: -110029296 - Y: 50218568 - - X: -110029296 - Y: 50150004 - - X: -120000000 - Y: 50150004 - - X: -120000000 - Y: -60180000 - - X: -110029296 - Y: -60180000 - - X: -110029296 - Y: -70210000 - - X: 80029296 - Y: -70210000 - - X: 80029296 - Y: -60023284 - - X: 90000000 - Y: -60023284 + m_ColliderPaths: [] m_CompositePaths: - m_Paths: - - - {x: 8.00293, y: -6.0023284} - - {x: 9, y: -6.0023284} - - {x: 9, y: 5.0150003} - - {x: 8.004884, y: 5.0150003} - - {x: 8.004884, y: 5.021857} - - {x: -6.0029297, y: 5.021857} - - {x: -6.0029297, y: 4.0129795} - - {x: -4.9990234, y: 4.0129795} - - {x: -4.9990234, y: 3.0060616} - - {x: -4, y: 3.0060616} - - {x: -4, y: 1.0020212} - - {x: -1.0029297, y: 1.0020212} - - {x: -1.0029297, y: -1.0000615} - - {x: -7.9843755, y: -1.0000615} - - {x: -7.9843755, y: 1.0020212} - - {x: -5.991211, y: 1.0020212} - - {x: -5.991211, y: 2.010898} - - {x: -6.9951167, y: 2.010898} - - {x: -6.9951167, y: 3.0178154} - - {x: -7.9843755, y: 3.0178154} - - {x: -7.9843755, y: 5.021857} - - {x: -11.00293, y: 5.021857} - - {x: -11.00293, y: 5.0150003} - - {x: -12, y: 5.0150003} - - {x: -12, y: -6.018} - - {x: -11.00293, y: -6.018} - - {x: -11.00293, y: -7.021} - - {x: 8.00293, y: -7.021} + m_Paths: [] m_VertexDistance: 0.0005 --- !u!50 &489446565 Rigidbody2D: @@ -3387,7 +3301,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &818206739 Prefab: @@ -3426,7 +3340,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 4160410025016832, guid: 92808b4d31a950f4b81823648c3f4381, type: 2} propertyPath: m_RootOrder - value: 2 + value: 3 objectReference: {fileID: 0} - target: {fileID: 1937531234487126, guid: 92808b4d31a950f4b81823648c3f4381, type: 2} propertyPath: m_IsActive @@ -3472,7 +3386,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 4345067943353424, guid: f5eee23f42e32c740a46ae6b64fb96e1, type: 2} propertyPath: m_RootOrder - value: 1 + value: 2 objectReference: {fileID: 0} - target: {fileID: 1295779273530774, guid: f5eee23f42e32c740a46ae6b64fb96e1, type: 2} propertyPath: m_IsActive @@ -3589,6 +3503,81 @@ Tilemap: e31: 0 e32: 0 e33: 1 +--- !u!1 &1116154417 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1116154419} + - component: {fileID: 1116154418} + m_Layer: 0 + m_Name: TerreFond (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &1116154418 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1116154417} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 4294967295 + 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: ce4c2a89c0029b448a5722144a4b7f18, type: 3} + m_Color: {r: 0.9339623, g: 0.9339623, b: 0.9339623, a: 1} + m_FlipX: 1 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 25.6, y: 25.6} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!4 &1116154419 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1116154417} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -1.09, y: -8.05, z: 2.96} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1919711501 GameObject: m_ObjectHideFlags: 0 @@ -3630,7 +3619,7 @@ Transform: - {fileID: 489446560} - {fileID: 963624498} m_Father: {fileID: 0} - m_RootOrder: 4 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2036025997 GameObject: @@ -4007,3 +3996,78 @@ Tilemap: e31: 0 e32: 0 e33: 1 +--- !u!1 &2108054198 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2108054200} + - component: {fileID: 2108054199} + m_Layer: 0 + m_Name: TerreFond + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &2108054199 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2108054198} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 4294967295 + 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: 0c7ab4336955b8146b5228add293d59c, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 25.6, y: 25.6} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 0 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!4 &2108054200 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2108054198} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -1.26, y: -2.3, z: 1.42} + 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} diff --git a/Assets/Scenes/Main Menu.unity b/Assets/Scenes/Main Menu.unity index 9208503..92a603d 100644 --- a/Assets/Scenes/Main Menu.unity +++ b/Assets/Scenes/Main Menu.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_IndirectSpecularColor: {r: 0.44657844, g: 0.49641222, b: 0.57481694, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -113,107 +113,6 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1 &103205097 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 103205100} - - component: {fileID: 103205099} - - component: {fileID: 103205098} - m_Layer: 0 - m_Name: Groud - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!61 &103205098 -BoxCollider2D: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 103205097} - m_Enabled: 1 - m_Density: 1 - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_UsedByEffector: 0 - m_UsedByComposite: 0 - m_Offset: {x: 0, y: 0} - m_SpriteTilingProperty: - border: {x: 0, y: 0, z: 0, w: 0} - pivot: {x: 0.5, y: 0.5} - 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 ---- !u!212 &103205099 -SpriteRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 103205097} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_DynamicOccludee: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RenderingLayerMask: 4294967295 - 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: 0f0229bf37171004fb08c6ec8a3946e5, 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!4 &103205100 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 103205097} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: -3.23, z: 0} - m_LocalScale: {x: 53.643, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &147685083 GameObject: m_ObjectHideFlags: 0 @@ -500,6 +399,35 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &458587139 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 458587140} + m_Layer: 0 + m_Name: "B\xE9ton" + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &458587140 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 458587139} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.0997946, y: -1.4763749, z: 9.075662} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 925349207} + m_Father: {fileID: 0} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &793094320 GameObject: m_ObjectHideFlags: 0 @@ -577,6 +505,81 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &925349205 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 925349207} + - component: {fileID: 925349206} + m_Layer: 0 + m_Name: "B\xE9ton-Menu" + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &925349206 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 925349205} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 4294967295 + 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: d47c27af7df20204f862e9c56b79c149, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 10.24, y: 7.68} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!4 &925349207 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 925349205} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.28, y: -4.09, z: -9.075662} + m_LocalScale: {x: 1.9704711, y: 0.43593055, z: 1} + m_Children: [] + m_Father: {fileID: 458587140} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1184867774 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Script/EnvironementManager.cs b/Assets/Script/EnvironementManager.cs index a790d5a..9a580e5 100644 --- a/Assets/Script/EnvironementManager.cs +++ b/Assets/Script/EnvironementManager.cs @@ -10,14 +10,14 @@ public class EnvironementManager : MonoBehaviour private void Update() { - if (Input.GetMouseButtonDown(0)) - { - Vector3 pos = cam.ScreenToWorldPoint(Input.mousePosition); - BreakTile(tilemap.WorldToCell(pos)); - } + //if (Input.GetMouseButtonDown(0)) + //{ + // Vector3 pos = cam.ScreenToWorldPoint(Input.mousePosition); + // BreakTile(tilemap.WorldToCell(pos)); + //} } - void BreakTile(Vector3Int pos) + public void BreakTile(Vector3Int pos) { tilemap.SetTile(pos, null); diff --git a/Assets/Script/PlayerController.cs b/Assets/Script/PlayerController.cs index 619c7b8..af32a24 100644 --- a/Assets/Script/PlayerController.cs +++ b/Assets/Script/PlayerController.cs @@ -31,6 +31,8 @@ public class PlayerController : MonoBehaviour SpriteRenderer rend; [SerializeField] ParticleSystem Particule; + [SerializeField] + float UseRange = 1; //variables de mort [SerializeField] @@ -50,6 +52,7 @@ public class PlayerController : MonoBehaviour rend = gameObject.GetComponent(); GameManager = GameObject.FindGameObjectWithTag("GameManager"); AS = gameObject.GetComponent(); + Particule = GetComponentInChildren(); //gameObject.GetComponent(); } @@ -140,6 +143,34 @@ public class PlayerController : MonoBehaviour } } Move(horizontal, vertical); + + //on check pour péter un block + + if (Input.GetKey(UseKey)) + { + Debug.Log("here"); + Ray2D DestroyRay = new Ray2D(transform.position,Vector2.right); + RaycastHit2D hit; + + if (rend.flipX) + { + hit = Physics2D.Raycast(DestroyRay.origin, DestroyRay.direction, UseRange, layerMask); + Debug.DrawRay(DestroyRay.origin, DestroyRay.direction, Color.blue); + } + else + { + DestroyRay = new Ray2D(transform.position, Vector2.left); + hit = Physics2D.Raycast(DestroyRay.origin, DestroyRay.direction, UseRange, layerMask); + Debug.DrawRay(DestroyRay.origin, DestroyRay.direction, Color.blue); + } + + if(hit.collider != null) + { + GameManager.GetComponent().BreakTile(new Vector3Int(Mathf.RoundToInt(hit.transform.position[0]), Mathf.RoundToInt(hit.transform.position[1]), Mathf.RoundToInt(hit.transform.position[2]) )); + } + } + + }