nahraná dosavadní verze hry

This commit is contained in:
2025-06-23 16:30:18 +02:00
commit 1cdde31d73
639 changed files with 255998 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
using UnityEngine;
public class CameraZoom : MonoBehaviour
{
public float zoomSpeed = 10f; // Speed of zooming
public float minZoom = 5f; // Minimum zoom distance
public float maxZoom = 20f; // Maximum zoom distance
private Camera cam;
void Start()
{
cam = GetComponent<Camera>(); // Get the Camera component attached to the GameObject
}
void Update()
{
// Get the scroll wheel input
float scrollInput = Input.GetAxis("Mouse ScrollWheel");
// Calculate the new field of view (FOV)
float newFOV = cam.fieldOfView - scrollInput * zoomSpeed;
// Clamp the FOV to be within the min and max zoom distances
cam.fieldOfView = Mathf.Clamp(newFOV, minZoom, maxZoom);
}
}