diff --git a/Assets/Import/Font/Fipps-Regular.otf b/Assets/Import/Font/Fipps-Regular.otf new file mode 100644 index 0000000000000000000000000000000000000000..9334dad594277ba8339786217d75260e58436dc8 Binary files /dev/null and b/Assets/Import/Font/Fipps-Regular.otf differ diff --git a/Assets/Import/Font/Fipps-Regular.otf.meta b/Assets/Import/Font/Fipps-Regular.otf.meta new file mode 100644 index 0000000000000000000000000000000000000000..b399743a4cc02dd0c6d20d6d040a062c93307ab0 --- /dev/null +++ b/Assets/Import/Font/Fipps-Regular.otf.meta @@ -0,0 +1,21 @@ +fileFormatVersion: 2 +guid: f87b456a2cdbb5140a790b3e369cb961 +TrueTypeFontImporter: + externalObjects: {} + serializedVersion: 4 + fontSize: 16 + forceTextureCase: -2 + characterSpacing: 0 + characterPadding: 1 + includeFontData: 1 + fontNames: + - Fipps + fallbackFontReferences: [] + customCharacters: + fontRenderingMode: 0 + ascentCalculationMode: 1 + useLegacyBoundsCalculation: 0 + shouldRoundAdvanceValue: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/GUI/BarreDenature.prefab b/Assets/Prefabs/GUI/BarreDenature.prefab index 2adb2d8d52a5773cd907911a60043c89856d3535..40d6795ea274d1688ea906d8b2b24ea10e9129c7 100644 --- a/Assets/Prefabs/GUI/BarreDenature.prefab +++ b/Assets/Prefabs/GUI/BarreDenature.prefab @@ -11,6 +11,7 @@ GameObject: - component: {fileID: 1835591788233434329} - component: {fileID: 7952431289706890423} - component: {fileID: 1778026432316727230} + - component: {fileID: 1755674381398346320} m_Layer: 5 m_Name: TexteDeLaBulle m_TagString: Untagged @@ -79,6 +80,24 @@ MonoBehaviour: m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: Je mange tes morts sale batard +--- !u!114 &1755674381398346320 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 512403696824737883} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 96efccd7704b37949a51739ed18bbd7d, type: 3} + m_Name: + m_EditorClassIdentifier: + dialogBox: {fileID: 1705879581494847332} + dialogText: {fileID: 1778026432316727230} + cr: {fileID: 4793196200597776703} + dialog: 0 + dialogActive: 1 + situation: --- !u!1 &1705879581494847332 GameObject: m_ObjectHideFlags: 0 @@ -104,7 +123,7 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1705879581494847332} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + 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: diff --git a/Assets/Scenes/Niveau2.unity b/Assets/Scenes/Niveau2.unity index 4bce2378c07d0f59a0dadc569e7f71399c86e755..c36e1fe6df768d730793263cc5d8764964236f27 100644 --- a/Assets/Scenes/Niveau2.unity +++ b/Assets/Scenes/Niveau2.unity @@ -254,10 +254,18 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: -6286016664533736427, guid: a53c5cae22cca3445bbb7e30f12f7110, type: 3} + propertyPath: period + value: 1 + objectReference: {fileID: 0} - target: {fileID: -6286016664533736427, guid: a53c5cae22cca3445bbb7e30f12f7110, type: 3} propertyPath: natureBar value: objectReference: {fileID: 965246246} + - target: {fileID: -6286016664533736427, guid: a53c5cae22cca3445bbb7e30f12f7110, type: 3} + propertyPath: TimeDamage + value: 1 + objectReference: {fileID: 0} - target: {fileID: 1206561506436264874, guid: a53c5cae22cca3445bbb7e30f12f7110, type: 3} propertyPath: m_Size.y value: 1.0000005 diff --git a/Assets/Scripts/GUI/Dialog.cs b/Assets/Scripts/GUI/Dialog.cs index 50e33bfa9d967ba4ec0befb5644968a5f85bf328..6d356c34cc591131fd7ebbd8c0cf6dd50537e907 100644 --- a/Assets/Scripts/GUI/Dialog.cs +++ b/Assets/Scripts/GUI/Dialog.cs @@ -10,10 +10,29 @@ using UnityEngine.SceneManagement; public class Dialog : MonoBehaviour { + + // singleton + public static Dialog instance; + + private void Awake() + { + if (instance != null) + { + Debug.LogWarning("Il y a + d'une instance de PlayerNature"); + return; + } + + instance = this; + } + + + public GameObject dialogBox; public Text dialogText; + public CanvasRenderer cr; public int dialog; public bool dialogActive; + public string situation; // clé : nom de la scène @@ -23,6 +42,7 @@ public class Dialog : MonoBehaviour // Start is called before the first frame update void Start() { + this.dialog = 0; string[] DialogsLvl1 = { @@ -34,7 +54,7 @@ public class Dialog : MonoBehaviour "Raff est pas bo" }; - this.ListDialogs.Add("sceneTanguy", DialogsLvl1); + this.ListDialogs.Add("start", DialogsLvl1); string[] Dialogsraff = { "Salut", @@ -42,10 +62,26 @@ public class Dialog : MonoBehaviour "Je te mange tes morts" }; - this.ListDialogs.Add("Niveau2", Dialogsraff); + this.ListDialogs.Add("pnj", Dialogsraff); + + string[] DialogsTest = { + "Je fais un test", + "ca marche ? ou pas ?", + "bisous" + }; + + this.ListDialogs.Add("test", DialogsTest); + + string[] DialogMarchand = { + "Ouvrir le menu c'est avec", + "la touche E chacal" + }; + + this.ListDialogs.Add("marchand", DialogMarchand); + if (this.dialogActive) - this.dialogText.text = this.ListDialogs[SceneManager.GetActiveScene().name][0]; + this.Situation("start"); } // Update is called once per frame @@ -58,26 +94,45 @@ public class Dialog : MonoBehaviour if ((Input.GetKeyDown(KeyCode.H) || Input.GetKeyDown("joystick button 1"))) this.dialogActive = !this.dialogActive; - if (!dialogActive) + // DEBUG + if (Input.GetKeyDown(KeyCode.F)) + { + Debug.Log("tut"); + + this.Situation("marchand"); + } + + if(this.dialogActive) { - this.dialogBox.SetActive(false); + this.dialogBox.GetComponent<CanvasRenderer>().SetAlpha(1f); + this.dialogText.GetComponent<CanvasRenderer>().SetAlpha(1f); } else { - this.dialogBox.SetActive(true); + this.dialogBox.GetComponent<CanvasRenderer>().SetAlpha(0f); + this.dialogText.GetComponent<CanvasRenderer>().SetAlpha(0f); } } void Next() { - string sceneActuelle = SceneManager.GetActiveScene().name; - - if (this.dialog >= this.ListDialogs[sceneActuelle].Length) + if (this.dialog >= this.ListDialogs[this.situation].Length) this.dialogActive = false; else { - this.dialogText.text = this.ListDialogs[sceneActuelle][this.dialog]; + this.dialogText.text = this.ListDialogs[this.situation][this.dialog]; this.dialog++; } } + + // Ouvre une bulle de dialogue dans une situation donnée + void Situation(string sit) + { + this.situation = sit; + this.dialog = 0; + + this.dialogActive = true; + + this.Next(); + } } diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index eeb41122ca3803ed59806d911dbca81042c78b42..60977e126b12269c58895567176b8b3cd7bd9c67 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -12,20 +12,14 @@ EditorUserSettings: value: 22424703114646680e0b0227036c71190012193f6c7a68252320092a flags: 0 RecentlyUsedScenePath-2: - value: 22424703114646680e0b0227036c71190012193f7e66333e243d04 + value: 22424703114646680e0b0227036c72151802563f22213229 flags: 0 RecentlyUsedScenePath-3: - value: 22424703114646680e0b0227036c72151a010124623d28393930 + value: 22424703114646680e0b0227036c71190012193f7e66333e243d04 flags: 0 RecentlyUsedScenePath-4: - value: 22424703114646680e0b0227036c72151802563f22213229 - flags: 0 - RecentlyUsedScenePath-5: value: 22424703114646680e0b0227036c71190012193f7d66333e243d04 flags: 0 - RecentlyUsedScenePath-4: - value: 22424703114646680e0b0227036c72151802563f22213229 - flags: 0 vcSharedLogLevel: value: 0d5e400f0650 flags: 0