Browse Source

994,关闭素材编辑按钮后

蓝色星空 1 year ago
parent
commit
12ff3bc591
2 changed files with 8 additions and 3 deletions
  1. 2 1
      Assets/Scripts/UI/EdirPanel/UIEditorPanel.cs
  2. 6 2
      Assets/Scripts/UI/GameManager.cs

+ 2 - 1
Assets/Scripts/UI/EdirPanel/UIEditorPanel.cs

@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections;
 using System.Collections.Generic;
 using Blue;
@@ -318,6 +318,7 @@ public class UIEditorPanel : AbstractController, EventObserver
             return;
         }
         Debug.Log("更新成功");
+        GameManager.Instance.needSavePosRotScale = true;
         UIManager.Instance.ShowUI(UINameConfig.LoadingPanel, typeof(LoadingPanel), (int)ELoadState.SaveSpoitDataEnd);
         ((LoadingPanel)UIManager.Instance.GetUI(UINameConfig.LoadingPanel)).TextStr = str;
 

+ 6 - 2
Assets/Scripts/UI/GameManager.cs

@@ -409,7 +409,7 @@ public class GameManager : MonoSingleton<GameManager>
 
 
     #region 设置功能
-
+    public bool needSavePosRotScale = true;
     public void OnEditorBtnValueChanged(bool ison)
     {
         m_EditorCanvas.gameObject.SetActive(ison);
@@ -422,7 +422,11 @@ public class GameManager : MonoSingleton<GameManager>
 
         if (ison)
         {
-            GetPosRotScale(); // 获取所有物体位置旋转缩放
+            if (needSavePosRotScale)
+            {
+                GetPosRotScale(); // 获取所有物体位置旋转缩放
+                needSavePosRotScale = false;
+            }
             m_EditorCanvas.position = OpenXRCamera.Instance.head.position + Player.transform.forward + new Vector3(0, 0.5f, 0);
             m_EditorCanvas.eulerAngles = new Vector3(0, OpenXRCamera.Instance.head.eulerAngles.y, 0);