美文网首页
Txt文件读取《一》

Txt文件读取《一》

作者: Kyle_An | 来源:发表于2018-06-11 11:58 被阅读0次

使用 TextAsset读取txt文件

    //存放Txt中所有文字的数组
    public string[] strs;
    void Start()
    {
        //从Resources目录读取文件
        TextAsset txt = Resources.Load("teachtxt") as TextAsset;
        strs = txt.text.Split('\n');
        
        Debug.Log(strs[0]);
    }
注意格式.png

相关文章

网友评论

      本文标题:Txt文件读取《一》

      本文链接:https://www.haomeiwen.com/subject/fuoceftx.html