修改NPC对话逻辑
This commit is contained in:
parent
e12c60a700
commit
92b6904314
|
@ -4,7 +4,8 @@ using UnityEngine;
|
|||
|
||||
public class NPCController : PermanentTriggerBase
|
||||
{
|
||||
public string npcSpeack;
|
||||
public List<string> npcSpeack;
|
||||
public int speackIndex = 0;
|
||||
protected override void OnMDown()
|
||||
{
|
||||
base.OnMDown();
|
||||
|
@ -12,9 +13,25 @@ public class NPCController : PermanentTriggerBase
|
|||
{
|
||||
GameManager.UIMgr.ShowPanel<UI_CustomSessionPanel>(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<UI_CustomSessionPanel>())
|
||||
{
|
||||
GameManager.UIMgr.GetPanel<UI_CustomSessionPanel>().Init(0, npcSpeack[speackIndex], NextSpeack);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GameManager.UIMgr.HidePanel<UI_CustomSessionPanel>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue