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:
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}
......
......@@ -173,4 +173,4 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c2eed50797895184ab44621a154ad526, type: 3}
m_Name:
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
guid: 1b0bebe128a4e8345a1550a68ad23be1
DefaultImporter:
guid: 075eeb49ca9e1064ea07781a2deba9ae
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
......
This diff is collapsed.
......@@ -759,9 +759,9 @@ MonoBehaviour:
nextYear: 1875
year: {fileID: 672131795}
city: {fileID: 1075515021}
scene: Niveau1
scene: sceneRaffael
animmator: {fileID: 1460786684}
name: DUSSELDORF
nom: DUSSELDORF
--- !u!4 &1459655252
Transform:
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
guid: 5097a5d46361eda43b5a45ce166e49aa
guid: 81e39c4f6e44e7345849a14cbef3b3ea
folderAsset: yes
DefaultImporter:
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
guid: 4ae30febc4f91474fa9164b85521aaf5
DefaultImporter:
guid: acdefb31f22c752ac90ddf2bf056e45c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -14,7 +14,7 @@ public class Dialog : MonoBehaviour
// singleton
public static Dialog instance;
private void Awake()
private void Awake()
{
if (instance != null)
{
......@@ -29,6 +29,7 @@ public class Dialog : MonoBehaviour
public GameObject dialogBox;
public Text dialogText;
public Text instructionText;
public int dialog;
public bool dialogActive;
public string situation;
......@@ -45,44 +46,55 @@ public class Dialog : MonoBehaviour
this.dialog = 0;
string[] DialogsLvl1 = {
"Coucou",
"Je fais un test pour le niveau 1",
"Ca marche bien nan ?",
"Melvyn t moch",
"Valentin aussi",
"Raff est pas bo"
"Ach... Encore eine gute chournée dans mon fillage!",
"Ch'ai très enfie te me balader",
"Che defrai aller au Nord dans la forêt ja !",
"pour me déplacer, je dois utiliser mes muscles 'flèches directionnelles'"
};
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 = {
"Salut",
"cava ?",
"Je te mange tes morts"
string[] boutiqueBaton = {
"Ze bâton me semble assez long et solide pour moi ! J'achète !",
};
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 = {
"Je fais un test",
"ca marche ? ou pas ?",
"bisous"
string[] boutiqueTente = {
"J'adore ta tente, mais elle est un peu grosse non ?", "Ach, tant pis, CH'ACHETE !"
};
this.ListDialogs.Add("boutiqueTente", boutiqueTente);
this.ListDialogs.Add("test", DialogsTest);
string[] DialogMarchand = {
"Ouvrir le menu c'est avec",
"la touche E chacal"
string[] borderChaussure = {
"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 = {
"J'ai mal au pied",
"Faux an acheté des mieu"
string[] borderBaton = {
"ACH SCHEISSE !", "Ch'ai ouplié mes patons te marches ! Che suis trop fatigué !"
};
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)
......@@ -95,27 +107,17 @@ public class Dialog : MonoBehaviour
if ((Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown("joystick button 0")) && dialogActive)
this.Next();
// DEBUG
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)
if (this.dialogActive)
{
this.dialogBox.GetComponent<CanvasRenderer>().SetAlpha(1f);
this.dialogText.GetComponent<CanvasRenderer>().SetAlpha(1f);
this.instructionText.GetComponent<CanvasRenderer>().SetAlpha(1f);
}
else
{
this.dialogBox.GetComponent<CanvasRenderer>().SetAlpha(0f);
this.dialogText.GetComponent<CanvasRenderer>().SetAlpha(0f);
this.instructionText.GetComponent<CanvasRenderer>().SetAlpha(0f);
}
}
......@@ -132,9 +134,7 @@ public class Dialog : MonoBehaviour
public void setSituation(string sit)
{
Debug.Log("actionvation: " + sit);
this.situation = sit;
Debug.Log("situation" + this.situation);
this.dialog = 0;
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
guid: 02c5de57794c3474fb978ab6e3487fb4
DefaultImporter:
guid: 04f25fae5a5c969428bddd86f71fa44f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Shopping : MonoBehaviour
public class PanneauDisplay : MonoBehaviour
{
private bool playerInRange;
public Item sellItem = null;
//public GameObject[] itemForSale = new GameObject[2];
public List<GameObject> itemForSale = new List<GameObject>();
public string TextToDisplay = "Ceci est le texte de base du panneau";
public GameObject backgroundPanelDisplay;
public GameObject textPanelDisplay;
// Start is called before the first frame update
void Start()
{
backgroundPanelDisplay.GetComponent<CanvasRenderer>().SetAlpha(0f);
textPanelDisplay.GetComponent<CanvasRenderer>().SetAlpha(0f);
}
// Update is called once per frame
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)
{
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)
{
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.Generic;
using UnityEngine;
using UnityEngine.UI;
public class GenerateMap : MonoBehaviour
{
......@@ -20,6 +21,15 @@ public class GenerateMap : MonoBehaviour
public int nb_of_plot = 8;
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
......@@ -27,9 +37,23 @@ public class GenerateMap : MonoBehaviour
//Les coordonées y dans l'ordre
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()
{
panelE.GetComponent<CanvasRenderer>().SetAlpha(0f);
Ebutt.GetComponent<CanvasRenderer>().SetAlpha(0f);
textE.GetComponent<CanvasRenderer>().SetAlpha(0f);
textEObject.GetComponent<CanvasRenderer>().SetAlpha(0f);
generateVillage();
}
......@@ -72,13 +96,13 @@ public class GenerateMap : MonoBehaviour
itemToSell = baton;
goToSell = GO_baton;
xOffset = 0;
yOffset = 0;
yOffset = 6.11F;
break;
case "réchaud":
case "rechaud":
itemToSell = rechaud;
goToSell = GO_rechaud;
xOffset = 0;
yOffset = 0;
yOffset = 6.10F;
break;
case "tente":
itemToSell = tente;
......@@ -93,13 +117,22 @@ public class GenerateMap : MonoBehaviour
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>().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;
float x = shop.transform.position.x + xOffset;
float y = shop.transform.position.y + yOffset;
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
Debug.LogError("Mauvais paramètre pour objetVente");
Debug.LogError("Mauvais paramètre pour objetVente: "+ objetVente);
}
public void generateUsine(int column, int line)
......@@ -112,9 +145,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");
}
......