50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class NPCController : PermanentTriggerBase
|
|
{
|
|
public List<string> npcSpeack;
|
|
public int speackIndex = 0;
|
|
private bool onSpeackOver;
|
|
protected override void OnMDown()
|
|
{
|
|
base.OnMDown();
|
|
if(npcSpeack.Count > 1)
|
|
{
|
|
onSpeackOver = false;
|
|
}
|
|
else
|
|
{
|
|
onSpeackOver = true;
|
|
}
|
|
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(triggerName, onSpeackOver) == 0)
|
|
{
|
|
GameManager.UIMgr.ShowPanel<UI_CustomSessionPanel>(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<UI_CustomSessionPanel>())
|
|
{
|
|
GameManager.UIMgr.GetPanel<UI_CustomSessionPanel>().Init("", npcSpeack[speackIndex], NextSpeack);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(triggerName, true);
|
|
if (GameManager.UIMgr.GetPanel<UI_CustomSessionPanel>())
|
|
GameManager.UIMgr.HidePanel<UI_CustomSessionPanel>();
|
|
speackIndex = 0;
|
|
}
|
|
}
|
|
}
|