diff --git a/Assets/Scenes/Quest.unity b/Assets/Scenes/Quest.unity index b3694662dddd939b1256168fa07f62e8a20f310c..9b67835daf5a41c0f467921bfb2b7f00b21be7a6 100644 --- a/Assets/Scenes/Quest.unity +++ b/Assets/Scenes/Quest.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.45061475, g: 0.4986083, b: 0.56437457, a: 1} + m_IndirectSpecularColor: {r: 0.45061505, g: 0.498609, b: 0.56437516, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -560,7 +560,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 0491693b92a424f4fb654ba3dd203b97, type: 3} m_Name: m_EditorClassIdentifier: - npc: {fileID: 11400000, guid: 75a9c1254c3636e4bbb98e84f259e2ca, type: 2} + npc: + - {fileID: 11400000, guid: 75a9c1254c3636e4bbb98e84f259e2ca, type: 2} + - {fileID: 11400000, guid: 2b4b646fed0fab649a61251c4d452ac4, type: 2} + - {fileID: 11400000, guid: 21708ddf4c804f44f8131f3c82075f5c, type: 2} + - {fileID: 11400000, guid: 91dfe1265d465484d9c34be4b173ab6f, type: 2} player: {fileID: 52771151} dialogueUI: {fileID: 1675735518} npcName: {fileID: 291978237} @@ -8460,9 +8464,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 38cf31ad37f90af40b615d7f5e0b167a, type: 3} m_Name: m_EditorClassIdentifier: - damagePerShot: 30 - timeBetweenBullets: 0.15 - range: 100 prefabEffect: {fileID: 976093117594460400, guid: 3ffee28e9d715da4190cc06ec2c69b5d, type: 3} --- !u!1 &705542624 GameObject: diff --git a/Assets/Scripts/Managers/DialogueManager.cs b/Assets/Scripts/Managers/DialogueManager.cs index 0e9b30a4a1afbdf6057adf3e075c4ac74890d615..1dc60d7c86f7a177627d5289b38930cd4f6b28bc 100644 --- a/Assets/Scripts/Managers/DialogueManager.cs +++ b/Assets/Scripts/Managers/DialogueManager.cs @@ -6,7 +6,8 @@ using UnityEngine.UI; public class DialogueManager : MonoBehaviour { [SerializeField] - private NPC npc; + private NPC[] npc; + private int currentDialogueIdx = 0; bool isTalking = false; bool onDistance = false; @@ -69,13 +70,13 @@ public class DialogueManager : MonoBehaviour { if (Input.GetKeyDown(KeyCode.Tab)) { curResponseTracker++; - if (curResponseTracker >= npc.playerDialogues.Length) + if (curResponseTracker >= npc[currentDialogueIdx].playerDialogues.Length) { curResponseTracker = 0; } } - for (int i=0;i<npc.playerDialogues.Length;i++) + for (int i=0;i< npc[currentDialogueIdx].playerDialogues.Length;i++) { CheckConvo(i); } @@ -84,12 +85,12 @@ public class DialogueManager : MonoBehaviour private void CheckConvo(int idx) { - if (curResponseTracker == idx && npc.playerDialogues.Length >= idx) + if (curResponseTracker == idx && npc[currentDialogueIdx].playerDialogues.Length >= idx) { - playerResponse.text = npc.playerDialogues[idx]; + playerResponse.text = npc[currentDialogueIdx].playerDialogues[idx]; if (Input.GetKeyDown(KeyCode.Return)) { - npcDialogueBox.text = npc.dialogues[idx+1]; + npcDialogueBox.text = npc[currentDialogueIdx].dialogues[idx+1]; } } } @@ -116,13 +117,14 @@ public class DialogueManager : MonoBehaviour isTalking = true; curResponseTracker = 0f; dialogueUI.SetActive(true); - npcName.text = npc.name; - npcDialogueBox.text = npc.dialogues[0]; + npcName.text = npc[currentDialogueIdx].name; + npcDialogueBox.text = npc[currentDialogueIdx].dialogues[0]; } private void EndConvo() { isTalking = false; dialogueUI.SetActive(false); + currentDialogueIdx++; } } diff --git a/Assets/Scripts/Managers/MainMenuManager.cs b/Assets/Scripts/Managers/MainMenuManager.cs index b5646c93bc4c7b429e54e33c40cf73868ffc7f4d..6a6ea1b05a7d90a53992251ab3eba95a558ab084 100644 --- a/Assets/Scripts/Managers/MainMenuManager.cs +++ b/Assets/Scripts/Managers/MainMenuManager.cs @@ -17,11 +17,11 @@ public class MainMenuManager : MonoBehaviour this.settingPanel.gameObject.SetActive(false); this.scoreboard = FindObjectOfType<ScoreBoard>(); this.scoreboard.gameObject.SetActive(false); - //if (GlobalManager.Instance.isFromEnding) - //{ - // this.scoreboard.gameObject.SetActive(false); - // GlobalManager.Instance.isFromEnding = false; - //} + if (GlobalManager.Instance.isFromEnding) + { + this.scoreboard.gameObject.SetActive(true); + GlobalManager.Instance.isFromEnding = false; + } } public void OnClickNewGame() @@ -44,6 +44,16 @@ public class MainMenuManager : MonoBehaviour this.scoreboard.gameObject.SetActive(true) ; } + public void OnClickExit() + { +#if UNITY_STANDALONE + Application.Quit(); +#endif +#if UNITY_EDITOR + UnityEditor.EditorApplication.isPlaying = false; +#endif + } + private void Update() { var gm = GlobalManager.Instance; diff --git a/Assets/Scripts/NPCs/Quest1.asset b/Assets/Scripts/NPCs/Quest1.asset new file mode 100644 index 0000000000000000000000000000000000000000..14bbbdd698ed67fcba442f18fd17fafbdedcb3c0 --- /dev/null +++ b/Assets/Scripts/NPCs/Quest1.asset @@ -0,0 +1,25 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3315bfff808b5c64eabb0e55683b4000, type: 3} + m_Name: Quest1 + m_EditorClassIdentifier: + name: Wizard + dialogues: + - there is only you alone ?! + - there are bunch of them. + - they are not coming right away. You need to trigger them. You can use a huge + bell there, inside the temple. + - beware, they are dangerous + playerDialogues: + - i am here for recon mission. we don't want to lose people + - well, where are they? + - okay diff --git a/Assets/Scripts/NPCs/Wizard.asset.meta b/Assets/Scripts/NPCs/Quest1.asset.meta similarity index 100% rename from Assets/Scripts/NPCs/Wizard.asset.meta rename to Assets/Scripts/NPCs/Quest1.asset.meta diff --git a/Assets/Scripts/NPCs/Wizard.asset b/Assets/Scripts/NPCs/Quest2.asset similarity index 63% rename from Assets/Scripts/NPCs/Wizard.asset rename to Assets/Scripts/NPCs/Quest2.asset index b06b5a029be1303c5624b6beb95732b55b2e6fbf..3b2a96c642283480711a10828fd32d31cb69dfb2 100644 --- a/Assets/Scripts/NPCs/Wizard.asset +++ b/Assets/Scripts/NPCs/Quest2.asset @@ -10,15 +10,15 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 3315bfff808b5c64eabb0e55683b4000, type: 3} - m_Name: Wizard + m_Name: Quest2 m_EditorClassIdentifier: name: Wizard dialogues: - - Hey, what is up? - - I am doing alright - - I am from the heaven! - - See you later + - are you fine? + - i think they are just not ready. you know you can buy or enhance weapons in the + shop right? + - good luck playerDialogues: - - Not much, how about you? - - Where are you from? - - Goodbye... + - after I killed some of them, the other ones run + - oh wow, that will help + - thanks diff --git a/Assets/Scripts/NPCs/Quest2.asset.meta b/Assets/Scripts/NPCs/Quest2.asset.meta new file mode 100644 index 0000000000000000000000000000000000000000..3aee857526bfe15b8a0c502a13d33f0888ff1f2e --- /dev/null +++ b/Assets/Scripts/NPCs/Quest2.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2b4b646fed0fab649a61251c4d452ac4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/NPCs/Quest3.asset b/Assets/Scripts/NPCs/Quest3.asset new file mode 100644 index 0000000000000000000000000000000000000000..28dc07c2099bae5d56a6cce94bb8435a509d3e53 --- /dev/null +++ b/Assets/Scripts/NPCs/Quest3.asset @@ -0,0 +1,24 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3315bfff808b5c64eabb0e55683b4000, type: 3} + m_Name: Quest3 + m_EditorClassIdentifier: + name: Wizard + dialogues: + - you are still alone here, why don't you call the army ?! there are a bunch of + them right ? + - but it will be better if you have bigger force right. + - okay, I hope you are okay + playerDialogues: + - i have decided........ I will kill them all by myself. They took almost all of + human race in our base planet. + - my gun will send message to our spaceship after I die diff --git a/Assets/Scripts/NPCs/Quest3.asset.meta b/Assets/Scripts/NPCs/Quest3.asset.meta new file mode 100644 index 0000000000000000000000000000000000000000..43f71f3ad3b1edaa9e81b9eed7bbf893075939f0 --- /dev/null +++ b/Assets/Scripts/NPCs/Quest3.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 21708ddf4c804f44f8131f3c82075f5c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/NPCs/Quest4.asset b/Assets/Scripts/NPCs/Quest4.asset new file mode 100644 index 0000000000000000000000000000000000000000..e43bc2301aa38494f80d1ec3b1aee2dcb72cd547 --- /dev/null +++ b/Assets/Scripts/NPCs/Quest4.asset @@ -0,0 +1,23 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3315bfff808b5c64eabb0e55683b4000, type: 3} + m_Name: Quest4 + m_EditorClassIdentifier: + name: Wizard + dialogues: + - you killed too many of them + - when they landed, I saw their leader, a strong huge elemental monster + - I think.. it will be best if you call your army + playerDialogues: + - for me, it is still not enough + - ....... I am not scared, my pet andI will always be ready + - they will come, if I die.... diff --git a/Assets/Scripts/NPCs/Quest4.asset.meta b/Assets/Scripts/NPCs/Quest4.asset.meta new file mode 100644 index 0000000000000000000000000000000000000000..bf016b30a72fb80fddb2932bebef6138d2cb7506 --- /dev/null +++ b/Assets/Scripts/NPCs/Quest4.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 91dfe1265d465484d9c34be4b173ab6f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: