using System; using System.Collections; using System.Collections.Generic; using DG.Tweening; using DG.Tweening.Core; using DG.Tweening.Plugins.Options; using I2.Loc; using TMPro; using UnityEngine; using UnityEngine.UI; namespace Ichni.Story { public class TextFrame : MonoBehaviour { public GameObject textPrefab; public RectTransform textContainer; private TweenerCore contentTween; public bool isPlayingSentence; public void PlaySentence(string speakerName, string content) { GameObject contentText = Instantiate(textPrefab, textContainer); contentText.transform.GetChild(1).GetComponent().text = speakerName; contentText.transform.GetChild(2).GetComponent().text = content; //contentText.GetComponent().OnLocalize(); } public void FinishSentence() { if (isPlayingSentence) { contentTween.Complete(); } } } }