Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Showing
with 5630 additions and 117147 deletions
...@@ -68,8 +68,8 @@ SpriteRenderer: ...@@ -68,8 +68,8 @@ SpriteRenderer:
m_AutoUVMaxDistance: 0.5 m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89 m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0} m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0 m_SortingLayerID: 2045603605
m_SortingLayer: 0 m_SortingLayer: 3
m_SortingOrder: 0 m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 2d69e0f0370a1464c9f0da7d8e4f2a63, type: 3} m_Sprite: {fileID: 21300000, guid: 2d69e0f0370a1464c9f0da7d8e4f2a63, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
......
...@@ -173,4 +173,4 @@ MonoBehaviour: ...@@ -173,4 +173,4 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c2eed50797895184ab44621a154ad526, type: 3} m_Script: {fileID: 11500000, guid: c2eed50797895184ab44621a154ad526, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
nbPoints: 8 nbPoints: 5
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2815113491261155828
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1497669276832756932}
- component: {fileID: 1822726001044331824}
m_Layer: 0
m_Name: canne
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1497669276832756932
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2815113491261155828}
m_LocalRotation: {x: 0, y: 0, z: -0.6279631, w: 0.7782431}
m_LocalPosition: {x: 0.93, y: 12.57, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -77.8}
--- !u!212 &1822726001044331824
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2815113491261155828}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
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_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 2045603605
m_SortingLayer: 3
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: afaeb0fb02930884d9aac3ba46cb1adb, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 11.23, y: 11.84}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
fileFormatVersion: 2 fileFormatVersion: 2
guid: 1b0bebe128a4e8345a1550a68ad23be1 guid: 075eeb49ca9e1064ea07781a2deba9ae
DefaultImporter: PrefabImporter:
externalObjects: {} externalObjects: {}
userData: userData:
assetBundleName: assetBundleName:
......
This diff is collapsed.
...@@ -759,9 +759,9 @@ MonoBehaviour: ...@@ -759,9 +759,9 @@ MonoBehaviour:
nextYear: 1875 nextYear: 1875
year: {fileID: 672131795} year: {fileID: 672131795}
city: {fileID: 1075515021} city: {fileID: 1075515021}
scene: Niveau1 scene: sceneRaffael
animmator: {fileID: 1460786684} animmator: {fileID: 1460786684}
name: DUSSELDORF nom: DUSSELDORF
--- !u!4 &1459655252 --- !u!4 &1459655252
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
fileFormatVersion: 2 fileFormatVersion: 2
guid: 5097a5d46361eda43b5a45ce166e49aa guid: 81e39c4f6e44e7345849a14cbef3b3ea
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LoseNature : MonoBehaviour
{
private bool lostLife = false;
private int nbFactory = 0;
public int damageByFactory = 20;
private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.CompareTag("Player"))
{
if (!lostLife)
{
nbFactory = GameObject.FindGameObjectsWithTag("factory").Length;
Debug.Log("il pert de la vie: " + nbFactory * damageByFactory);
collision.GetComponent<PlayerNature>().LooseNature(damageByFactory * nbFactory);
this.lostLife = true;
}
}
}
}
fileFormatVersion: 2 fileFormatVersion: 2
guid: 4ae30febc4f91474fa9164b85521aaf5 guid: acdefb31f22c752ac90ddf2bf056e45c
DefaultImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:
...@@ -14,7 +14,7 @@ public class Dialog : MonoBehaviour ...@@ -14,7 +14,7 @@ public class Dialog : MonoBehaviour
// singleton // singleton
public static Dialog instance; public static Dialog instance;
private void Awake() private void Awake()
{ {
if (instance != null) if (instance != null)
{ {
...@@ -29,6 +29,7 @@ public class Dialog : MonoBehaviour ...@@ -29,6 +29,7 @@ public class Dialog : MonoBehaviour
public GameObject dialogBox; public GameObject dialogBox;
public Text dialogText; public Text dialogText;
public Text instructionText;
public int dialog; public int dialog;
public bool dialogActive; public bool dialogActive;
public string situation; public string situation;
...@@ -45,44 +46,55 @@ public class Dialog : MonoBehaviour ...@@ -45,44 +46,55 @@ public class Dialog : MonoBehaviour
this.dialog = 0; this.dialog = 0;
string[] DialogsLvl1 = { string[] DialogsLvl1 = {
"Coucou", "Ach... Encore eine gute chournée dans mon fillage!",
"Je fais un test pour le niveau 1", "Ch'ai très enfie te me balader",
"Ca marche bien nan ?", "Che defrai aller au Nord dans la forêt ja !",
"Melvyn t moch", "pour me déplacer, je dois utiliser mes muscles 'flèches directionnelles'"
"Valentin aussi",
"Raff est pas bo"
}; };
this.ListDialogs.Add("start", DialogsLvl1);
this.ListDialogs.Add("start", DialogsLvl1); string[] boutiqueChaussure = {
"Je fous prendrais zes chauzzures en taille Zweiundvierzig Bitte !",
};
this.ListDialogs.Add("boutiqueChaussure", boutiqueChaussure);
string[] Dialogsraff = { string[] boutiqueBaton = {
"Salut", "Ze bâton me semble assez long et solide pour moi ! J'achète !",
"cava ?",
"Je te mange tes morts"
}; };
this.ListDialogs.Add("boutiqueBaton", boutiqueBaton);
this.ListDialogs.Add("pnj", Dialogsraff); string[] boutiqueRechaud = {
" Ze réchaud fa être SEHR PRAKTISCH !", "j'achète tout de zuite !"
};
this.ListDialogs.Add("boutiqueRechaud", boutiqueRechaud);
string[] DialogsTest = { string[] boutiqueTente = {
"Je fais un test", "J'adore ta tente, mais elle est un peu grosse non ?", "Ach, tant pis, CH'ACHETE !"
"ca marche ? ou pas ?",
"bisous"
}; };
this.ListDialogs.Add("boutiqueTente", boutiqueTente);
this.ListDialogs.Add("test", DialogsTest);
string[] DialogMarchand = {
"Ouvrir le menu c'est avec", string[] borderChaussure = {
"la touche E chacal" "NEIN NEIN NEIN ! Il fa me falloir des chaussures pour marcher plus loin !"
}; };
this.ListDialogs.Add("Marchand", DialogMarchand); this.ListDialogs.Add("borderChaussure", borderChaussure);
string[] DialogChaussure = { string[] borderBaton = {
"J'ai mal au pied", "ACH SCHEISSE !", "Ch'ai ouplié mes patons te marches ! Che suis trop fatigué !"
"Faux an acheté des mieu"
}; };
this.ListDialogs.Add("Chaussures", DialogChaussure); this.ListDialogs.Add("borderBaton", borderBaton);
string[] borderRechaud = {
"Kopfertami, je commence à afoir faim !", "il me faudrait eine réchaud pour mancher !"
};
this.ListDialogs.Add("borderRechaud", borderRechaud);
string[] borderTente = {
"Hopla, c'est bientôt l'heure de la sièste !", "Si che n'ai pas de tente che ne pourrait pas continuer !"
};
this.ListDialogs.Add("borderTente", borderTente);
if (this.dialogActive) if (this.dialogActive)
...@@ -95,27 +107,17 @@ public class Dialog : MonoBehaviour ...@@ -95,27 +107,17 @@ public class Dialog : MonoBehaviour
if ((Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown("joystick button 0")) && dialogActive) if ((Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown("joystick button 0")) && dialogActive)
this.Next(); this.Next();
// DEBUG if (this.dialogActive)
if ((Input.GetKeyDown(KeyCode.H) || Input.GetKeyDown("joystick button 1")))
this.dialogActive = !this.dialogActive;
// DEBUG
if (Input.GetKeyDown(KeyCode.F))
{
Debug.Log("tut");
this.setSituation("marchand");
}
if(this.dialogActive)
{ {
this.dialogBox.GetComponent<CanvasRenderer>().SetAlpha(1f); this.dialogBox.GetComponent<CanvasRenderer>().SetAlpha(1f);
this.dialogText.GetComponent<CanvasRenderer>().SetAlpha(1f); this.dialogText.GetComponent<CanvasRenderer>().SetAlpha(1f);
this.instructionText.GetComponent<CanvasRenderer>().SetAlpha(1f);
} }
else else
{ {
this.dialogBox.GetComponent<CanvasRenderer>().SetAlpha(0f); this.dialogBox.GetComponent<CanvasRenderer>().SetAlpha(0f);
this.dialogText.GetComponent<CanvasRenderer>().SetAlpha(0f); this.dialogText.GetComponent<CanvasRenderer>().SetAlpha(0f);
this.instructionText.GetComponent<CanvasRenderer>().SetAlpha(0f);
} }
} }
...@@ -132,9 +134,7 @@ public class Dialog : MonoBehaviour ...@@ -132,9 +134,7 @@ public class Dialog : MonoBehaviour
public void setSituation(string sit) public void setSituation(string sit)
{ {
Debug.Log("actionvation: " + sit);
this.situation = sit; this.situation = sit;
Debug.Log("situation" + this.situation);
this.dialog = 0; this.dialog = 0;
this.dialogActive = true; this.dialogActive = true;
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class InventoryDisplay : MonoBehaviour
{
// Start is called before the first frame update
public Text inventoryText;
void Start()
{
inventoryText.text = "";
}
// Update is called once per frame
void Update()
{
inventoryText.text = "";
foreach(Item item in Inventory.instance.getItemList()){
inventoryText.text += "\n1x " + item.nom;
}
}
}
fileFormatVersion: 2 fileFormatVersion: 2
guid: 02c5de57794c3474fb978ab6e3487fb4 guid: 04f25fae5a5c969428bddd86f71fa44f
DefaultImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.UI;
public class Shopping : MonoBehaviour public class PanneauDisplay : MonoBehaviour
{ {
private bool playerInRange; public string TextToDisplay = "Ceci est le texte de base du panneau";
public Item sellItem = null; public GameObject backgroundPanelDisplay;
//public GameObject[] itemForSale = new GameObject[2]; public GameObject textPanelDisplay;
public List<GameObject> itemForSale = new List<GameObject>();
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
backgroundPanelDisplay.GetComponent<CanvasRenderer>().SetAlpha(0f);
textPanelDisplay.GetComponent<CanvasRenderer>().SetAlpha(0f);
} }
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
if (Input.GetKeyDown(KeyCode.E) && playerInRange && sellItem && itemForSale.Count>0)
{
Dialog.instance.setSituation("Marchand");
Inventory.instance.addItem(sellItem);
Destroy(itemForSale[0]);
Debug.Log(sellItem.name.ToString() + " a bien ete ajouté a l'inventaire");
}
} }
private void OnTriggerEnter2D(Collider2D collision) private void OnTriggerEnter2D(Collider2D collision)
{ {
if (collision.CompareTag("Player")) if (collision.CompareTag("Player"))
{ {
playerInRange = true; textPanelDisplay.GetComponent<Text>().text = TextToDisplay;
backgroundPanelDisplay.GetComponent<CanvasRenderer>().SetAlpha(1f);
textPanelDisplay.GetComponent<CanvasRenderer>().SetAlpha(1f);
} }
} }
private void OnTriggerExit2D(Collider2D collision) private void OnTriggerExit2D(Collider2D collision)
{ {
playerInRange = false; if (collision.CompareTag("Player"))
{
backgroundPanelDisplay.GetComponent<CanvasRenderer>().SetAlpha(0f);
textPanelDisplay.GetComponent<CanvasRenderer>().SetAlpha(0f);
}
} }
} }
fileFormatVersion: 2
guid: 4c8875f970794c24fb1d22c9a0d2bb56
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.UI;
public class GenerateMap : MonoBehaviour public class GenerateMap : MonoBehaviour
{ {
...@@ -20,6 +21,15 @@ public class GenerateMap : MonoBehaviour ...@@ -20,6 +21,15 @@ public class GenerateMap : MonoBehaviour
public int nb_of_plot = 8; public int nb_of_plot = 8;
public Object[,] plot=new Object[3,3]; public Object[,] plot=new Object[3,3];
public GameObject panelE;
public GameObject Ebutt;
public GameObject textE;
public GameObject textEObject;
public GameObject GO_Panneau;
public GameObject displayBox;
public GameObject displayText;
//Les coordonées x dans l'ordre //Les coordonées x dans l'ordre
...@@ -27,9 +37,23 @@ public class GenerateMap : MonoBehaviour ...@@ -27,9 +37,23 @@ public class GenerateMap : MonoBehaviour
//Les coordonées y dans l'ordre //Les coordonées y dans l'ordre
private int[] ys=new int[]{26,13,0}; //ligne private int[] ys=new int[]{26,13,0}; //ligne
// Start is called before the first frame update
public static GenerateMap instance;
private void Awake()
{
if (instance != null)
return;
instance = this;
}
void Start() void Start()
{ {
panelE.GetComponent<CanvasRenderer>().SetAlpha(0f);
Ebutt.GetComponent<CanvasRenderer>().SetAlpha(0f);
textE.GetComponent<CanvasRenderer>().SetAlpha(0f);
textEObject.GetComponent<CanvasRenderer>().SetAlpha(0f);
generateVillage(); generateVillage();
} }
...@@ -72,13 +96,13 @@ public class GenerateMap : MonoBehaviour ...@@ -72,13 +96,13 @@ public class GenerateMap : MonoBehaviour
itemToSell = baton; itemToSell = baton;
goToSell = GO_baton; goToSell = GO_baton;
xOffset = 0; xOffset = 0;
yOffset = 0; yOffset = 6.11F;
break; break;
case "réchaud": case "rechaud":
itemToSell = rechaud; itemToSell = rechaud;
goToSell = GO_rechaud; goToSell = GO_rechaud;
xOffset = 0; xOffset = 0;
yOffset = 0; yOffset = 6.10F;
break; break;
case "tente": case "tente":
itemToSell = tente; itemToSell = tente;
...@@ -93,13 +117,22 @@ public class GenerateMap : MonoBehaviour ...@@ -93,13 +117,22 @@ public class GenerateMap : MonoBehaviour
shop.transform.Find("Shop").gameObject.GetComponent<Shopping>().sellItem = itemToSell; shop.transform.Find("Shop").gameObject.GetComponent<Shopping>().sellItem = itemToSell;
shop.transform.Find("Shop").gameObject.GetComponent<Shopping>().itemForSale.Add(goToSell); shop.transform.Find("Shop").gameObject.GetComponent<Shopping>().itemForSale.Add(goToSell);
shop.transform.Find("Shop").gameObject.GetComponent<Shopping>().panelEbutton = panelE;
shop.transform.Find("Shop").gameObject.GetComponent<Shopping>().Ebutton = Ebutt;
shop.transform.Find("Shop").gameObject.GetComponent<Shopping>().textEbutton = textE;
shop.transform.Find("Shop").gameObject.GetComponent<Shopping>().textEbuttonObject = textEObject;
plot[column, line] = shop; plot[column, line] = shop;
float x = shop.transform.position.x + xOffset; float x = shop.transform.position.x + xOffset;
float y = shop.transform.position.y + yOffset; float y = shop.transform.position.y + yOffset;
Instantiate(goToSell, new Vector3(x, y, 0), Quaternion.identity); Instantiate(goToSell, new Vector3(x, y, 0), Quaternion.identity);
GameObject panneau = Instantiate(GO_Panneau, new Vector3(shop.transform.position.x +5.5f, shop.transform.position.y + 2.48f, 0), Quaternion.identity);
panneau.GetComponent<PanneauDisplay>().textPanelDisplay = displayText;
panneau.GetComponent<PanneauDisplay>().backgroundPanelDisplay = displayBox;
panneau.GetComponent<PanneauDisplay>().TextToDisplay = "Boutique de "+itemToSell.nom;
} }
else else
Debug.LogError("Mauvais paramètre pour objetVente"); Debug.LogError("Mauvais paramètre pour objetVente: "+ objetVente);
} }
public void generateUsine(int column, int line) public void generateUsine(int column, int line)
...@@ -112,9 +145,11 @@ public class GenerateMap : MonoBehaviour ...@@ -112,9 +145,11 @@ public class GenerateMap : MonoBehaviour
public void generateBoutiqueTest() public void generateBoutiqueTest()
{ {
// COLONNE, LIGNE // COLONNE, LIGNE
generateBoutique(0, 0, "chaussure"); generateBoutique(0, 0, "rechaud");
generateUsine(1, 0); generateUsine(1, 0);
generateBoutique(0, 1, "tente"); generateBoutique(0, 1, "tente");
generateBoutique(1, 2, "baton");
generateBoutique(1, 1, "chaussure");
} }
......