Hi, I have this code to an input field so the user can enter a name and email before playing the game, so I can have a list of every person that plays the game. Is there any way to save this data in a text file in a way that updates every time someone enters a name and email?
This is the code I have:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System.IO;
public class NewBehaviourScript : MonoBehaviour {
public Button myButton;
public Text buttonText;
public InputField name, email;
string Name;
string Email;
void Start () {
myButton = GetComponent<Button> ();
buttonText = GetComponentInChildren<Text> ();
myButton.onClick.AddListener (ProcessText);
}
void ProcessText() {
Debug.Log ("Button was Clicked!");
myButton.enabled = false;
Name = name.text;
Email = email.text;
Debug.Log("O nome é: " + Name);
Debug.Log ("O email é: " + Email);
}
}