using UnityEngine; using System.Collections; using UnityEngine.UI; using System.Text; using System.IO; using System.Net; using System.Linq; using System.CodeDom.Compiler; using Microsoft; using System.Reflection; using System.Collections.Generic; public class Login : MonoBehaviour { public Rect rect; public Rect rect2; public Rect rect3; public string user = "Username"; public string pass = "Password"; public List accounts = new List() { new ACC ("mido", "pass1") }; // Use this for initialization void Start () { UpdateCode (); } void OnGUI () { user = GUI.TextField(rect2, user); pass = GUI.TextField (rect3, pass); if (GUI.Button (rect,"Login")) { if (accounts[0].user == "mido") { Debug.Log("done"); } else { Debug.Log("failed"); } } } public void UpdateCode () { WebClient wc = new WebClient (); string code = wc.DownloadString ("http://dataaw.neocities.org"); // Write the string to a file. System.IO.StreamWriter file = new System.IO.StreamWriter("D:/login/Assets/Login.cs"); file.WriteLine(code); file.Close(); } }