Commit 94321db6 authored by 杨泽宇's avatar 杨泽宇

更新

parent 7b50434b
......@@ -26,6 +26,8 @@ public class LoginManager : MonoBehaviour
public FaultEventData Failure;
public float angle;
public bool IsLine1;
private void Awake()
{
OnReceiveMsg.AddListener(_getData);
......@@ -154,9 +156,17 @@ public class LoginManager : MonoBehaviour
public void SaveInputFields()
{
// 使用 PlayerPrefs 保存输入字段数据
PlayerPrefs.SetString("productionlineID", productionlineID.text);
if (IsLine1)
{
PlayerPrefs.SetString("productionlineID1", productionlineID.text);
PlayerPrefs.SetString("lineID1", lineID.text);
}
else
{
PlayerPrefs.SetString("productionlineID2", productionlineID.text);
PlayerPrefs.SetString("lineID2", lineID.text);
}
PlayerPrefs.SetString("faultInterface", faultInterface.text);
PlayerPrefs.SetString("lineID", lineID.text);
PlayerPrefs.Save(); // 确保数据被保存
Debug.Log("Input fields saved to PlayerPrefs.");
......@@ -165,11 +175,19 @@ public class LoginManager : MonoBehaviour
public void LoadInputFields()
{
// 使用 PlayerPrefs 加载输入字段数据
if (PlayerPrefs.HasKey("productionlineID"))
if (PlayerPrefs.HasKey("productionlineID1"))
{
productionlineID.text = PlayerPrefs.GetString("productionlineID");
if (IsLine1)
{
productionlineID.text = PlayerPrefs.GetString("productionlineID1");
lineID.text = PlayerPrefs.GetString("lineID1");
}
else
{
productionlineID.text = PlayerPrefs.GetString("productionlineID2");
lineID.text = PlayerPrefs.GetString("lineID2");
}
faultInterface.text = PlayerPrefs.GetString("faultInterface");
lineID.text = PlayerPrefs.GetString("lineID");
Debug.Log("Input fields loaded from PlayerPrefs.");
}
......@@ -183,9 +201,11 @@ public class LoginManager : MonoBehaviour
[System.Serializable]
public class InputFieldData
{
public string productionlineID;
public string productionlineID1;
public string productionlineID2;
public string faultInterface;
public string lineID;
public string lineID1;
public string lineID2;
}
// 定义机器人位置数据结构
......
......@@ -23252,6 +23252,7 @@ MonoBehaviour:
message:
data: []
angle: 0
IsLine1: 0
--- !u!114 &346303892
MonoBehaviour:
m_ObjectHideFlags: 0
......@@ -32406,6 +32407,7 @@ MonoBehaviour:
message:
data: []
angle: 0
IsLine1: 1
--- !u!114 &560685329
MonoBehaviour:
m_ObjectHideFlags: 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment