UNITYTextAssest去创建一个对话系统
TextAsses:
Inherits from Object
Text file assets.
文本文件资源。
You can use raw .txt files in your project as assets and get their contents through this class.
在你的工程里,你可以使用原始的.txt文件作为资源并且通过该类获取它们的内容。
核心代码
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
using UnityEngine.UI;
public class TextTest : MonoBehaviour
{
//public Text Text;
Start is called before the first frame update
//void Start()
//{
//}
//string ReadLine(string name,int line)
//{
// string[] file=File.ReadAllLines(name);
// return file[line];
//}
//public void Read(int line)
//{
// Text.text = ReadLine("TxtInfo.txt", line);
//}
Update is called once per frame
//void Update()
//{
//}
privat