Добавлена камера, обновлены инпут мапы и ещё чуть-чуть штук для теста (включая кринжовую сцену, стейт машины и др.)
This commit is contained in:
1 parent
b5e28c7abb
commit
86c9c126a6
20 files changed
+1062
-16
No files matched your search
@@ -0,0 +1,34 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user