using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Secup : MonoBehaviour
{
public InputField _field1;
public InputField _field2;
public Button _button;
private string content1;
private string content2;
public static Secup _instance;
void Awake()
{
_instance = this;
}
void Start()
{
storage();
}
public void storage()
{
string strVal1 = PlayerPrefs.GetString("strKey1");
if (strVal1 == null)
{
_field1.text = "";
}
else
{
_field1.text = strVal1;
}
string strVal2 = PlayerPrefs.GetString("strKey2");
if (strVal2 == null)
{
_field2.text = "";
}
else
{
_field2.text = strVal2;
}
_button.onClick.AddListener(() => {
PlayerPrefs.DeleteKey("strKey1");
if (_field1.text == "")
{
content1 = "";
}
else
{
content1 = _field1.text;
_field1.text = content1;
}
PlayerPrefs.SetString("strKey1", content1);
ThreeAxis_PortControl._instance.ChangePort(_field1.text);
PlayerPrefs.DeleteKey("strKey2");
if (_field2.text == "")
{
_field2.text = "";
}
else
{
content2 = _field2.text;
_field2.text = content2;
}
PlayerPrefs.SetString("strKey2", content2);
Fan_Belt_PortControl._instance.ChangePort(_field2.text);
});
}
void Update()
{
}
}
|