Tz2/Assets/Zion/Scripts/ERP/到货验收/ljj/ChatPanel.cs

57 lines
1.4 KiB
C#

using DefaultNamespace;
using DefaultNamespace.ProcessMode;
using Framework.Manager;
using MotionFramework;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
using static InterfaceManager;
public class ChatPanel : MonoBehaviour
{
public int chatIndex = 0;
public List<string> chatContent = new List<string>();
public static bool isclick;
// Start is called before the first frame update
void Start()
{
this.GetComponent<Button>().onClick.AddListener(() => { ChangeContent(); });
}
// Update is called once per frame
void Update()
{
}
public void ShowChatPanel()
{
transform.GetComponentInChildren<TextMeshProUGUI>().text = chatContent[chatIndex];
chatIndex++;
}
private void ChangeContent()
{
isclick = true;
chatIndex++;
if (chatIndex < chatContent.Count)
{
transform.GetComponentInChildren<TextMeshProUGUI>().text = chatContent[chatIndex];
}
else
{
//GameMannage.instance.StepAdd();
chatIndex = 3;
//司机进入服务大厅
MotionFramework.MotionEngine.GetModule<ProcessManager>().HandleClick("对话结束");
LoadTriggerNextGuide("对话");
gameObject.SetActive(false);
return;
}
}
}