using System.Collections; using System.Collections.Generic; using UnityEngine; public class NPCController : PermanentTriggerBase { public List npcSpeack; public int speackIndex = 0; protected override void OnMDown() { base.OnMDown(); if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(triggerName, false ) == 0) { GameManager.UIMgr.ShowPanel(E_UI_Layer.Mid, (panel) => { panel.Init(triggerName, npcSpeack[speackIndex], NextSpeack); }); _highlight.SetHighlighted(false); } } private void NextSpeack(string id) { speackIndex++; if (speackIndex <= npcSpeack.Count - 1) { if (GameManager.UIMgr.GetPanel()) { GameManager.UIMgr.GetPanel().Init("", npcSpeack[speackIndex], NextSpeack); } } else { GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(triggerName, true); if (GameManager.UIMgr.GetPanel()) GameManager.UIMgr.HidePanel(); speackIndex = 0; } } }