35 lines
793 B
C#
35 lines
793 B
C#
using Code.Gameplay.Player;
|
|
using Code.Input;
|
|
using Reflex.Attributes;
|
|
using UnityEngine;
|
|
|
|
public class Player : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private PlayerCamera playerCamera;
|
|
[SerializeField]
|
|
private Transform cameraFollowPoint;
|
|
[Inject] private IInputService _inputService;
|
|
|
|
private Vector3 _lookInputVector;
|
|
|
|
private void Start()
|
|
{
|
|
playerCamera.SetFollowTransform(cameraFollowPoint);
|
|
}
|
|
|
|
private void HandleCameraInput()
|
|
{
|
|
var lookInput = _inputService.LookInput;
|
|
var scrollInput = _inputService.ZoomInput;
|
|
|
|
playerCamera.UpdateWithInput(Time.deltaTime, scrollInput,
|
|
new Vector3(lookInput.x, lookInput.y, 0));
|
|
}
|
|
|
|
private void LateUpdate()
|
|
{
|
|
HandleCameraInput();
|
|
}
|
|
}
|