Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using System.IO;
- using UnityEngine.UI;
- public class FileReader : MonoBehaviour {
- public Text textview;
- // GIDEROS ANDROID SETTINGS FILE PATH
- //private string file_name = "/data/data/com.wixot.wordsearch/files/settings";
- // GIDEROS IOS SETTINGS FILE PATH
- private string file_name = Application.persistentDataPath+"/settings";
- void Start () {
- this.textview.text = this.readTextFile(file_name);
- }
- // Update is called once per frame
- void Update () {
- }
- string readTextFile(string file_path)
- {
- string all = "";
- try {
- StreamReader inp_stm = new StreamReader(file_path);
- while(!inp_stm.EndOfStream)
- {
- string inp_ln = inp_stm.ReadLine( );
- // Do Something with the input.
- all = all + inp_ln;
- Debug.Log (inp_ln);
- }
- inp_stm.Close();
- } catch (System.Exception ex) {
- Debug.Log (ex);
- }
- return all;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement