entity changes, classes
This commit is contained in:
parent
bda2b88796
commit
8bd4aedcf9
20 changed files with 1917 additions and 27 deletions
|
|
@ -1,10 +1,17 @@
|
|||
using System;
|
||||
using Unity.Cinemachine;
|
||||
using UnityEngine;
|
||||
|
||||
public class CameraController : MonoBehaviour
|
||||
{
|
||||
public float panSpeed;
|
||||
public bool canMoveCamera = true;
|
||||
[SerializeField] private CinemachineCamera cineCam;
|
||||
[Header("Zoom")]
|
||||
[SerializeField] private float zoomSpeed;
|
||||
[SerializeField] private float camMaxSize;
|
||||
[SerializeField] private float camMinSize;
|
||||
|
||||
|
||||
private void Update()
|
||||
{
|
||||
|
|
@ -13,5 +20,12 @@ public class CameraController : MonoBehaviour
|
|||
Vector2 moveDirection = new Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));
|
||||
transform.Translate(moveDirection * (panSpeed * Time.deltaTime));
|
||||
}
|
||||
|
||||
if (Input.mouseScrollDelta.y != 0)
|
||||
{
|
||||
float scroll = Mathf.Clamp(cineCam.Lens.OrthographicSize - (Input.mouseScrollDelta.y * zoomSpeed),
|
||||
camMinSize, camMaxSize);
|
||||
cineCam.Lens.OrthographicSize = scroll;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue