Commit 7b50434b authored by 杨泽宇's avatar 杨泽宇

更新

parent 0d6be671
......@@ -32,11 +32,11 @@ public class LoginManager : MonoBehaviour
LoadInputFields(); // 在 Awake 中加载输入字段
}
private void Start()
{
StartCoroutine(GetPositionData());
StartCoroutine(FaultInformation());
}
//private void Start()
//{
// StartCoroutine(GetPositionData());
// StartCoroutine(FaultInformation());
//}
public void StartLogin()
{
......@@ -153,36 +153,29 @@ public class LoginManager : MonoBehaviour
public void SaveInputFields()
{
InputFieldData data = new InputFieldData
{
productionlineID = productionlineID.text,
faultInterface = faultInterface.text,
lineID = lineID.text
};
string json = JsonUtility.ToJson(data);
File.WriteAllText(Application.persistentDataPath + "/inputFields.json", json);
Debug.Log("Input fields saved to JSON.");
// 使用 PlayerPrefs 保存输入字段数据
PlayerPrefs.SetString("productionlineID", productionlineID.text);
PlayerPrefs.SetString("faultInterface", faultInterface.text);
PlayerPrefs.SetString("lineID", lineID.text);
PlayerPrefs.Save(); // 确保数据被保存
Debug.Log("Input fields saved to PlayerPrefs.");
}
public void LoadInputFields()
{
string path = Application.persistentDataPath + "/inputFields.json";
if (File.Exists(path))
// 使用 PlayerPrefs 加载输入字段数据
if (PlayerPrefs.HasKey("productionlineID"))
{
string json = File.ReadAllText(path);
InputFieldData data = JsonUtility.FromJson<InputFieldData>(json);
productionlineID.text = data.productionlineID;
faultInterface.text = data.faultInterface;
lineID.text = data.lineID;
productionlineID.text = PlayerPrefs.GetString("productionlineID");
faultInterface.text = PlayerPrefs.GetString("faultInterface");
lineID.text = PlayerPrefs.GetString("lineID");
Debug.Log("Input fields loaded from JSON.");
Debug.Log("Input fields loaded from PlayerPrefs.");
}
else
{
Debug.Log("No saved input fields data found.");
Debug.Log("No saved input fields data found in PlayerPrefs.");
}
}
}
......
......@@ -41471,13 +41471,23 @@ PrefabInstance:
- target: {fileID: 1408881909033764182, guid: ed32f55596f4ce64e96fe9f95c481cc0,
type: 3}
propertyPath: m_Text
value: http://192.168.1.10:8093/maintenance/jqrznxj/stt/getRobotRunState?lineId=AD6E344FAEEB2EA9E053A3001E0A371D
value:
objectReference: {fileID: 0}
- target: {fileID: 1510060172603623300, guid: ed32f55596f4ce64e96fe9f95c481cc0,
type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2685396657262849258, guid: ed32f55596f4ce64e96fe9f95c481cc0,
type: 3}
propertyPath: m_Text
value:
objectReference: {fileID: 0}
- target: {fileID: 2685396657295982406, guid: ed32f55596f4ce64e96fe9f95c481cc0,
type: 3}
propertyPath: m_Text
value:
objectReference: {fileID: 0}
- target: {fileID: 2685396657494966388, guid: ed32f55596f4ce64e96fe9f95c481cc0,
type: 3}
propertyPath: m_AnchorMax.y
......@@ -41548,6 +41558,16 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: -558
objectReference: {fileID: 0}
- target: {fileID: 2685396658203011285, guid: ed32f55596f4ce64e96fe9f95c481cc0,
type: 3}
propertyPath: m_Text
value:
objectReference: {fileID: 0}
- target: {fileID: 2685396658211044749, guid: ed32f55596f4ce64e96fe9f95c481cc0,
type: 3}
propertyPath: m_Text
value:
objectReference: {fileID: 0}
- target: {fileID: 2685396658312707601, guid: ed32f55596f4ce64e96fe9f95c481cc0,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
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