Parcourir la source

修复多相机报错的问题

LAPTOP-OM1V99U2\永远de小亡灵 il y a 1 an
Parent
commit
aa51909a00

+ 10 - 19
ActionTowerDefense/Assets/Scenes/SampleScene.unity

@@ -347,7 +347,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!4 &467647573
 Transform:
   m_ObjectHideFlags: 0
@@ -692,7 +692,6 @@ GameObject:
   m_Component:
   - component: {fileID: 815407865}
   - component: {fileID: 815407867}
-  - component: {fileID: 815407866}
   m_Layer: 0
   m_Name: LeftCamera
   m_TagString: Untagged
@@ -707,22 +706,14 @@ Transform:
   m_PrefabInstance: {fileID: 0}
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 815407864}
-  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalRotation: {x: -0.06828518, y: 0, z: 0, w: 0.9976659}
   m_LocalPosition: {x: 0, y: 0, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children: []
   m_Father: {fileID: 467647573}
   m_RootOrder: 0
-  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
---- !u!81 &815407866
-AudioListener:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 815407864}
-  m_Enabled: 1
+  m_LocalEulerAnglesHint: {x: -7.831, y: 0, z: 0}
 --- !u!20 &815407867
 Camera:
   m_ObjectHideFlags: 0
@@ -744,11 +735,11 @@ Camera:
     serializedVersion: 2
     x: 0
     y: 0
-    width: 1
+    width: 0.5
     height: 1
   near clip plane: 0.3
   far clip plane: 1000
-  field of view: 60
+  field of view: 55
   orthographic: 0
   orthographic size: 5
   m_Depth: 0
@@ -803,13 +794,13 @@ Camera:
   m_FocalLength: 50
   m_NormalizedViewPortRect:
     serializedVersion: 2
-    x: 0
+    x: 0.5
     y: 0
-    width: 1
+    width: 0.5
     height: 1
   near clip plane: 0.3
   far clip plane: 1000
-  field of view: 60
+  field of view: 55
   orthographic: 0
   orthographic size: 5
   m_Depth: 0
@@ -842,14 +833,14 @@ Transform:
   m_PrefabInstance: {fileID: 0}
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 850878589}
-  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalRotation: {x: -0.06828518, y: 0, z: 0, w: 0.9976659}
   m_LocalPosition: {x: 0, y: 0, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_ConstrainProportionsScale: 0
   m_Children: []
   m_Father: {fileID: 467647573}
   m_RootOrder: 1
-  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_LocalEulerAnglesHint: {x: -7.831, y: 0, z: 0}
 --- !u!1 &1055802828
 GameObject:
   m_ObjectHideFlags: 0

+ 2 - 2
ActionTowerDefense/Assets/Scripts/CameraController.cs

@@ -4,8 +4,8 @@ using UnityEngine;
 
 public class CameraController : MonoBehaviour
 {
-    public float offsetX = 5, offsetY = 2, offsetZ = -10;
-    public float lerpValue = 0.02f;
+    public float offsetX = 6, offsetY = 3, offsetZ = -16;
+    public float lerpValue = 3.5f;
 
     [HideInInspector]
     public Vector3 targetPos;