1.准备好文字文件
2.撰写能导入文字文件的脚本
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Control : MonoBehaviour
{
public TextAsset textFile; //导入文件
void GetTextFormFile(TextAsset file)
{
//将档案文字分割并储存成字串阵列
string[] lineData = file.text.Split('\n'); //换行就切割
//印出每行内容
foreach(var line in lineData)
{
Debug.Log(line);
}
}
void Start()
{
GetTextFormFile(textFile);
Debug.Log("end");
}
}
3.将文字文件挂载至脚本
4.看读取结果
<<: Day 22-Unit Test 应用於 DateTime-1 (情境及应用-2)
>>: Day22. Blue Prism拯救贫穷大作战第三弹 -BP自动执行应用程序
以现有的程序码做整理 https://github.com/xhbang/C100 整理过後 mai...
今天要介绍的是定义清单(definition list),他是将资料格式画成两个层次,在读者阅读时更...
今天我们就利用我们之前所学的来做一个和旅游相关的Onboarding介面,事不宜迟赶快开始吧! 我想...
Given a string containing just the characters '(' ...
堆叠(Stack)建立的方法 push: 新增元素 pop: 从顶端移除元素 peek: 查看顶端(...