using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
[RequireComponent(typeof(Text))]
public class Typer : MonoBehaviour
{
public Action fnEnd;
public float duration = 0.05f;
public bool autoType = false;
private float time;
private Text text;
private string content;
private int idx;
static Dictionary<string, string> dRichTextType = new Dictionary<string, string>()
{
{ "<color=", "</color>" },
{ "<i>", "</i>" },
{ "<size=", "</size>" },
{ "<b>", "</b>" },
};
private Dictionary<int, int> dRichSignIndex = new Dictionary<int, int>();
void Awake()
{
text = gameObject.GetComponent<Text>();
idx = -1;
if (autoType)
{
BeginTy
Unity UGUI Text打字机实现(兼容富文本)
最新推荐文章于 2024-04-01 23:18:07 发布