camera movement start

This commit is contained in:
Vladimir Koshevarov
2023-03-09 16:08:30 +02:00
parent bcaa786e7c
commit 516cea0815
2 changed files with 34 additions and 24 deletions
+15 -22
View File
@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1 m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0} m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0} m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.17276844, g: 0.21589246, b: 0.2978263, a: 1} m_IndirectSpecularColor: {r: 0.172768, g: 0.21589169, b: 0.29782546, a: 1}
m_UseRadianceAmbientProbe: 0 m_UseRadianceAmbientProbe: 0
--- !u!157 &3 --- !u!157 &3
LightmapSettings: LightmapSettings:
@@ -1003,7 +1003,6 @@ MonoBehaviour:
_startHour: 9 _startHour: 9
_sunriseHour: 7 _sunriseHour: 7
_sunsetHour: 20.5 _sunsetHour: 20.5
_minuteToRealTime: 0.5
--- !u!4 &307039700 --- !u!4 &307039700
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -2449,8 +2448,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 182.005, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 364.01, y: 50} m_SizeDelta: {x: 0, y: 50}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &771379432 --- !u!114 &771379432
MonoBehaviour: MonoBehaviour:
@@ -2528,7 +2527,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 182.005, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 70} m_SizeDelta: {x: 0, y: 70}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &815467878 --- !u!114 &815467878
@@ -2958,7 +2957,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 957.94086, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &927596948 --- !u!114 &927596948
@@ -3247,7 +3246,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 674.0475, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &952219226 --- !u!114 &952219226
@@ -3389,7 +3388,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963194225} m_GameObject: {fileID: 963194225}
m_LocalRotation: {x: 0.54491353, y: 0.00000002885483, z: -0.00000001875198, w: 0.8384923} m_LocalRotation: {x: 0.54491353, y: 0.00000002885483, z: -0.00000001875198, w: 0.8384923}
m_LocalPosition: {x: 29.11, y: 8.917, z: -54.39} m_LocalPosition: {x: 29.11, y: 9, z: -54.39}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@@ -4002,12 +4001,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1184343256} m_GameObject: {fileID: 1184343256}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!4 &1189180335 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 3284961431740112560, guid: c0021857f236ae341a3c917b9da4dfaf,
type: 3}
m_PrefabInstance: {fileID: 603449532}
m_PrefabAsset: {fileID: 0}
--- !u!95 &1189180339 --- !u!95 &1189180339
Animator: Animator:
serializedVersion: 5 serializedVersion: 5
@@ -9540,7 +9533,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 20, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1503626360 --- !u!114 &1503626360
@@ -10832,7 +10825,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 275.15417, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1811096135 --- !u!114 &1811096135
@@ -11054,7 +11047,7 @@ PrefabInstance:
- target: {fileID: 3806516704876462308, guid: ea47665625ccfd4408f6411caf45f910, - target: {fileID: 3806516704876462308, guid: ea47665625ccfd4408f6411caf45f910,
type: 3} type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 182.005 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 3806516704876462308, guid: ea47665625ccfd4408f6411caf45f910, - target: {fileID: 3806516704876462308, guid: ea47665625ccfd4408f6411caf45f910,
type: 3} type: 3}
@@ -11321,7 +11314,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1930563419} m_GameObject: {fileID: 1930563419}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 29.11, y: 0, z: -50.39}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@@ -11377,7 +11370,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 182.005, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1964284071 --- !u!114 &1964284071
@@ -12178,7 +12171,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2110938951} m_GameObject: {fileID: 2110938951}
m_LocalRotation: {x: 0.54491353, y: 0.00000002885483, z: -0.00000001875198, w: 0.8384923} m_LocalRotation: {x: 0.54491353, y: 0.00000002885483, z: -0.00000001875198, w: 0.8384923}
m_LocalPosition: {x: 29.11, y: 8.917, z: -54.39} m_LocalPosition: {x: 29.11, y: 9, z: -54.39}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
@@ -12204,8 +12197,8 @@ MonoBehaviour:
m_StreamingVersion: 20170927 m_StreamingVersion: 20170927
m_Priority: 10 m_Priority: 10
m_StandbyUpdate: 2 m_StandbyUpdate: 2
m_LookAt: {fileID: 1189180335} m_LookAt: {fileID: 1930563420}
m_Follow: {fileID: 1189180335} m_Follow: {fileID: 1930563420}
m_Lens: m_Lens:
FieldOfView: 60.000004 FieldOfView: 60.000004
OrthographicSize: 5 OrthographicSize: 5
+19 -2
View File
@@ -6,10 +6,27 @@ public class CameraSystem : MonoBehaviour
[SerializeField] [SerializeField]
private CinemachineVirtualCamera _camera; private CinemachineVirtualCamera _camera;
private float _moveSpeed = 50f;
private void Start() private void Start()
{ {
_camera.LookAt = Player.Instance.transform; transform.position = Player.Instance.transform.position;
_camera.Follow = Player.Instance.transform; //_camera.LookAt = Player.Instance.transform;
//_camera.Follow = Player.Instance.transform;
}
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;
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;
} }
} }