diff --git a/Assets/Prefabs/Stove.prefab b/Assets/Prefabs/Stove.prefab index ac08e2f30b799e1b50d8a36d7f14793f585a6360..a30634c6c27fa76b7b896c3f2209244b62104299 100644 --- a/Assets/Prefabs/Stove.prefab +++ b/Assets/Prefabs/Stove.prefab @@ -68,8 +68,8 @@ SpriteRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 + m_SortingLayerID: 2045603605 + m_SortingLayer: 3 m_SortingOrder: 0 m_Sprite: {fileID: 21300000, guid: 2d69e0f0370a1464c9f0da7d8e4f2a63, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Prefabs/tent.prefab b/Assets/Prefabs/tent.prefab index 5230643859e96cd08fbf0f7031b57f4a1054d089..97b773dc7f34b8919e35eaa56a64a757b3776f5a 100644 --- a/Assets/Prefabs/tent.prefab +++ b/Assets/Prefabs/tent.prefab @@ -10,7 +10,7 @@ GameObject: m_Component: - component: {fileID: 2594227356551208515} - component: {fileID: 7604435187626042244} - - component: {fileID: 3737178317091432126} + - component: {fileID: 4313274779673652663} m_Layer: 0 m_Name: tent m_TagString: Untagged @@ -83,8 +83,8 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!60 &3737178317091432126 -PolygonCollider2D: +--- !u!61 &4313274779673652663 +BoxCollider2D: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} @@ -96,7 +96,7 @@ PolygonCollider2D: m_IsTrigger: 0 m_UsedByEffector: 0 m_UsedByComposite: 0 - m_Offset: {x: 0, y: 0} + m_Offset: {x: 0.0000009536743, y: -1.9999735} m_SpriteTilingProperty: border: {x: 0, y: 0, z: 0, w: 0} pivot: {x: 0.5, y: 0.5} @@ -106,20 +106,6 @@ PolygonCollider2D: drawMode: 0 adaptiveTiling: 0 m_AutoTiling: 0 - m_Points: - m_Paths: - - - {x: 4.625, y: -3.6875} - - {x: 4.125, y: -3.5} - - {x: 4.625, y: 0.4375} - - {x: 4.625, y: 2.75} - - {x: 3.5625, y: 2.6875} - - {x: 0.5, y: 5} - - {x: -0.3125, y: 5} - - {x: -3.9375, y: 2.625} - - {x: -4.4375, y: 2.5625} - - {x: -4.625, y: 2.375} - - {x: -4.625, y: 1.125} - - {x: -4.125, y: 0.9375} - - {x: -4.625, y: -2.5625} - - {x: -4.625, y: -5} - - {x: 4.625, y: -5} + serializedVersion: 2 + m_Size: {x: 8.993399, y: 7.271563} + m_EdgeRadius: 0 diff --git a/Assets/Scenes/sceneRaffael.unity b/Assets/Scenes/sceneRaffael.unity index 43f54bd2d0819ae17ba954804b8cde783dd1dfe2..16524f6e36c8ec5d39dffbe20d3165d8396d5284 100644 --- a/Assets/Scenes/sceneRaffael.unity +++ b/Assets/Scenes/sceneRaffael.unity @@ -969,7 +969,7 @@ MonoBehaviour: tente: {fileID: 11400000, guid: d72fe29080571f44ca0c6bd0d22ece7b, type: 2} GO_chaussures: {fileID: 2774278137072603174, guid: cf11893c496404d8292ea5623a2a0f32, type: 3} GO_baton: {fileID: 0} - GO_rechaud: {fileID: 0} + GO_rechaud: {fileID: 6742524767965565839, guid: a4179d20809394cfda68d226fc249d0b, type: 3} GO_tente: {fileID: 5026905876964516861, guid: 7bc98558919f34933bf9602e33e1bead, type: 3} pVillage: - {fileID: 1755158007606780204, guid: 97a340a9fc5ba2740b666b8014d03955, type: 3} @@ -5587,7 +5587,7 @@ BoxCollider2D: m_IsTrigger: 0 m_UsedByEffector: 0 m_UsedByComposite: 0 - m_Offset: {x: -11.424435, y: -9.918285} + m_Offset: {x: -11.424435, y: -9.144066} m_SpriteTilingProperty: border: {x: 0, y: 0, z: 0, w: 0} pivot: {x: 0, y: 0} @@ -5598,7 +5598,7 @@ BoxCollider2D: adaptiveTiling: 0 m_AutoTiling: 0 serializedVersion: 2 - m_Size: {x: 49.0467, y: 9.066109} + m_Size: {x: 49.0467, y: 7.5176697} m_EdgeRadius: 0 --- !u!4 &1467294797 stripped Transform: diff --git a/Assets/Scripts/GUI/Dialog.cs b/Assets/Scripts/GUI/Dialog.cs index dff10dd82c846399d5e2f278b84a4dffa59ab574..1f6d2ba2f61c9231d21f4232e17979b8fd528134 100644 --- a/Assets/Scripts/GUI/Dialog.cs +++ b/Assets/Scripts/GUI/Dialog.cs @@ -72,11 +72,31 @@ public class Dialog : MonoBehaviour this.ListDialogs.Add("test", DialogsTest); - string[] DialogMarchand = { - "Ouvrir le menu c'est avec", - "la touche E chacal" + + string[] boutiqueChaussure = { + "Je fous prendrais zes"," chauzzures, en taille"," Zweiundvierzig Bitte !", + }; + this.ListDialogs.Add("boutiqueChaussure", boutiqueChaussure); + + string[] boutiqueBaton = { + "Ze bâton me semble"," assez long et solide"," pour moi ! J'achète !", + }; + this.ListDialogs.Add("boutiqueBaton", boutiqueBaton); + + string[] boutiqueRechaud = { + " Ze réchaud fa être", + "SEHR PRAKTISCH, j'achète", + "tout de zuite !", }; - this.ListDialogs.Add("Marchand", DialogMarchand); + this.ListDialogs.Add("boutiqueRechaud", boutiqueRechaud); + + string[] boutiqueTente = { + "J'adore ta tente, mais"," elle est un peu grosse non ?", + "Ach, tant pis, J'ACHETE !" + }; + this.ListDialogs.Add("boutiqueTente", boutiqueTente); + + string[] DialogChaussure = { "J'ai mal au pied", diff --git a/Assets/Scripts/Game/GenerateMap.cs b/Assets/Scripts/Game/GenerateMap.cs index feb9f5e767ec0f274e30773055368a2df28fdee9..d01850c97fe7a905afa4ecce605c98d4decddbdc 100644 --- a/Assets/Scripts/Game/GenerateMap.cs +++ b/Assets/Scripts/Game/GenerateMap.cs @@ -54,6 +54,8 @@ public class GenerateMap : MonoBehaviour public void generateBoutique(int column, int line, string objetVente) { + float xOffset = 0; + float yOffset = 0; Destroy(plot[column, line]); Item itemToSell = null; @@ -63,18 +65,26 @@ public class GenerateMap : MonoBehaviour case "chaussure": itemToSell = chaussures; goToSell = GO_chaussures; + xOffset = 0; + yOffset = 6.1F; break; case "baton": itemToSell = baton; goToSell = GO_baton; + xOffset = 0; + yOffset = 0; break; - case "réchaud": + case "rechaud": itemToSell = rechaud; goToSell = GO_rechaud; + xOffset = 0; + yOffset = 6.10F; break; case "tente": itemToSell = tente; goToSell = GO_tente; + xOffset = 2.7F; + yOffset = 2.27F; break; } if (itemToSell && goToSell) @@ -84,9 +94,12 @@ public class GenerateMap : MonoBehaviour shop.transform.Find("Shop").gameObject.GetComponent<Shopping>().sellItem = itemToSell; shop.transform.Find("Shop").gameObject.GetComponent<Shopping>().itemForSale.Add(goToSell); plot[column, line] = shop; + float x = shop.transform.position.x + xOffset; + float y = shop.transform.position.y + yOffset; + Instantiate(goToSell, new Vector3(x, y, 0), Quaternion.identity); } else - Debug.LogError("Mauvais paramètre pour objetVente"); + Debug.LogError("Mauvais paramètre pour objetVente: "+ objetVente); } public void generateUsine(int column, int line) @@ -99,9 +112,11 @@ public class GenerateMap : MonoBehaviour public void generateBoutiqueTest() { // COLONNE, LIGNE - generateBoutique(0, 0, "chaussure"); + generateBoutique(0, 0, "rechaud"); generateUsine(1, 0); generateBoutique(0, 1, "tente"); + generateBoutique(1, 2, "baton"); + generateBoutique(1, 1, "chaussure"); } diff --git a/Assets/Shopping.cs b/Assets/Shopping.cs index a978ea9afac0f921154767917576bd6a94b925b1..ad98488ad8c8faeb317a5893c206afb6672754d2 100644 --- a/Assets/Shopping.cs +++ b/Assets/Shopping.cs @@ -20,7 +20,21 @@ public class Shopping : MonoBehaviour { if (Input.GetKeyDown(KeyCode.E) && playerInRange && sellItem && itemForSale.Count>0) { - Dialog.instance.setSituation("Marchand"); + switch (sellItem.id) + { + case 1: + Dialog.instance.setSituation("boutiqueChaussure"); + break; + case 2: + Dialog.instance.setSituation("boutiqueBaton"); + break; + case 3: + Dialog.instance.setSituation("boutiqueRechaud"); + break; + case 4: + Dialog.instance.setSituation("boutiqueTente"); + break; + } Inventory.instance.addItem(sellItem); Destroy(itemForSale[0]); Debug.Log(sellItem.name.ToString() + " a bien ete ajouté a l'inventaire");