Ver Fonte

流程整合2

slambb há 2 anos atrás
pai
commit
cf41bf2397

+ 32 - 1
Assets/BowArrow/InfraredCamera/InfraredDemo.cs

@@ -269,7 +269,38 @@ public class InfraredDemo : MonoBehaviour
         }
         InfraredScreenPositioningView1.Enter(texture2D);
     }
-#endregion
+    #endregion
+
+
+    #region 相机感光度
+    public void onSetSliderValue(Slider _slider)
+    {
+        if (running)
+        {
+            float v = infraredCameraHelper.GetBrightness();
+            _slider.SetValueWithoutNotify(v);
+        }
+        else _slider.SetValueWithoutNotify(5);
+    }
+    public void onSliderEvent(float value)
+    {
+        Debug.Log(value);
+        //修改亮度时,调试界面的亮度也应该一起修改
+        if (running)
+        {
+            Slider slider = transform.Find("InfraredCamera/Layout/SliderBrightness")
+                .GetComponent<Slider>();
+            slider.value = value;
+        }
+    }
+    #endregion
+
+
+    public void resetInfraredPlayerPrefs() {
+        //测试用
+        PlayerPrefs.DeleteKey("entry-guider-infrared-" + LoginMgr.myUserInfo.id);
+        PlayerPrefs.DeleteKey("hideInfraredBowAndArrow");
+    }
 }
 public class ParamFloatValue
 {

+ 57 - 7
Assets/BowArrow/InfraredCamera/InfraredScreenPositioningView1.cs

@@ -3,7 +3,7 @@ using System.Collections.Generic;
 using UnityEngine;
 using LineUI;
 using UnityEngine.UI;
-
+using System.Linq;
 
 public class InfraredScreenPositioningView1  : MonoBehaviour
 {
@@ -35,10 +35,18 @@ public class InfraredScreenPositioningView1  : MonoBehaviour
         SetLinePos();
 
         //相机感光度
-        slider.onValueChanged.AddListener((value)=> {
-            onSliderEvent(value);
-        });
-        onSetSliderValue();
+        //slider.onValueChanged.AddListener((value)=> {
+        //    onSliderEvent(value);
+        //});
+        //onSetSliderValue();
+        if (InfraredDemo._ins)
+        {
+            slider.onValueChanged.AddListener((value) =>
+            {
+                InfraredDemo._ins.onSliderEvent(value);
+            });
+            InfraredDemo._ins.onSetSliderValue(slider);
+        }
     }
 
     public void OnClick_Back()
@@ -82,7 +90,7 @@ public class InfraredScreenPositioningView1  : MonoBehaviour
     void AddOldLinePosition()
     {
         //记录一个操作点的操作位置
-        List<Vector2> screenPositions = new List<Vector2>();
+        List<Vector3> screenPositions = new List<Vector3>();
         screenPositions.Add(pos1.localPosition);
         screenPositions.Add(pos2.localPosition);
         screenPositions.Add(pos3.localPosition);
@@ -121,7 +129,7 @@ public class InfraredScreenPositioningView1  : MonoBehaviour
             // 获取回退的那个元素点
             LinePosition lastElement_second = oldLinePosition[oldLinePosition.Count - 2];
             // 获取最后一个元素
-            LinePosition lastElement = oldLinePosition[oldLinePosition.Count - 1];
+           // LinePosition lastElement = oldLinePosition[oldLinePosition.Count - 1];
             //Debug.Log(JsonUtility.ToJson(lastElement) + " = " + oldLinePosition.Count);
             oldLinePosition.RemoveAt(oldLinePosition.Count - 1); // 删除最后一个元素
             pos1.localPosition = lastElement_second.pos[0];
@@ -237,5 +245,47 @@ public class InfraredScreenPositioningView1  : MonoBehaviour
             InfraredDemo.infraredCameraHelper.QuitScreenLocateManual(_locatePointList);
             FindObjectOfType<InfraredDemo>().SetLocatePointsToCameraRender(_locatePointList, _texWidth, _texHeight);
         }
+
+        SaveLocalPos();
+    }
+
+
+
+    void SaveLocalPos()
+    {
+        List<Vector3> screenPositions = new List<Vector3>();
+        screenPositions.Add(pos1.localPosition);
+        screenPositions.Add(pos2.localPosition);
+        screenPositions.Add(pos3.localPosition);
+        screenPositions.Add(pos4.localPosition);
+        string saveStr = string.Join(';', screenPositions.Select(v => $"{v.x},{v.y},{v.z}"));
+        Debug.Log(saveStr);
+        PlayerPrefs.SetString("ScreenPositioningView", saveStr);
+
+    }
+
+    private void Awake()
+    {
+        GetLocalPos();
+    }
+
+    void GetLocalPos()
+    {
+        string posListStr = PlayerPrefs.GetString("ScreenPositioningView", "");
+        if (!string.IsNullOrWhiteSpace(posListStr))
+        {
+            List<Vector3> posList = posListStr.Split(';')
+                .Select(s =>
+                {
+                    string[] parts = s.Split(',');
+                    return new Vector3(float.Parse(parts[0]), float.Parse(parts[1]), float.Parse(parts[2]));
+                })
+                .ToList();
+            pos1.localPosition = posList[0];
+            pos2.localPosition = posList[1];
+            pos3.localPosition = posList[2];
+            pos4.localPosition = posList[3];
+            SetRectanglePoints(linePosConversion(pos1.localPosition, pos2.localPosition, pos3.localPosition, pos4.localPosition));
+        }
     }
 }

