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

更新

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