Skip to content
Snippets Groups Projects
Commit 583d5276 authored by FISCHER MELVYN's avatar FISCHER MELVYN
Browse files

Merge branch 'master' into 'master'

Ajout de plus d'items et ajout des dialogues d'achats

See merge request chirz/cityescape!60
parents 7b75fbba 45837482
No related merge requests found
......@@ -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}
......
......@@ -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
......@@ -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:
......@@ -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",
......
......@@ -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");
}
......
......@@ -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");
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment