DRHPS/code-csharp/en_US/INT_NextINTCHATindex.cs
2025-04-08 11:31:35 +08:00

30 lines
612 B
C#

using System.Collections;
using UnityEngine;
public class INT_NextINTCHATindex : MonoBehaviour
{
public INT_Chat Chat;
public int ChatIndexToRun;
public int SetIndexTo;
public bool RanChat;
private void Update()
{
if (Chat.FinishedText && Chat.CurrentIndex == ChatIndexToRun && !RanChat)
{
RanChat = true;
Chat.CurrentIndex = SetIndexTo;
StartCoroutine(ChatDelay());
}
}
private IEnumerator ChatDelay()
{
yield return new WaitForSeconds(0.02f);
Chat.RUN();
}
}