+ 215 - 1
Assets/BowArrow/InfraredCamera/Resources/InfraredDemo.prefab

@@ -320,6 +320,7 @@ RectTransform:
   - {fileID: 1406637764187674216}
   - {fileID: 3641311607898161875}
   - {fileID: 7974945653309356713}
+  - {fileID: 8511826247942912975}
   m_Father: {fileID: 7795906586411487646}
   m_RootOrder: 1
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -988,6 +989,220 @@ RectTransform:
   m_AnchoredPosition: {x: 0, y: 0}
   m_SizeDelta: {x: 0, y: 0}
   m_Pivot: {x: 0.5, y: 0.5}
+--- !u!1 &1578505920360261238
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 5660776098790846546}
+  - component: {fileID: 281693139912101750}
+  - component: {fileID: 2519625184918815853}
+  m_Layer: 5
+  m_Name: Text
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &5660776098790846546
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1578505920360261238}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 8511826247942912975}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0, y: 0}
+  m_AnchorMax: {x: 1, y: 1}
+  m_AnchoredPosition: {x: 0, y: 0}
+  m_SizeDelta: {x: 0, y: 0}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!222 &281693139912101750
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1578505920360261238}
+  m_CullTransparentMesh: 1
+--- !u!114 &2519625184918815853
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1578505920360261238}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
+  m_RaycastTarget: 1
+  m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
+  m_Maskable: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+  m_FontData:
+    m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
+    m_FontSize: 14
+    m_FontStyle: 0
+    m_BestFit: 0
+    m_MinSize: 10
+    m_MaxSize: 40
+    m_Alignment: 4
+    m_AlignByGeometry: 0
+    m_RichText: 1
+    m_HorizontalOverflow: 0
+    m_VerticalOverflow: 0
+    m_LineSpacing: 1
+  m_Text: "\u91CD\u7F6E\u6D4B\u8BD5\u89E6\u53D1\u6D41\u7A0B"
+--- !u!1 &1624895643044562464
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 8511826247942912975}
+  - component: {fileID: 777009903553992796}
+  - component: {fileID: 1025603994455231149}
+  - component: {fileID: 6938800863672811506}
+  m_Layer: 5
+  m_Name: BtnResetInfraredPlayerPrefs
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &8511826247942912975
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1624895643044562464}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children:
+  - {fileID: 5660776098790846546}
+  m_Father: {fileID: 3859395984171938655}
+  m_RootOrder: 7
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0, y: 0}
+  m_AnchorMax: {x: 0, y: 0}
+  m_AnchoredPosition: {x: 0, y: 0}
+  m_SizeDelta: {x: 120, y: 30}
+  m_Pivot: {x: 0, y: 1}
+--- !u!222 &777009903553992796
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1624895643044562464}
+  m_CullTransparentMesh: 1
+--- !u!114 &1025603994455231149
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1624895643044562464}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 1
+  m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
+  m_Maskable: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+  m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
+  m_Type: 1
+  m_PreserveAspect: 0
+  m_FillCenter: 1
+  m_FillMethod: 4
+  m_FillAmount: 1
+  m_FillClockwise: 1
+  m_FillOrigin: 0
+  m_UseSpriteMesh: 0
+  m_PixelsPerUnitMultiplier: 1
+--- !u!114 &6938800863672811506
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1624895643044562464}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Navigation:
+    m_Mode: 3
+    m_WrapAround: 0
+    m_SelectOnUp: {fileID: 0}
+    m_SelectOnDown: {fileID: 0}
+    m_SelectOnLeft: {fileID: 0}
+    m_SelectOnRight: {fileID: 0}
+  m_Transition: 1
+  m_Colors:
+    m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
+    m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
+    m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
+    m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
+    m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
+    m_ColorMultiplier: 1
+    m_FadeDuration: 0.1
+  m_SpriteState:
+    m_HighlightedSprite: {fileID: 0}
+    m_PressedSprite: {fileID: 0}
+    m_SelectedSprite: {fileID: 0}
+    m_DisabledSprite: {fileID: 0}
+  m_AnimationTriggers:
+    m_NormalTrigger: Normal
+    m_HighlightedTrigger: Highlighted
+    m_PressedTrigger: Pressed
+    m_SelectedTrigger: Selected
+    m_DisabledTrigger: Disabled
+  m_Interactable: 1
+  m_TargetGraphic: {fileID: 1025603994455231149}
+  m_OnClick:
+    m_PersistentCalls:
+      m_Calls:
+      - m_Target: {fileID: 4914227450854944308}
+        m_TargetAssemblyTypeName: InfraredDemo, Assembly-CSharp
+        m_MethodName: resetInfraredPlayerPrefs
+        m_Mode: 1
+        m_Arguments:
+          m_ObjectArgument: {fileID: 0}
+          m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
+          m_IntArgument: 0
+          m_FloatArgument: 0
+          m_StringArgument: 
+          m_BoolArgument: 0
+        m_CallState: 2
 --- !u!1 &1817097528394883970
 GameObject:
   m_ObjectHideFlags: 0
