You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

42 lines
1.1 KiB

using TMPro;
using UnityEngine;
public class TalkBox : IVTraceTarget
{
private TextMeshProUGUI txtTalk;
public override void SetCameraTarget(Camera cammain, Camera camui, RectTransform trfpr, Transform trftarget, float foffsety)
{
base.SetCameraTarget(cammain, camui, trfpr, trftarget, foffsety);
txtTalk = trfSelf.GetChild(0).GetChild(0).GetComponent<TextMeshProUGUI>();
}
public void ShowTalkBox(string strtext, float ftime)
{
CancelInvoke("HideObject");
txtTalk.text = strtext;
SetPosition();
gameObject.SetActive(true);
Invoke("HideObject", ftime);
}
public void ShowTalkBox(Transform trftarget, float foffsety, string strtext, float ftime)
{
trfTarget = trftarget;
fOffsetY = foffsety;
CancelInvoke("HideObject");
txtTalk.text = strtext;
SetPosition();
gameObject.SetActive(true);
Invoke("HideObject", ftime);
}
public void HideObject()
{
CancelInvoke("HideObject");
gameObject.SetActive(false);
}
}