Quellcode durchsuchen

【+】
1.修改镜头设置

lxd vor 5 Monaten
Ursprung
Commit
37313bae34

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 0
ModeDisplay/Assets/.qframework/PackageManager/PackageInfosRequestCache.json


+ 17 - 8
ModeDisplay/Assets/Scripts/CameraSurround.cs

@@ -26,7 +26,7 @@ public class CameraSurround : MonoBehaviour
 
     public void SetCameraPosition(bool reset = false)
     {
-       Bounds tmpBounds = GetBounds(DeviceController.instance.transform);
+        Bounds tmpBounds = GetBounds(DeviceController.instance.transform);
 
         //物体最大长度
         float a = tmpBounds.size.magnitude;
@@ -35,15 +35,24 @@ public class CameraSurround : MonoBehaviour
         {
             if (reset)
             {
-                transform.position = tmpBounds.center +
-            ((tmpBounds.center + new Vector3(1, 0.2f, 0)) - tmpBounds.center).normalized
-            * a / 2 * 1.9f;
+                if (tmpBounds.size.x > tmpBounds.size.z)
+                {
+                    transform.position = tmpBounds.center +
+((tmpBounds.center + new Vector3(0.2f, 0, 1)) - tmpBounds.center).normalized
+* a / 2 * 1.9f;
+                }
+                else
+                {
+                    transform.position = tmpBounds.center +
+                  ((tmpBounds.center + new Vector3(1, 0.2f, 0)) - tmpBounds.center).normalized
+                   * a / 2 * 1.9f;
+                }
             }
             else
             {
                 transform.position = tmpBounds.center +
-            (transform.position - tmpBounds.center).normalized
-            * a / 2 * 1.9f;
+             (transform.position - tmpBounds.center).normalized
+             * a / 2 * 1.9f;
             }
         }
 
@@ -97,7 +106,7 @@ public class CameraSurround : MonoBehaviour
 
         if (Input.GetKey(KeyCode.Mouse1))
         {
-            if (m_RotationPoint.x.ToString() != "NaN"  && m_RotationPoint.y.ToString() != "NaN" && m_RotationPoint.z.ToString() != "NaN")
+            if (m_RotationPoint.x.ToString() != "NaN" && m_RotationPoint.y.ToString() != "NaN" && m_RotationPoint.z.ToString() != "NaN")
             {
                 transform.RotateAround(m_RotationPoint, Vector3.up, mouse_X * 5);
 
@@ -126,7 +135,7 @@ public class CameraSurround : MonoBehaviour
             tmpMeshRenders.AddRange(item.GetMeshRender());
         }
 
-        Bounds bounds = new Bounds(GetModelGroupBoundesConent(tmpMeshRenders.ToArray()),Vector3.zero);
+        Bounds bounds = new Bounds(GetModelGroupBoundesConent(tmpMeshRenders.ToArray()), Vector3.zero);
 
         foreach (Renderer renderer in tmpMeshRenders)
         {

+ 5 - 1
ModeDisplay/Assets/Scripts/Proxys/DeviceOfPartDataProxy.cs

@@ -1,5 +1,6 @@
 using System.Collections;
 using System.Collections.Generic;
+using System.IO;
 using UnityEngine;
 
 public class DeviceOfPartDataProxy : DataProxy
@@ -32,7 +33,10 @@ public class DeviceOfPartDataProxy : DataProxy
 
         string tmpPath = System.IO.Path.Combine(GlobalConfig.partTablePath, m_TableName);
 
-        m_PartInfos = ExcelHelper.ReadInfoFromExcel<PartDataInfo>(tmpPath, 1);
+        if (File.Exists(tmpPath))
+        {
+            m_PartInfos = ExcelHelper.ReadInfoFromExcel<PartDataInfo>(tmpPath, 1);
+        }
 
         return m_PartInfos;
     }

+ 8 - 0
ModeDisplay/Assets/StreamingAssets/AssetBundles.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 8db962ac4022b6e439f2f196ab8f95eb
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 2 - 1
ModeDisplay/ProjectSettings/ProjectSettings.asset

@@ -520,7 +520,8 @@ PlayerSettings:
   webGLLinkerTarget: 1
   webGLThreadsSupport: 0
   webGLWasmStreaming: 0
-  scriptingDefineSymbols: {}
+  scriptingDefineSymbols:
+    1: ODIN_INSPECTOR;ODIN_INSPECTOR_3
   platformArchitecture: {}
   scriptingBackend: {}
   il2cppCompilerConfiguration: {}

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.