30 lines
942 B
C#
30 lines
942 B
C#
using UnityEngine;
|
|
|
|
namespace Code.Gameplay.Camera.CameraStates
|
|
{
|
|
public class StaticState : BaseCameraState, ICameraState
|
|
{
|
|
public Transform LookTarget;
|
|
public StaticState(CameraStateMachineContext context) : base(context) { }
|
|
|
|
public override void EnterState()
|
|
{
|
|
Debug.Log("Static State Enter");
|
|
base.EnterState();
|
|
}
|
|
|
|
protected override void HandlePosition(float deltaTime, float zoomInput, Quaternion targetRotation)
|
|
{
|
|
Camera.transform.position = FollowTransform.position;
|
|
}
|
|
|
|
public CameraMode GetCameraMode() => CameraMode.Static;
|
|
|
|
protected override void HandleRotationInput(float deltaTime, Vector3 rotationInput,
|
|
out Quaternion targetRotation)
|
|
{
|
|
if(LookTarget) Camera.transform.LookAt(LookTarget);
|
|
targetRotation = Camera.transform.rotation;
|
|
}
|
|
}
|
|
} |