diff --git a/Assets/Materials/Camera.mat b/Assets/Materials/Camera.mat index b702f61..f98dea3 100644 --- a/Assets/Materials/Camera.mat +++ b/Assets/Materials/Camera.mat @@ -1,82 +1,82 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Camera - m_Shader: {fileID: 4800000, guid: 37e8fe914eb083bf39337914a4c653c7, type: 3} - m_ShaderKeywords: - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BumpMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _SpecGlossMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - _BumpScale: 1 - - _Cutoff: 0.5 - - _DetailNormalMapScale: 1 - - _DstBlend: 0 - - _Fear: 0 - - _GlossMapScale: 1 - - _Glossiness: 0.5 - - _GlossyReflections: 1 - - _Metallic: 0 - - _Mode: 0 - - _OcclusionStrength: 1 - - _Parallax: 0.02 - - _SmoothnessTextureChannel: 0 - - _SpecularHighlights: 1 - - _SrcBlend: 1 - - _UVSec: 0 - - _ZWrite: 1 - m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} - - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Camera + m_Shader: {fileID: 4800000, guid: 37e8fe914eb083bf39337914a4c653c7, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _Fear: 6.9448357 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/Prefabs/boutBois.prefab b/Assets/Prefabs/boutBois.prefab index 521d2b2..6ab6156 100644 --- a/Assets/Prefabs/boutBois.prefab +++ b/Assets/Prefabs/boutBois.prefab @@ -70,7 +70,7 @@ SpriteRenderer: m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 - m_SortingOrder: 0 + m_SortingOrder: 1 m_Sprite: {fileID: 21300000, guid: e80d1815df02cb4c98ff9961060416e9, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 diff --git a/Assets/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity index 2402514..74115da 100644 --- a/Assets/Scenes/MainScene.unity +++ b/Assets/Scenes/MainScene.unity @@ -5212,85 +5212,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 395457863} m_CullTransparentMesh: 0 ---- !u!1 &396501308 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 396501310} - - component: {fileID: 396501309} - m_Layer: 0 - m_Name: prefabsFireItems - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!212 &396501309 -SpriteRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 396501308} - 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: 0} - 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: 0 - m_MaskInteraction: 0 - m_SpriteSortPoint: 0 ---- !u!4 &396501310 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 396501308} - 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: 2071832937} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &438518084 GameObject: m_ObjectHideFlags: 0 @@ -5533,6 +5454,81 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: fear: {fileID: 1813392669} +--- !u!1001 &623527394 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 2071832937} + m_Modifications: + - target: {fileID: 8419056591009497155, guid: cacb857df88e50dd2934e22cadbcdd65, + type: 3} + propertyPath: m_Name + value: boutBois + objectReference: {fileID: 0} + - target: {fileID: 8419056591009497181, guid: cacb857df88e50dd2934e22cadbcdd65, + type: 3} + propertyPath: m_LocalPosition.x + value: -10.556381 + objectReference: {fileID: 0} + - target: {fileID: 8419056591009497181, guid: cacb857df88e50dd2934e22cadbcdd65, + type: 3} + propertyPath: m_LocalPosition.y + value: 4.1068177 + objectReference: {fileID: 0} + - target: {fileID: 8419056591009497181, guid: cacb857df88e50dd2934e22cadbcdd65, + type: 3} + propertyPath: m_LocalPosition.z + value: -7.624054 + objectReference: {fileID: 0} + - target: {fileID: 8419056591009497181, guid: cacb857df88e50dd2934e22cadbcdd65, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8419056591009497181, guid: cacb857df88e50dd2934e22cadbcdd65, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8419056591009497181, guid: cacb857df88e50dd2934e22cadbcdd65, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8419056591009497181, guid: cacb857df88e50dd2934e22cadbcdd65, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8419056591009497181, guid: cacb857df88e50dd2934e22cadbcdd65, + type: 3} + propertyPath: m_RootOrder + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 8419056591009497181, guid: cacb857df88e50dd2934e22cadbcdd65, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8419056591009497181, guid: cacb857df88e50dd2934e22cadbcdd65, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8419056591009497181, guid: cacb857df88e50dd2934e22cadbcdd65, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: cacb857df88e50dd2934e22cadbcdd65, type: 3} +--- !u!1 &623527395 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 8419056591009497155, guid: cacb857df88e50dd2934e22cadbcdd65, + type: 3} + m_PrefabInstance: {fileID: 623527394} + m_PrefabAsset: {fileID: 0} --- !u!1 &659000950 stripped GameObject: m_CorrespondingSourceObject: {fileID: 4456067052643620032, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, @@ -12124,7 +12120,7 @@ MonoBehaviour: pointLight: {fileID: 2120210110} fireGUI: {fileID: 1591276121} player: {fileID: 1813392661} - prefabsFireElement: {fileID: 396501308} + prefabsFireElement: {fileID: 623527395} rain: {fileID: 711021684} startUpSpriteCombustibleElement: {fileID: 21300000, guid: e80d1815df02cb4c98ff9961060416e9, type: 3} @@ -12223,6 +12219,51 @@ PrefabInstance: propertyPath: m_LocalScale.y value: 1 objectReference: {fileID: 0} + - target: {fileID: 4456067053799440004, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, + type: 3} + propertyPath: m_LocalScale.x + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 4456067053799440004, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, + type: 3} + propertyPath: m_LocalScale.y + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 4456067053799440004, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4456067052523149905, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, + type: 3} + propertyPath: m_LocalScale.x + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 4456067052523149905, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, + type: 3} + propertyPath: m_LocalScale.y + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 4456067052523149905, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4456067052643620033, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, + type: 3} + propertyPath: m_LocalScale.x + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 4456067052643620033, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, + type: 3} + propertyPath: m_LocalScale.y + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 4456067052643620033, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} - target: {fileID: 4456067053869943926, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, type: 3} propertyPath: m_Range @@ -12273,51 +12314,6 @@ PrefabInstance: propertyPath: m_SpotAngle value: 179 objectReference: {fileID: 0} - - target: {fileID: 4456067053799440004, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, - type: 3} - propertyPath: m_LocalScale.x - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 4456067053799440004, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, - type: 3} - propertyPath: m_LocalScale.y - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 4456067053799440004, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, - type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4456067052523149905, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, - type: 3} - propertyPath: m_LocalScale.x - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 4456067052523149905, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, - type: 3} - propertyPath: m_LocalScale.y - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 4456067052523149905, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, - type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4456067052643620033, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, - type: 3} - propertyPath: m_LocalScale.x - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 4456067052643620033, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, - type: 3} - propertyPath: m_LocalScale.y - value: 5 - objectReference: {fileID: 0} - - target: {fileID: 4456067052643620033, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, - type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - target: {fileID: 4456067053918303198, guid: 5e1cf6fcd61c8af3e8d2800c824bdbf0, type: 3} propertyPath: m_Mass diff --git a/Assets/Scripts/Tent.cs b/Assets/Scripts/Tent.cs index a0869a9..cbdf4fb 100644 --- a/Assets/Scripts/Tent.cs +++ b/Assets/Scripts/Tent.cs @@ -17,27 +17,35 @@ public class Tent : MonoBehaviour public bool playerIsSafe() { - return Vector2.Distance(this.transform.position, player.transform.position) < this.GetComponent().protectionZone; + return Vector2.Distance(this.transform.position, player.transform.position) < this.protectionZone; + } + + public bool isHouse() + { + return protectionZone >= houseLevel; } // Update is called once per frame void Update() { - if (Vector2.Distance(player.transform.position, this.transform.position) < this.protectionZone && - player.GetComponent().GetNumberOfWood() >= 30) + if (playerIsSafe()) { - player.GetComponent().SetInteractMessage(true, protectionZone >= houseLevel ? "maison" : "tente"); - - if (Input.GetKey(KeyCode.E) || Manette.IsUse()) + if (player.GetComponent().GetNumberOfWood() >= 30) { - player.GetComponent().SetInteractMessage(false, ""); - player.GetComponent().BurnObjects(300); - protectionZone += 1; + player.GetComponent().SetInteractMessage(true, protectionZone >= houseLevel ? "maison" : + string.Format("tente ({0} / {1})", 5 - (houseLevel - protectionZone), 5)); - if (protectionZone >= houseLevel) + if (Input.GetKey(KeyCode.E) || Manette.IsUse()) { - this.GetComponent().sprite = maison; - this.GetComponent().constraints = RigidbodyConstraints2D.FreezeAll; + player.GetComponent().SetInteractMessage(false, ""); + player.GetComponent().BurnObjects(300); + protectionZone += 1; + + if (isHouse()) + { + this.GetComponent().sprite = maison; + this.GetComponent().constraints = RigidbodyConstraints2D.FreezeAll; + } } } } diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index ca32b1e..78fa540 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2018.3.0f2 +m_EditorVersion: 2018.3.2f1