Browse Source

上传本地记录

蓝色星空 1 year ago
parent
commit
308bc83c58

+ 10 - 1
Assets/Game/Blue/Controller/Item/ShowXunJian_UIItem.cs

@@ -7,6 +7,8 @@ using UnityEngine;
 using UnityEngine.UI;
 using System.Collections.Generic;
 using Google.Protobuf;
+using Newtonsoft.Json;
+using System.IO;
 
 public class ShowXunJian_UIItem : MonoBehaviour, IController
 {
@@ -32,6 +34,7 @@ public class ShowXunJian_UIItem : MonoBehaviour, IController
         Warning_Btn.onClick.AddListener(WarningClick);
         LabelText_Input.onValueChanged.AddListener(NewStr => mOutliers = NewStr);
     }
+
     private void OnEnable()
     {
         StartCoroutine(SetCurrentUIItem());
@@ -40,9 +43,10 @@ public class ShowXunJian_UIItem : MonoBehaviour, IController
     {
         yield return new WaitForSeconds(0.01f);
         StartXunJian.Instance.currentUIItem = this;
+        PlayerPrefs.SetInt("ShowXunJianStep", mItemID);
     }
 
-    private int mItemID; // 检查项目的编号 1-12
+    private int mItemID = 1; // 检查项目的编号 1-12
     private bool mNormal = true; //是否正常
     private string mOutliers = ""; // 标签
     private int mInspectionId; // 巡检编号,巡检开始时返回的id
@@ -162,4 +166,9 @@ public class ShowXunJian_UIItem : MonoBehaviour, IController
         WarningPanel_go.SetActive(true);
         mNormal = false;
     }
+}
+
+public static class CurrentStep
+{
+    public static int step;
 }

+ 1 - 2
Assets/Game/ShowXunJian/ShowXunJian.prefab

@@ -7346,7 +7346,6 @@ MonoBehaviour:
   - {fileID: 1848223607491329095}
   - {fileID: 1994716478973536713}
   - {fileID: 2051214061360007007}
-  mScreenshotSprite: {fileID: 21300000, guid: 72a6f38aacb371e4e808f9b74800e742, type: 3}
 --- !u!114 &2159527941179580181
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -12049,7 +12048,7 @@ PrefabInstance:
       objectReference: {fileID: 0}
     - target: {fileID: 7541715656771924501, guid: 7a90b1574b243db46a13f4c5243925bf, type: 3}
       propertyPath: m_IsActive
-      value: 1
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 7662955294641609868, guid: 7a90b1574b243db46a13f4c5243925bf, type: 3}
       propertyPath: m_text

+ 11 - 2
Assets/Game/ShowXunJian/StartXunJian.cs

@@ -1,9 +1,14 @@
 using System.Collections.Generic;
 using Blue;
+using System.IO;
 using UnityEngine;
 using UnityEngine.Events;
 using UnityEngine.UI;
 using TMPro;
+using UnityEngine.Networking;
+using System.Collections;
+using UnityEditor.Experimental.GraphView;
+using BestHTTP.JSON;
 
 namespace GHZLangChao
 {
@@ -40,6 +45,10 @@ namespace GHZLangChao
         private void Awake()
         {
             Instance = this;
+
+            var step = PlayerPrefs.GetInt("ShowXunJianStep");
+            ToggleList[step-1].isOn = true;
+            currentUIItem = ItemList[step-1];
         }
         void Start()
         {
@@ -64,6 +73,7 @@ namespace GHZLangChao
             if (mInspectionService == null)
                 mInspectionService = this.GetService<IInspectionService>();
             Init(mInspectionService.InspectionInfo);
+
         }
         private void Update()
         {
@@ -78,7 +88,6 @@ namespace GHZLangChao
             ShowXunJian.Instance.gotoWindow(ScenesManager.SceneType.ShowDH);
         }
 
-
         public void back()
         {
             ScenesManager.Instance.showWindow(ScenesManager.SceneType.ShowChoose);
@@ -144,7 +153,7 @@ namespace GHZLangChao
             arrayImage[arrayImageIndex].sprite = sprite;
 
             ItemList[arrayImageIndex / 3].ChangeSprite(arrayImageIndex % 3, this.GetUtility<IRawImageForSpriteUtility>().TextureToTexture2D(ShowRawImage.texture));
-            
+
             arrayImageIndex++;
             if (arrayImageIndex % 3 == 0)
             {