using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class LoadText4 : MonoBehaviour {
[SerializeField]
private Text textLabel;
private TextAsset textFile;
private string textData;
// 動的に読み込むテキストファイル名も変数化する。
public string textName;
void Start () {
// (ポイント)キャスト(型変換)が必要
textFile = (TextAsset)Resources.Load(textName);
textLabel.text = textFile.text;
}
}