change in camera system. move it far on the street an follow the player

This commit is contained in:
Vladimir Koshevarov
2023-03-13 13:31:17 +02:00
parent 516cea0815
commit 6d26efe67c
2 changed files with 28 additions and 28 deletions
+14 -14
View File
@@ -1343,7 +1343,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_BindingMode: 4
m_FollowOffset: {x: 0, y: 9, z: -4}
m_FollowOffset: {x: 0, y: 15, z: -7}
m_XDamping: 0.1
m_YDamping: 0.1
m_ZDamping: 0.1
@@ -2448,8 +2448,8 @@ RectTransform:
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: 0, y: 50}
m_AnchoredPosition: {x: 182.005, y: 0}
m_SizeDelta: {x: 364.01, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &771379432
MonoBehaviour:
@@ -2527,7 +2527,7 @@ RectTransform:
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_AnchoredPosition: {x: 182.005, y: 0}
m_SizeDelta: {x: 0, y: 70}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &815467878
@@ -2957,7 +2957,7 @@ RectTransform:
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_AnchoredPosition: {x: 882.17, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &927596948
@@ -3246,7 +3246,7 @@ RectTransform:
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_AnchoredPosition: {x: 628.58496, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &952219226
@@ -3387,8 +3387,8 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_LocalRotation: {x: 0.54491353, y: 0.00000002885483, z: -0.00000001875198, w: 0.8384923}
m_LocalPosition: {x: 29.11, y: 9, z: -54.39}
m_LocalRotation: {x: 0.53717524, y: 0.00000001592945, z: -0.000000010144878, w: 0.8434707}
m_LocalPosition: {x: 29.11, y: 15, z: -57.39}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -9533,7 +9533,7 @@ RectTransform:
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_AnchoredPosition: {x: 20, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1503626360
@@ -10825,7 +10825,7 @@ RectTransform:
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_AnchoredPosition: {x: 260, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1811096135
@@ -11047,7 +11047,7 @@ PrefabInstance:
- target: {fileID: 3806516704876462308, guid: ea47665625ccfd4408f6411caf45f910,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: 182.005
objectReference: {fileID: 0}
- target: {fileID: 3806516704876462308, guid: ea47665625ccfd4408f6411caf45f910,
type: 3}
@@ -11370,7 +11370,7 @@ RectTransform:
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_AnchoredPosition: {x: 182.005, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1964284071
@@ -12170,8 +12170,8 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2110938951}
m_LocalRotation: {x: 0.54491353, y: 0.00000002885483, z: -0.00000001875198, w: 0.8384923}
m_LocalPosition: {x: 29.11, y: 9, z: -54.39}
m_LocalRotation: {x: 0.53717524, y: 0.00000001592945, z: -0.000000010144878, w: 0.8434707}
m_LocalPosition: {x: 29.11, y: 15, z: -57.39}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
+14 -14
View File
@@ -10,23 +10,23 @@ public class CameraSystem : MonoBehaviour
private void Start()
{
transform.position = Player.Instance.transform.position;
//_camera.LookAt = Player.Instance.transform;
//_camera.Follow = Player.Instance.transform;
//transform.position = Player.Instance.transform.position;
_camera.LookAt = Player.Instance.transform;
_camera.Follow = Player.Instance.transform;
}
private void Update()
{
Vector3 inputDir = Vector3.zero;
//private void Update()
//{
// Vector3 inputDir = Vector3.zero;
if (Input.GetKey(KeyCode.W)) inputDir.z = +1f;
if (Input.GetKey(KeyCode.S)) inputDir.z = -1f;
if (Input.GetKey(KeyCode.A)) inputDir.x = -1f;
if (Input.GetKey(KeyCode.D)) inputDir.x = +1f;
// if (Input.GetKey(KeyCode.W)) inputDir.z = +1f;
// if (Input.GetKey(KeyCode.S)) inputDir.z = -1f;
// if (Input.GetKey(KeyCode.A)) inputDir.x = -1f;
// if (Input.GetKey(KeyCode.D)) inputDir.x = +1f;
Vector3 moveDir = transform.forward * inputDir.z + transform.right * inputDir.x;
// Vector3 moveDir = transform.forward * inputDir.z + transform.right * inputDir.x;
//if (moveDir == Vector3.zero && Player.Instance.stat) transform.position = Player.Instance.transform.position;
transform.position += moveDir * _moveSpeed * Time.deltaTime;
}
// //if (moveDir == Vector3.zero && Player.Instance.stat) transform.position = Player.Instance.transform.position;
// transform.position += moveDir * _moveSpeed * Time.deltaTime;
//}
}