0

So I was given this code by a user who claimed this would do what I want it to do... which is display the txt file noted in the code and post the single line information in it to a GUI Textbox...

However, nothing happens - any ideas what's wrong?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System.IO;

public class driverVersionText : MonoBehaviour
{

    public Text driverVerText = null;
    // Start is called before the first frame update
    void Start()
    {
        driverVerText.text = System.IO.File.ReadAllLines(@"C:\DriverVersion.txt");
    }
}
SammyJ
  • 3
  • The code is incomplete. You have to modify the text of the textbox somehow. The code above doesn't do anything. – user1092950 Sep 22 '19 at 13:30
  • did you attach it to a Game Object, attach a Text component from a Game Object to it and hit Play? – Roberto Feb 12 '20 at 03:11

0 Answers0