added endscreen
This commit is contained in:
1 parent
a33eb50ca0
commit
2b01c50795
15 files changed
+989
-88
No files matched your search
@@ -24,9 +24,8 @@ namespace Code.Gameplay.Camera
|
||||
private void Awake()
|
||||
{
|
||||
_camera = GetComponent<UnityEngine.Camera>();
|
||||
if (_camera == null)
|
||||
if (!_camera)
|
||||
{
|
||||
Debug.LogError("CameraController requires a Camera component!");
|
||||
enabled = false;
|
||||
return;
|
||||
}
|
||||
@@ -56,12 +55,12 @@ namespace Code.Gameplay.Camera
|
||||
|
||||
private void UpdateCamera(float deltaTime, Vector3 lookInput)
|
||||
{
|
||||
var targetRotation = HandleRotation(deltaTime, lookInput);
|
||||
HandleRotation(deltaTime, lookInput);
|
||||
|
||||
HandlePosition(deltaTime, targetRotation);
|
||||
HandlePosition(deltaTime);
|
||||
}
|
||||
|
||||
private Quaternion HandleRotation(float deltaTime, Vector3 lookInput)
|
||||
private void HandleRotation(float deltaTime, Vector3 lookInput)
|
||||
{
|
||||
var horizontalRotation = Quaternion.Euler(Vector3.up * (lookInput.x * rotationSpeed));
|
||||
_planarDirection = horizontalRotation * _planarDirection;
|
||||
@@ -73,11 +72,9 @@ namespace Code.Gameplay.Camera
|
||||
|
||||
var targetRotation = planarRotation * verticalRotation;
|
||||
transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, deltaTime * rotationSharpness);
|
||||
|
||||
return targetRotation;
|
||||
}
|
||||
|
||||
private void HandlePosition(float deltaTime, Quaternion targetRotation)
|
||||
private void HandlePosition(float deltaTime)
|
||||
{
|
||||
_currentFollowPosition = Vector3.Lerp(
|
||||
_currentFollowPosition,
|
||||
@@ -102,15 +99,5 @@ namespace Code.Gameplay.Camera
|
||||
{
|
||||
return _planarDirection;
|
||||
}
|
||||
|
||||
public void SetFollowTransform(Transform target)
|
||||
{
|
||||
followTransform = target;
|
||||
|
||||
if (target == null) return;
|
||||
|
||||
_currentFollowPosition = target.position;
|
||||
_planarDirection = target.forward;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user