相机角度调整

This commit is contained in:
huyulong 2024-12-16 11:48:57 +08:00
parent fd4087570c
commit ce28192126
2 changed files with 291 additions and 12 deletions

View File

@ -3582,7 +3582,7 @@ PrefabInstance:
m_Modifications:
- target: {fileID: -8679921383154817045, guid: b4bc8a6718ad365439657b4dace25c94, type: 3}
propertyPath: m_RootOrder
value: 1
value: 3
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: b4bc8a6718ad365439657b4dace25c94, type: 3}
propertyPath: m_LocalPosition.x
@ -3630,7 +3630,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: b4bc8a6718ad365439657b4dace25c94, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5866666021909216657, guid: b4bc8a6718ad365439657b4dace25c94, type: 3}
propertyPath: m_Controller
@ -3647,11 +3647,6 @@ Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: b4bc8a6718ad365439657b4dace25c94, type: 3}
m_PrefabInstance: {fileID: 272025129}
m_PrefabAsset: {fileID: 0}
--- !u!95 &272025131 stripped
Animator:
m_CorrespondingSourceObject: {fileID: 5866666021909216657, guid: b4bc8a6718ad365439657b4dace25c94, type: 3}
m_PrefabInstance: {fileID: 272025129}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &285549842
PrefabInstance:
m_ObjectHideFlags: 0
@ -4625,6 +4620,8 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1948499802}
- {fileID: 946635801}
- {fileID: 1271748203}
- {fileID: 272025130}
m_Father: {fileID: 0}
m_RootOrder: 27
@ -4654,7 +4651,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: ea9eb82687dfa674e883273cd7c73386, type: 3}
m_Name:
m_EditorClassIdentifier:
ain: {fileID: 272025131}
ain: {fileID: 946635802}
characterState: 0
PlayerCollider: {fileID: 382802810}
--- !u!114 &382802815
@ -4746,7 +4743,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b0e8bb916545c834b8981bdf116ec889, type: 3}
m_Name:
m_EditorClassIdentifier:
CharacterAnimator: {fileID: 272025131}
CharacterAnimator: {fileID: 946635802}
player: {fileID: 382802812}
relativePosition: {x: 0, y: 0, z: 0}
relativeRotation: {x: 0, y: 0, z: 0}
@ -5992,6 +5989,37 @@ Transform:
m_CorrespondingSourceObject: {fileID: 427500, guid: 6e17dbb9cc1686d45a12d7c945a8cb1a, type: 3}
m_PrefabInstance: {fileID: 480915455}
m_PrefabAsset: {fileID: 0}
--- !u!1 &496425324
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 496425325}
m_Layer: 0
m_Name: 2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &496425325
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 496425324}
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: 1298151666}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &509858615
PrefabInstance:
m_ObjectHideFlags: 0
@ -7485,8 +7513,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1a829b8d12d88e14487451b9c601ab85, type: 3}
m_Name:
m_EditorClassIdentifier:
npcsList: []
npc: {fileID: 0}
npcposition: []
--- !u!1 &702643057
GameObject:
m_ObjectHideFlags: 0
@ -9459,6 +9487,85 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 945867066}
m_CullTransparentMesh: 1
--- !u!1001 &946635800
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 382802812}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: cb3fa301a56f31a4d8301eccece5521b, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cb3fa301a56f31a4d8301eccece5521b, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cb3fa301a56f31a4d8301eccece5521b, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cb3fa301a56f31a4d8301eccece5521b, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cb3fa301a56f31a4d8301eccece5521b, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cb3fa301a56f31a4d8301eccece5521b, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cb3fa301a56f31a4d8301eccece5521b, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cb3fa301a56f31a4d8301eccece5521b, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cb3fa301a56f31a4d8301eccece5521b, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cb3fa301a56f31a4d8301eccece5521b, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cb3fa301a56f31a4d8301eccece5521b, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: cb3fa301a56f31a4d8301eccece5521b, type: 3}
propertyPath: m_Name
value: houqin_g
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: cb3fa301a56f31a4d8301eccece5521b, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5866666021909216657, guid: cb3fa301a56f31a4d8301eccece5521b, type: 3}
propertyPath: m_Controller
value:
objectReference: {fileID: 9100000, guid: b6b0af1684cf4a3459f82fde7a3622e6, type: 2}
- target: {fileID: 5866666021909216657, guid: cb3fa301a56f31a4d8301eccece5521b, type: 3}
propertyPath: m_ApplyRootMotion
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: cb3fa301a56f31a4d8301eccece5521b, type: 3}
--- !u!4 &946635801 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: cb3fa301a56f31a4d8301eccece5521b, type: 3}
m_PrefabInstance: {fileID: 946635800}
m_PrefabAsset: {fileID: 0}
--- !u!95 &946635802 stripped
Animator:
m_CorrespondingSourceObject: {fileID: 5866666021909216657, guid: cb3fa301a56f31a4d8301eccece5521b, type: 3}
m_PrefabInstance: {fileID: 946635800}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &947202399
PrefabInstance:
m_ObjectHideFlags: 0
@ -10868,7 +10975,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
Character: {fileID: 382802812}
pivotOffset: {x: 0, y: 1.7, z: 0}
camOffset: {x: 0.4, y: 0, z: -2}
camOffset: {x: 0.2, y: 0.2, z: -1}
smooth: 10
horizontalAimingSpeed: 6
verticalAimingSpeed: 6
@ -17841,6 +17948,80 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 28
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
--- !u!1001 &1271748202
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 382802812}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 9171e7ca79500f34e898b216455c02a8, type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 9171e7ca79500f34e898b216455c02a8, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 9171e7ca79500f34e898b216455c02a8, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 9171e7ca79500f34e898b216455c02a8, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 9171e7ca79500f34e898b216455c02a8, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 9171e7ca79500f34e898b216455c02a8, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 9171e7ca79500f34e898b216455c02a8, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 9171e7ca79500f34e898b216455c02a8, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 9171e7ca79500f34e898b216455c02a8, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 9171e7ca79500f34e898b216455c02a8, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 9171e7ca79500f34e898b216455c02a8, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 9171e7ca79500f34e898b216455c02a8, type: 3}
propertyPath: m_Name
value: laoshi_g
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 9171e7ca79500f34e898b216455c02a8, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5866666021909216657, guid: 9171e7ca79500f34e898b216455c02a8, type: 3}
propertyPath: m_Controller
value:
objectReference: {fileID: 9100000, guid: b6b0af1684cf4a3459f82fde7a3622e6, type: 2}
- target: {fileID: 5866666021909216657, guid: 9171e7ca79500f34e898b216455c02a8, type: 3}
propertyPath: m_ApplyRootMotion
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 9171e7ca79500f34e898b216455c02a8, type: 3}
--- !u!4 &1271748203 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 9171e7ca79500f34e898b216455c02a8, type: 3}
m_PrefabInstance: {fileID: 1271748202}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1276516505
GameObject:
m_ObjectHideFlags: 0
@ -18011,6 +18192,40 @@ Transform:
m_CorrespondingSourceObject: {fileID: 465756, guid: afc21475d23bd1a48a1ddd40ff4a62d8, type: 3}
m_PrefabInstance: {fileID: 1293071451}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1298151665
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1298151666}
m_Layer: 0
m_Name: lujin
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1298151666
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1298151665}
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: 1324073402}
- {fileID: 496425325}
- {fileID: 1670656697}
m_Father: {fileID: 0}
m_RootOrder: 30
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1301153373
PrefabInstance:
m_ObjectHideFlags: 0
@ -18187,6 +18402,37 @@ Transform:
m_Father: {fileID: 712540379}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1324073401
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1324073402}
m_Layer: 0
m_Name: 1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1324073402
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1324073401}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 13.74352, y: 9.960705, z: -26.640541}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1298151666}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1325257897
PrefabInstance:
m_ObjectHideFlags: 0
@ -21616,6 +21862,8 @@ MonoBehaviour:
LanguageJsonFile: {fileID: 4900000, guid: 62a41129c4663ee41a06274114d28feb, type: 3}
SelectJsonFile: {fileID: 4900000, guid: 3efd15f4195557144a45659d2baa1ba3, type: 3}
TaskJsonFile: {fileID: 4900000, guid: 4dec25769ed4ed3469693b1c881248af, type: 3}
GlobalJsonFile: {fileID: 0}
SelectsJsonFile: {fileID: 0}
--- !u!1001 &1542437476
PrefabInstance:
m_ObjectHideFlags: 0
@ -22729,6 +22977,37 @@ MeshCollider:
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 3102617728132672218, guid: 0c9b084f2070bda45b87da961d2eb0f6, type: 3}
--- !u!1 &1670656696
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1670656697}
m_Layer: 0
m_Name: 3
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1670656697
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1670656696}
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: 1298151666}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1674389068
PrefabInstance:
m_ObjectHideFlags: 0

View File

@ -6,7 +6,7 @@ public class CameraControl : MonoBehaviour
{
public Transform Character; // 玩家的引用。
public Vector3 pivotOffset = new Vector3(0.0f, 1.7f, 0.0f); // 相机相对于玩家的偏移量,用于调整相机的中心点。
public Vector3 camOffset = new Vector3(0.4f, 0.0f, -2.0f); // 相机相对于玩家位置的偏移量,用于定位相机。
public Vector3 camOffset = new Vector3(0.2f, 0.2f, -1f); // 相机相对于玩家位置的偏移量,用于定位相机。
public float smooth = 10f; // 相机响应的平滑速度。
public float horizontalAimingSpeed = 6f; // 水平转动速度。
public float verticalAimingSpeed = 6f; // 垂直转动速度。