diff --git a/Assets/Scripts/Project/Objects/Other/NPCController.cs b/Assets/Scripts/Project/Objects/Other/NPCController.cs index 658adfa..69c9ca3 100644 --- a/Assets/Scripts/Project/Objects/Other/NPCController.cs +++ b/Assets/Scripts/Project/Objects/Other/NPCController.cs @@ -4,7 +4,8 @@ using UnityEngine; public class NPCController : PermanentTriggerBase { - public string npcSpeack; + public List npcSpeack; + public int speackIndex = 0; protected override void OnMDown() { base.OnMDown(); @@ -12,9 +13,25 @@ public class NPCController : PermanentTriggerBase { GameManager.UIMgr.ShowPanel(E_UI_Layer.Mid, (panel) => { - panel.Init(triggerID, npcSpeack, null); + panel.Init(triggerID, npcSpeack[speackIndex], NextSpeack); }); _highlight.SetHighlighted(false); } } + + private void NextSpeack(int id) + { + speackIndex++; + if (speackIndex < npcSpeack.Count - 1) + { + if (GameManager.UIMgr.GetPanel()) + { + GameManager.UIMgr.GetPanel().Init(0, npcSpeack[speackIndex], NextSpeack); + } + } + else + { + GameManager.UIMgr.HidePanel(); + } + } }