@@ -3030,7 +3245,6 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   _cameraRender: {fileID: 622231698153027125}
-  _imageScreenLocateManual: {fileID: 6832211587418167164}
   _crosshairsInCamera:
   - {fileID: 5571109178229620146}
   - {fileID: 1663164113305042632}

+ 8 - 9
Assets/BowArrow/Modules/InfraredGuider/InfraredGuider.cs

@@ -13,22 +13,21 @@ public class InfraredGuider : MonoBehaviour
     // Start is called before the first frame update
     void Start()
     {
-        if (InfraredDemo.infraredCameraHelper != null)
+        if (InfraredDemo._ins)
         {
-            //Ïà»ú¸Ð¹â¶È
-            slider.onValueChanged.AddListener((value) => {
-                //onSliderEvent(value);
-                InfraredDemo._ins.SetBrightness(value);
+            slider.onValueChanged.AddListener((value) =>
+            {
+                InfraredDemo._ins.onSliderEvent(value);
             });
-            slider.value = InfraredDemo._ins.brightness.Get();
+            InfraredDemo._ins.onSetSliderValue(slider);
         }
     }
 
     // Update is called once per frame
-    void Update()
-    {
+    //void Update()
+    //{
         
-    }
+    //}
 
     public void enterLightView() {
 

+ 12 - 11
Assets/BowArrow/Modules/InfraredGuider/InfraredLightGuider.cs

@@ -15,24 +15,25 @@ public class InfraredLightGuider : MonoBehaviour
     // Start is called before the first frame update
     void Start()
     {
-        if (InfraredDemo.infraredCameraHelper != null)
+        if (InfraredDemo._ins)
         {
-            rawImage.texture = InfraredDemo.infraredCameraHelper.GetCameraTexture();
-
-            //Ïà»ú¸Ð¹â¶È
-            slider.onValueChanged.AddListener((value) => {
-                //onSliderEvent(value);
-                InfraredDemo._ins.SetBrightness(value);
+            slider.onValueChanged.AddListener((value) =>
+            {
+                InfraredDemo._ins.onSliderEvent(value);
             });
-            slider.value = InfraredDemo._ins.brightness.Get();
+            InfraredDemo._ins.onSetSliderValue(slider);
+        }
+        if (InfraredDemo.running)
+        {
+            rawImage.texture = InfraredDemo.infraredCameraHelper.GetCameraTexture();
         }
     }
 
     // Update is called once per frame
-    void Update()
-    {
+    //void Update()
+    //{
         
-    }
+    //}
 
     public void Close() {
         Destroy(gameObject);

+ 5 - 1
Assets/BowArrow/Scripts/View/Home/DeviceView_ItemShow.cs

@@ -80,7 +80,7 @@ public class DeviceView_ItemShow : MonoBehaviour
             AimHandler.ins.SetAimDeviceSelectIndex(deviceIndex);
             AimHandler.ins.onCreateTempAimDeviceInfo();
             ViewMgr.Instance.ShowView<SmartArcheryView>();
-            //ViewManager2.ShowView(ViewManager2.Path_ConnectGuidanceView);
+            //判断当前的信息是否是 HOUYI PRO,是的话直接跳转到pro初始化?
         });
 
         ConnectButton.onClick.AddListener(delegate ()
@@ -366,6 +366,10 @@ public class DeviceView_ItemShow : MonoBehaviour
                 titleText.text = "ARTEMIS";
                 bowBg.sprite = bowBgs[1];
                 break;
+            case AimDeviceType.HOUYIPRO:
+                titleText.text = "HOUYI Pro";
+                bowBg.sprite = bowBgs[0];
+                break;
             default:
                 bShow = false;
                 //Debug.LogWarning("AimDeviceType:" + ((AimDeviceType)aimDeviceInfo.type).ToString());

+ 1 - 1
Assets/InfraredProject/InfraredCamera/Effect/BrightnessSaturationContrastMaterial.mat

@@ -71,7 +71,7 @@ Material:
     - _Mode: 0
     - _OcclusionStrength: 1
     - _Parallax: 0.02
-    - _Saturation: 1.3234482
+    - _Saturation: 1
     - _SmoothnessTextureChannel: 0
     - _SpecularHighlights: 1
     - _SrcBlend: 1

+ 1 - 3
Assets/SmartBow/Scripts/Views/InfraredViewParts/InfraredGuidanceView.cs

@@ -11,9 +11,7 @@ public class InfraredGuidanceView  : JCUnityLib.ViewBase
     // Start is called before the first frame update
     void Start()
     {
-        //²âÊÔÓÃ
-        PlayerPrefs.DeleteKey("entry-guider-infrared-" + LoginMgr.myUserInfo.id);
-        PlayerPrefs.DeleteKey("hideInfraredBowAndArrow");
+       
         
     }
 

+ 46 - 35
Assets/SmartBow/Scripts/Views/InfraredViewParts/InfraredScreenPositioningView.cs

@@ -3,10 +3,11 @@ using System.Collections.Generic;
 using UnityEngine;
 using LineUI;
 using UnityEngine.UI;
+using System.Linq;
 
 public class LinePosition {
     public int index;
-    public List<Vector2> pos;
+    public List<Vector3> pos;
 }
 
 public class InfraredScreenPositioningView  : JCUnityLib.ViewBase
@@ -38,17 +39,8 @@ public class InfraredScreenPositioningView  : JCUnityLib.ViewBase
 
     private void Awake()
     {
-        string posListStr =  PlayerPrefs.GetString("ScreenPositioningView","");
-        Debug.Log("posListStr:"+ posListStr);
-        //if (posListStr != "") {
-        //    List<Vector3> posList = JsonUtility.FromJson<List<Vector3>>(posListStr);
-        //    pos1.localPosition = posList[0];
-        //    pos2.localPosition = posList[1];
-        //    pos3.localPosition = posList[2];
-        //    pos4.localPosition = posList[3];
-        //    SetRectanglePoints(linePosConversion(pos1.localPosition, pos2.localPosition, pos3.localPosition, pos4.localPosition));
-        //}
-   
+        GetLocalPos();
+
     }
 
     void Start()
@@ -58,15 +50,21 @@ public class InfraredScreenPositioningView  : JCUnityLib.ViewBase
         SetLinePos();
 
         //相机感光度
-      
-        if (InfraredDemo.running)
-        {
+        if (InfraredDemo._ins) {
             slider.onValueChanged.AddListener((value) => {
-                //onSliderEvent(value);
-                InfraredDemo._ins.SetBrightness(value);
+                InfraredDemo._ins.onSliderEvent(value);
             });
-            slider.value = InfraredDemo._ins.brightness.Get();
+            InfraredDemo._ins.onSetSliderValue(slider);
+        }
+        //slider.onValueChanged.AddListener((value) => {
+        //    //onSliderEvent(value);
+        //    InfraredDemo._ins.SetBrightness(value);
+        //});
+        //slider.value = InfraredDemo._ins.brightness.Get();
 
+        //图像
+        if (InfraredDemo.running)
+        {
             //渲染截图
             Texture2D texture2D = InfraredDemo.infraredCameraHelper.EnterScreenLocateManual();
             if (texture2D == null)
@@ -121,7 +119,7 @@ public class InfraredScreenPositioningView  : JCUnityLib.ViewBase
     void AddOldLinePosition()
     {
         //记录一个操作点的操作位置
-        List<Vector2> screenPositions = new List<Vector2>();
+        List<Vector3> screenPositions = new List<Vector3>();
         screenPositions.Add(pos1.localPosition);
         screenPositions.Add(pos2.localPosition);
         screenPositions.Add(pos3.localPosition);
@@ -187,11 +185,13 @@ public class InfraredScreenPositioningView  : JCUnityLib.ViewBase
             oldLinePosition.Add(lastElement);
         }
 
-
-        //跳转入界面
-        AudioMgr.ins.PlayBtn();
-        ViewManager2.HideView(ViewManager2.Path_InfraredScreenPositioningView);
-        ViewManager2.ShowView(ViewManager2.Path_ConnectGuidanceView);
+        if (InfraredDemo.running) {
+            //跳转入界面
+            AudioMgr.ins.PlayBtn();
+            ViewManager2.HideView(ViewManager2.Path_InfraredScreenPositioningView);
+            ViewManager2.ShowView(ViewManager2.Path_ConnectGuidanceView);
+        }
+  
 
 
         Quit();
@@ -219,15 +219,6 @@ public class InfraredScreenPositioningView  : JCUnityLib.ViewBase
     #endregion
 
 
-    #region 相机感光度
-    public void onSetSliderValue(float value) {
-        slider.value = value;
-    }
-    public void onSliderEvent(float value) {
-        Debug.Log(value);
-    }
-    #endregion
-
     List<Vector2> _locatePointList = new();
     float _texWidth;
     float _texHeight;
@@ -253,13 +244,33 @@ public class InfraredScreenPositioningView  : JCUnityLib.ViewBase
 
 
     void SaveLocalPos() {
-        List<Vector2> screenPositions = new List<Vector2>();
+        List<Vector3> screenPositions = new List<Vector3>();
         screenPositions.Add(pos1.localPosition);
         screenPositions.Add(pos2.localPosition);
         screenPositions.Add(pos3.localPosition);
         screenPositions.Add(pos4.localPosition);
+        string saveStr = string.Join(';', screenPositions.Select(v => $"{v.x},{v.y},{v.z}"));
+        Debug.Log(saveStr);
+        PlayerPrefs.SetString("ScreenPositioningView", saveStr);
 
-        PlayerPrefs.SetString("ScreenPositioningView", JsonUtility.ToJson(screenPositions));
+    }
 
+    void GetLocalPos() {
+        string posListStr = PlayerPrefs.GetString("ScreenPositioningView", "");
+        if (!string.IsNullOrWhiteSpace(posListStr))
+        {
+            List<Vector3> posList = posListStr.Split(';')
+                .Select(s =>
+                {
+                    string[] parts = s.Split(',');
+                    return new Vector3(float.Parse(parts[0]), float.Parse(parts[1]), float.Parse(parts[2]));
+                })
+                .ToList();
+            pos1.localPosition = posList[0];
+            pos2.localPosition = posList[1];
+            pos3.localPosition = posList[2];
+            pos4.localPosition = posList[3];
+            SetRectanglePoints(linePosConversion(pos1.localPosition, pos2.localPosition, pos3.localPosition, pos4.localPosition));
+        }
     }
 }