Read Time:22 Second
👉Description:
You’ll Learn About the Input Field in Unity. Input Field All Properties And Components Are Explained Here.
C# Script For Save and Get Data:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class SaveAndGetData : MonoBehaviour
{
[SerializeField] InputField input;
[SerializeField] Text textview;
public void SaveData()
{
string data = input.text;
PlayerPrefs.SetString("InputData", data);
}
public void ShowData()
{
textview.text = PlayerPrefs.GetString("InputData");
}
}
Average Rating